aboutsummaryrefslogtreecommitdiffstats
path: root/emulator/opengl/shared
Commit message (Collapse)AuthorAgeFilesLines
* emulator/opengl: Remove obsolete directory.David 'Digit' Turner2014-12-0857-7587/+0
| | | | | | | | | | | | | All sources were moved to external/qemu/distrib/android-emugl to make it easier to modify both the emulator and host libraries at the same time. See: https://android-review.googlesource.com/#/c/118203/ As such, the sources in this directory are now ignored and can be safely removed. Change-Id: I5d143c971f995e2599e5e1d6174030d6803e8080
* emulator/opengl/emugen: Ensure correct buffer alignment.David 'Digit' Turner2014-09-241-0/+80
| | | | | | | | | | | | | | The decoders generated by emugen pass addresses that come directly from the stream to EGL/GL functions. Sometimes, these addresses are not properly padded with regards to the type of data being transfered and this can crash some implementations (e.g. OSMesa being compiled with -msse by default, and doesn't build without it). This patch introduces two helper classes in ProtocolUtils.h, named InputBuffer and OutputBuffer, which are used to auto-align buffer pointers, then make the generated decoder code use them. Change-Id: I345c7eecc230f62310ced5378b6344f419647e06
* emulator/opengl: Add UniqueIntegerMap class.David 'Digit' Turner2014-09-163-0/+329
| | | | | | | | This helper class will be used by future patches to map arbitraty opaque 'void*' values (e.g. EGLImage values) to 32-bit unique values that can be sent through the wire protocol. Change-Id: I5b17a1f230e5f9f8b905af66ba79b312f3f01e55
* emulator/opengl/emugen: Use templates to read values from stream.David 'Digit' Turner2014-09-161-0/+107
| | | | | | | | | | | | | | The decoder didn't properly handle GLsizeiptr and GLintptr values, which are always 32-bit on the wire, but can be 64-bit on the host. I.e. it did something like that to read them from the stream: *(GLsizeiptr*)(ptr + offset) This fixes the issue by using templates to generate host-type-specific functions that properly read data from the stream and convert it to the appropriate host type. Change-Id: I75749bd715456ca143eb1713498f7cf635918801
* emulator/opengl: Cleanup build files + remove obsolete tests.David 'Digit' Turner2014-08-272-28/+19
| | | | | | | | | | | | | | | | | | | | | | This patch cleans up the build files for the GPU emulation libraries (i.e. there is no need to test for BUILD_EMULATOR_64BITS anymore, filtering is now handled by the build system directly). + Remove a bunch obsolete tests, which were not unit tests, despite their name beginning with ut_xxxx. Which includes removing dependency on SDL too. + Remove -m64 and -fPIC flags from compilation. These are not necessary anymore (again, the build system now takes charge of placing them when necessary), and generated link-time warning when building Windows executables. + Remove a few declarations related to the now-obsolete platform build (these libraries are only built with the emulator's build system now). Change-Id: I27c28979c42cd51f2fe9e30edd4141136e80ee03
* Support dynamic lib name without ".dylib" on MacTina Zhang2014-07-273-4/+44
| | | | | | | | | | On Mac, some of the dynamic libs has name without ".dylib". Like, "System/Library/Frameworks/OpenGL.framework/OpenGL", we need solution to handle it in the dlopen() API. Change-Id: Ie513ace5a0d7d154f73e0f13919005d1498901d7 Signed-off-by: Tina Zhang <tina.zhang@intel.com> Signed-off-by: Chao Qin <chaox.qin@intel.com>
* emulator/opengl: Remove out-of-process handling code.David 'Digit' Turner2014-07-095-493/+5
| | | | | | | | | | | This removes the last pieces of shared/OpenglOsUtils which were never used since the code in render_api.cpp always used thread-based rendering, instead of process-based one. This feature could be re-implemented in the future, if really desirable. Change-Id: I551e0f3d6d5a06ff66cb40b007e2b24c295f1dd8
* emulator/opengl: refactor Thread class.David 'Digit' Turner2014-07-099-265/+455
| | | | | | + Add unit test. Change-Id: I26d84cf590f6bfff3304be3f42dc0196bcc7f6d2
* emulator/opengl: refactor shared library handling.David 'Digit' Turner2014-07-098-153/+373
| | | | | | + Add a unit test. Change-Id: I27c993d1dc819e5bd89fc1e9ae266e11e6ef9a76
* emulator/opengl: Prepare for 64-bit build changes.David 'Digit' Turner2014-06-113-4/+4
| | | | | | | | | | | This patch slightly modifies the build files for the GPU emulation libraries to prepare for future changes in the emulator-specific build system that will be necessary to support Win64 binaries. The main difference is the introduction of 64-bit versions of the emugl-begin-host-<type> macros, named emugl-begin-host64-<type>. Change-Id: Ib40c030fa407b0ed951755dd9b007fda85778e03
* emulator/opengl: Fix GCC 4.8 warnings.David 'Digit' Turner2014-04-281-1/+2
| | | | | | | | This fixes a few compiler warnings when building the GPU emulation libraries with GCC 4.8. Note that GLbyte is defined as khronos_int8_t which is signed! Change-Id: I52027cd2eb20d6162983319f22d4da150ff514ed
* emulator/opengl: Fix misc. compiler warnings.David 'Digit' Turner2014-04-015-7/+1
| | | | | | | These warnings appear when building the sources through the emulator's standalone build system, not the platform one. Change-Id: Ib5d51cf6211f32763be00c7436ae14c06f76b436
* emulator/opengl: Fix Windows SDK build.David 'Digit' Turner2014-03-111-1/+2
| | | | | | | | | | | | | | | | | | This patch fixes the Windows SDK build. A previous patch apparently broke it even though I could not reproduce this locally before submitting. What it does is, when using the platform build to generate Windows binaries, use the host Linux binary instead of rebuilding the 'emugen' tool from sources. Note that the emulator's standalone build supports building host Linux binaries even when targetting Windows by default. + Add a missing module import that got lost in translation for some odd reason. Change-Id: I2ccd962d8b3df859b2cba82573225820b69b0d32
* emulator/opengl: Allow standalone build.David 'Digit' Turner2014-03-113-23/+36
| | | | | | | | This patch improves the build files for the GPU emulation libraries to allow them to be built directly with the emulator's own standalone build system. Change-Id: I205392bdfe4223a5c43fa67e24a2beffcbcbc07a
* emulator/opengl: Remove libcutils/libutils/liblogDavid 'Digit' Turner2014-03-112-18/+6
| | | | | | | | Final patch to completely remove dependencies on libcutils/libutils/liblog from the host-side GPU emulation libraries. Change-Id: I84a058bbd0ca676b18c0b0a094ac8bae692f9c94
* emulator/opengl: Remove <utils/List.h> + <utils/String8.h>David 'Digit' Turner2014-03-112-2/+6
| | | | | | | | | | | | | This removes dependencies on two libutils headers. Rather than provide alternative data types, simply disable the corresponding code because it looks like the corresponding fields are simply never used by the code? It is likely that this code is only used in the guest portion of the code, and thus completely un-necessary on the host side. Change-Id: I22c67f114c2c77381ceba8de23dd631158276596
* emulator/opengl: Remove android::KeyedVector usage.David 'Digit' Turner2014-03-116-146/+636
| | | | | | | Replace it with a custom emugl::IdToObjectMap template class that owns the objects, simplifying the code. Change-Id: Id18319e8080211acebed814bc0d702fbaab3b245
* emulator/opengl: Remove android::Vector<> usage.David 'Digit' Turner2014-03-117-8/+582
| | | | | | | | | | | | | This remove the use of android::Vector<> by providing an alternative vector implementation (emugl::PodVector<>) which is heavily based on the emulator version under external/qemu/android/base/containers/PodVector.h. Ultimately the GPU emulation libraries will move under external/qemu/, and the code will be changed to use android::base::PodVector<> instead of emugl::PodVector<>. Change-Id: I9836ed961795c0791115c61e731d15d17f036972
* emulator/opengl: Remove <cutils/sockets.h>David 'Digit' Turner2014-03-116-55/+308
| | | | | | | | Remove the dependency on <cutils/sockets.h> by providing "emugl/common/sockets.h" instead, which contains similar utility wrappers. Change-Id: Ifd48abeb208b004c801c9447a4141881f6fa8f44
* emulator/opengl: Remove Android-specific thread_store.David 'Digit' Turner2014-03-1110-2/+917
| | | | | | | | | | | | | | | | | This patch removes the use of the 'thread_store' class from <utils/threads.h> by providing its own implementation instead under shared/emugl/common/thread_store.h, plus appropriate unit tests. Note that unlike the Android version, this properly destroys the thread-local values on thread exit (instead of leaking them). + Provide a LazyInstance class used to perform thread-safe lazy initialization of static variables without the use of C++ constructors. Change-Id: Iabe01fbd713c6872b5fe245d7255c3c03749a88a
* emulator/opengl: Remove android::Mutex.David 'Digit' Turner2014-03-116-27/+305
| | | | | | | | | | | This patch removes the dependency on android::Mutex from <cutils/threads.h> by providing a custom implementation, which is a simple wrapper around pthread_mutex_t / CriticalSection, under shared/emugl/common/mutex.h + Provide unit tests. Change-Id: I379ef0c480c478ab9ba5f2faaf8274267eff37ba
* emulator/opengl: Build 64-bit unit tests.David 'Digit' Turner2014-03-061-4/+5
| | | | | | | This is done by building a special version of GoogleTest specially for the GPU emulation libraries. Change-Id: Ie27c75d9a85836f392375e110a5152031af586bc
* emulator/opengl: Fix SmartPtr memory leak.David 'Digit' Turner2014-03-062-2/+4
| | | | Change-Id: I35d0650f2d69b3616167ee03decdc96b7ec09b2a
* emulator/opengl: Remove compiler warningsDavid 'Digit' Turner2014-03-061-2/+2
| | | | | | | This patch removes a few minor compiler warnings related to unused local variables. Change-Id: Icd4b3b478dce0c38cc1dd04419db7350dcbdb8f6
* gtest needs -lpthread.Elliott Hughes2014-01-281-0/+1
| | | | Change-Id: I020a56c0a762c4df9c0c7cabc17c862e05699c18
* emulator/opengl: Refactor SmartPtr implementation.David 'Digit' Turner2014-01-218-171/+438
| | | | | | | | | | | | | | | | | | | | | | | | | | This gets rid of two copies of SmartPtr.h and replaces them with a single implementation under shared/emugl/common/smart_ptr.* Note that this uses a new include path rooted at the shared/ directory for classes that are likely to be built both for the host and the device (in case we back-port this to device/generic/goldfish/opengl/ in the future). + Add a gtest-based set of unittests, after building, just call 'emugl_common_host_unittests' to run it. Note that this probably needs a 64-bit version as well, will come later once I find a way to build GTest for 64-bits without breaking the platform build :-) Also note that this moves the class to the 'emugl' namespace, in order to make the code easier to build out of the platform tree, and embed it in other projects. More classes will be transitioned / refactored in future patches. AOSP_BUG=64806 Change-Id: Ieb326c5f3f002a21537b8a391a82ce2ef9925073
* emulator/opengl: Get rid of all compiler warnings (Linux).David 'Digit' Turner2014-01-181-3/+4
| | | | | | | | | | | This patch gets rid of all compiler warnings for the GPU emulation libraries when building on a Linux host. Note that GLcommon/GLutils.h now provides two new functions to perform 'safe' type casts between unsigned integers and pointers: SafePointerFromUInt() and SafeUIntFromPointer(). Change-Id: I01c48bbd72f925d70eb9831f57e15815e687121f
* Delete buffer data when removing it from the SharedGroup namespaceJesse Hall2013-11-091-14/+36
| | | | | | | | | | Updating or deleting data associated with a buffer object was clearing the name->data association, but not actually deallocating the data. Thanks to manjian2006 for finding the bug and proposing the fix. Bug: 60468 Change-Id: Ibabfb1bace8acdeb1a4bbe5bf922845d096a8d22
* Use a per-process server address for the GLES serverJesse Hall2012-07-117-33/+39
| | | | | | | | | | | | | | | 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: I6af2eac0c7f27670a3b6595772eebc7aa2b24688
* Move emugl system code to development.gitJesse Hall2012-06-062-26/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Because of the way the SDK and Android system images are branched, host code that goes into the SDK tools can't live in the same repository as code that goes into the system image. This change keeps the emugl host code in sdk.git/emulator/opengl while moving the emugl system code to development.git/tools/emulator/opengl. A few changes were made beyond simply cloning the directories: (a) Makefiles were modified to only build the relevant components. Not doing so would break the build due to having multiple rule definitions. (b) Protocol spec files were moved from the guest encoder directories to the host decoder directories. The decoder must support older versions of the protocol, but not newer versions, so it makes sense to keep the latest version of the protocol spec with the decoder. (c) Along with that, the encoder is now built from checked in generated encoder source rather than directly from the protocol spec. The generated code must be updated manually. This makes it possible to freeze the system encoder version without freezing the host decoder version, and also makes it very obvious when a protocol changes is happening that will require special backwards-compatibility support in the decoder/renderer. (d) Host-only and system-only code were removed from the repository where they aren't used. (e) README and DESIGN documents were updated to reflect this split. No actual source code was changed due to the above. Change-Id: I70b576a70ac3dc94155f931508b152178f1e8cd5
* Explicitly include -X11 while building emulator_rendererBhanu Chetlapalli2012-05-101-1/+1
| | | | | | | | | | | | | | | | emulator_renderer implicitly uses symbols defined by libX11.so through intermediate libraries, which can cause dependency issues if the intermediates drop the dependency. The linkers on distros like fedora now explicilty disable such indirect dependency resolution - which causes compilation failure. More information is available at this URL http://fedoraproject.org/wiki/UnderstandingDSOLinkChange Signed-Off-By: Bhanu Chetlapalli <bhanu@mips.com> Change-Id: If378fa76142cb6c8c7641d76802dcbc7691871d6
* Move emulator GLES from development.git to sdk.gitJesse Hall2012-04-1634-0/+4333
The emulator GLES support has two interfaces: a host shared library interface used by QEMU, and a protocol between the platform and the host. The host library interface is not versioned; QEMU and the GLES renderer must match. The protocol on the other hand must be backwards compatible: a new GLES renderer must support an older platform image. Thus for branching purposes it makes more sense to put the GLES renderer in sdk.git, which is branched along with qemu.git for SDK releases. Platform images will be built against the protocol version in the platform branch of sdk.git. Change-Id: I2c3bce627ecfd0a4b3e688d1839fe10755a21e58