aboutsummaryrefslogtreecommitdiffstats
path: root/android/opengles.c
Commit message (Collapse)AuthorAgeFilesLines
* Use a per-process server address for the GLES serverJesse Hall2012-07-111-15/+6
| | | | | | | | | | | | | | | Previously we used a hardcoded address (tcp port, unix pipe path, etc.) for the OpenGLRender system. Multiple emulators would all try to listen on the same address, with the system non-deterministically (?) choosing which one accepted each new connection. This resulted in frames going to the wrong emulator window, one emulator shutting down another's OpenGL system, etc. Now the OpenGLRender server requests an unused tcp port or derives a path from the pid, and reports the address back to the emulator client to use for future connections from the guest. Change-Id: I139d32615200b36b87f2d2ede4abb4060ec02776
* Track started and initialized states separatelyJesse Hall2012-06-051-4/+21
| | | | | | | | | | | Several OpenGL ES renderer functions are called blindly by the emulator and are supposed to do nothing if the renderer isn't running. They were checking whether the libraries were loaded instead of whether the renderer was started. This causes problems when the renderer is started and then stopped (for stats collection) since the libraries aren't unloaded. Change-Id: Ia6c0d2e5b618ff982b55caf35c38bda9aad30ee1
* Fix --no-gles config, and ease the pain of standalone emulator buildVladimir Chtchetkine2012-05-111-0/+5
| | | | | | | | | | 1. Apparently, emulator build fails when configured with --no-gles option due to missing android_setPostCallback implementation. 2. It's painful to configure standalone emulator build WITH OpenGLES, since it requires explicit using of --gles-include, and --gles-lib when launching android-configure.sh To ease that pain, just use default location for standalone emulator build. Change-Id: I2d9ed56d68a4ab1cb1ec294817f22dca80d33223
* Fix emulator's UI buildVladimir Chtchetkine2012-05-111-1/+1
| | | | | | | When building emulator-ui, build fails complaining that android_startOpenglesRenderer implementation doesn't match routine declaration. Fixing that. Change-Id: I5f3f588969c1b4c9a59035f8abddb63cc6c917ad
* Remove init-time GLES per-frame callbackJesse Hall2012-05-101-2/+11
| | | | | | | | | | The GLES renderer interface now allows the per-frame callback to be registered after initialization. This change updates the emulator to use the new interface. Since reading back completed frames is slow (due to pipeline flush/stall), a future change will enable the callback only while multitouch emulation is actually in use. Change-Id: I7ad23b4bebe1bd3077863da4d50333cc0578519e
* Fixed link-error for standalone emulator when CONFIG_ANDROID_OPENGLES == 0Andrew Hsieh2012-05-041-0/+10
| | | | | | | | Added a fake android_getOpenglesHardwareStrings (called in vl-android.c) when CONFIG_ANDROID_OPENGLES is not set or zero. This happens when ./android-configure.sh can't locate GLES include and libs. Change-Id: I1f99644adcc78b9872d7e9c6e1e7bd7b2a654119
* Provide GL strings from renderer to ddms pingJesse Hall2012-05-011-0/+57
| | | | Change-Id: I59c9e58c568a70855783e57514fec80b711d6a64
* Fix standalone emulator build.Jesse Hall2012-04-261-5/+44
| | | | | | | | | | - Allow building with OpenGL ES acceleration disabled, avoiding a dependency on stuff outside the QEMU project. - Allow the standalone configure.sh to provide the include/lib path for the OpenGL ES libraries. - Update the default OpenGL ES include path for standalone builds. Change-Id: I03f4627af4c271783b65a116ceb5934385c68cdc
* Rename a declaration to fix Mac SDK buildJesse Hall2012-04-251-1/+1
| | | | | | | | GCC on OS X is flagging a duplicate declaration error even though GCC on Linux isn't even warning about it. Not sure why. The declaration is duplicated, but identical. Renaming one of the two. Change-Id: I946b5f3a4e410b66e9ab2ae3160ff1bec4e0ddd7
* Publish and use libOpenglRender interface headerJesse Hall2012-04-181-31/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | The emulator opengles.c file duplicated the function declarations from libOpenglRenderer's render_api.h instead of including it directly. This led to multiple bugs since the declarations didn't actually match, but there was no way for the compiler or dynamic loader to check this. This change makes opengles.c include render_api.h to get function pointer prototypes, and changes the prototypes/implementation as necessary to make both sides actually match. It should be much more difficult to introduce interface mismatch bugs now. Two bugs this change would have prevented: (a) The interface mismatch caused by inconsistent branching which led to GPU acceleration crashing on Windows. With this change, we would have caught the problem at compile time. (b) The emulator verbose log has always been printing "Can't start OpenGLES renderer?" even when the renderer started fine. This is because the renderer was returning a bool (true == success) but the emulator's declaration said it returned int, and the emulator assumed 0 meant success. This difference in return type should now be caught at compile time. Change-Id: I5b3c70c9a40854332d67e37333acd6edb6ad01f6
* EmuGL: Add OnPost callback to OpenGL rendererJesse Hall2012-03-221-3/+3
| | | | | | | | | | Match the interface changes in the OpenGL renderer that add a per-frame callback. The callback isn't used in this change. This change is co-dependent on Idae3b026d52ed8dd666cbcdc3f3af80175c90ad3 in development/. Change-Id: Idae3b026d52ed8dd666cbcdc3f3af80175c90ad3
* 64-bit emulatorAndrew Hsieh2012-03-131-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Patch to allow emulator searches for emulator64-${ARCH} first on 64-bit OS. If none is found, the original behavior which searchs for 32-bit emulator-${ARCH} is performed as usual. 64-bit emulator (which still emulates Android built in 32-bit) offers up to 20% speedup compared to its 32-bit counterpart. Details: android/main-emulator.c 1) search emulator64 based on the OS 2) dlopen lib64OpenglRender in 64-bit Makefile.* 1) Rules to build 64-bit executable emulator64-{x86,arm} and libraries emulator64-{libui,libqemu,target-i386,target-arm,libelff,common} 2) remove -Wa,-32 3) Changes prebuit toolchain path android-configure.h android/build/common.h 1) no longer force 32-bit build (because now prebuilts/tools/gcc-sdk/gcc can now handle 64-bit 2) set ANDROID_PREBUILTS to correctly locate ccache android/config/*/config-host.h 1) Detect HOST_X86_64 and HOST_X86_64/HOST_I386 Misc 64-bit porting clean-up 1) use %zx to print variable of type size_t in hex 2) use %zu to print variable of type size_t in dec 3) Initialize query_parm to NULL 4) use PRIu64 to replace PDUd64 5) use PRId64/PRIu64/PRIX64 to print 64-bit 6) drop PRUx64 because PRIx64 does the same 7) cast pointer arith to intptr_t before casting to int 8) fixed 1ULL<<63 Change-Id: Ife62a20063a6ec38d4a9b23977e840af1fce149a
* gles: use fast GLES pipe by default (Unix only)David Turner2011-09-131-0/+34
| | | | | | This improves performance of various benchmarks by 5% Change-Id: If2d2be0e9849429ecffe52b7d482cfbee4008473
* Add hw.gpu.enabled hardware propertyDavid 'Digit' Turner2011-08-291-0/+167
This patch adds a new hardware property to enable GPU emulation (named hw.gpu.enabled). It is currently disabled by default. It also modifies the UI code to display the GL output properly inside the UI window. And sets the kernel parameter qemu.gles to either 0 or 1 to indicate to the guest system's GLES libraries whether to use GPU emulation or fallback to the software renderer. A future patch will also add auto-detection of desktop GL capabilities. For example, if the emulator is started on a headless server without an X11/GL display, hw.gpu.enabled will be forced to 'no', forcing the guest to use the software renderer. Another patch will allow to change the property from the command-line for debugging purpose. NOTE: If you want to test GPU emulation, change the default value of the property in android/avd/hardware-properties.ini from 'no' to 'yes'. You will need to run a ToT master AOSP tree with the following pending patches applied: https://review.source.android.com/25797 https://review.source.android.com/25154 https://review.source.android.com/25759 Change-Id: I1fa3512be24395244fd5068f2bf59ad54db5c7d5