aboutsummaryrefslogtreecommitdiffstats
path: root/emulator
Commit message (Collapse)AuthorAgeFilesLines
* emulator/opengl: Fix misc. compiler warnings.David 'Digit' Turner2014-04-0115-62/+29
| | | | | | | 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 EGL queryConfigs().David 'Digit' Turner2014-04-011-2/+2
| | | | | | | | | | The function uses DescribePixelFormat() which doesn't return a count, but a maximum index, in a base-1 list of possible formats, so adjust the code accordingly. See http://msdn.microsoft.com/en-us/library/windows/desktop/dd318302(v=vs.85).aspx Change-Id: Id0cc92249348e6c845570adaaf4c280721a194bb
* emulator/opengl: Fix eglWaitGL implementation.David 'Digit' Turner2014-04-011-1/+3
| | | | | | | | | | | The eglWaitEGL implementation didn't restore the previous bound API after calling eglWaitClient. This probably isn't a big concern for emugl correctness, but fixing this removes a compiler warning. See http://www.khronos.org/registry/egl/sdk/docs/man/xhtml/eglWaitGL.html Change-Id: I143ffeeefa01aff502d27d4e1d6f892f0d1efe5b
* emulator/opengl: Fix Windows SDK build.David 'Digit' Turner2014-03-112-1/+29
| | | | | | | | | | | | | | | | | | 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-1124-142/+406
| | | | | | | | 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-115-26/+10
| | | | | | | | 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-1113-37/+990
| | | | | | | | | | | | | | | | | 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-1130-220/+458
| | | | | | | | | | | 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-063-4/+45
| | | | | | | 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-064-9/+3
| | | | | | | This patch removes a few minor compiler warnings related to unused local variables. Change-Id: Icd4b3b478dce0c38cc1dd04419db7350dcbdb8f6
* emulator: Remove obsolete qtools directory.David 'Digit' Turner2014-01-2948-10195/+0
| | | | | | | | | | | | | | | | | | The executable declared in this directory were used to process traces that are generated with the "emulator -trace <name>" option. Unfortunately this feature is broken in many ways: - Only works for ARMv5, not ARMv7, x86 and MIPS - Generates invalid timings that do not reflect modern CPU architectures. Nobody has been using it for a long time, and the feature will be removed from external/qemu, including the removal of one header file included by the code under sdk/emulator/qtools. This patch simply removes the qtools sources entirely. Change-Id: I6e7d141393e71afb36d950c264f73752d42dc412
* gtest needs -lpthread.Elliott Hughes2014-01-281-0/+1
| | | | Change-Id: I020a56c0a762c4df9c0c7cabc17c862e05699c18
* emulator/opengl: Refactor SmartPtr implementation.David 'Digit' Turner2014-01-2121-358/+467
| | | | | | | | | | | | | | | | | | | | | | | | | | 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: Prepare out-of-platform build with SDL.David 'Digit' Turner2014-01-186-25/+318
| | | | | | | | | | | A small patch to prepare for the out-of-platform-tree build. This ones places SDL-related definitions in a new build file (sdl.mk) and provide a way for the emulator's build system to provide its own SDL compiler and linker flags. + Add missing KHR/khrplatform.h file. Change-Id: I496f1a49730ffbfae80a074e09611bd07777cf1a
* emulator/opengl: Get rid of all compiler warnings (Linux).David 'Digit' Turner2014-01-1815-69/+83
| | | | | | | | | | | 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
* Fix idea133 build.David 'Digit' Turner2014-01-171-1/+1
| | | | | | | Breakage was introduced by https://android-review.googlesource.com/#/c/79332/ which modified the location of some headers referenced here. Change-Id: I801ba2527386af0d6d2961f2c79f5db332a6d023
* Merge "Catch NULL context and bubbling error up."Xavier Ducrohet2013-11-214-14/+21
|\
| * Catch NULL context and bubbling error up.Stuart Scott2013-08-234-14/+21
| | | | | | | | | | | | | | | | bug: 10456411 Fix for internal bug Change-Id: I85181d358f1844b25cc85fbaf5f64842d5ed6f22
* | Merge "Copy the GL2 extension string before destroying context"Xavier Ducrohet2013-11-211-8/+15
|\ \
| * | Copy the GL2 extension string before destroying contextJesse Hall2013-08-231-8/+15
| |/ | | | | | | | | | | | | | | | | | | The pointer returned by glGetString is owned by the GL context, so when the GL context is destroyed it may become invalid. This happens on Mesa, for example. Make/manage our own copy of the extension string to use after destroying the context. Bug: 9627179 Change-Id: I605536151ee64f50403546d0d38c5b5f1f27dd73
* | Merge "EglMacApi: Make sure that some returned EGL configs have alpha == 0"Xavier Ducrohet2013-11-213-1/+38
|\ \
| * | EglMacApi: Make sure that some returned EGL configs have alpha == 0Martin Storsjo2013-09-253-1/+38
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is what the pixel format attribute lists in MacPixelFormatsAttribs.m try to achieve, but despite this, alpha is nonzero in every returned configuration on certain (all?) machines (at least on 10.8.5 on a nvidia gpu). This means that EGL won't return any configs at all with alpha == 0. The default config chooser in GLSurfaceView requires a config with alpha == 0. This means that previously, this view failed to start up on the emulator on OS X, unless set up with a non-default config chooser. Change-Id: I2bf3e92a026c525a97d6746e491d920ce127787f
* | 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
* | Merge changes I0cccba67,I4cf8a19bXavier Ducrohet2013-11-081-2/+3
|\ \ | |/ |/| | | | | | | * changes: Ignore empty ranges Fix rangeUnion return value in the successful case
| * Ignore empty rangesAlessandro Pignotti2013-07-301-1/+2
| | | | | | | | Change-Id: I0cccba6795e3b9709cc646f6fa55bb60e6446ea1
| * Fix rangeUnion return value in the successful caseAlessandro Pignotti2013-07-301-1/+1
| | | | | | | | | | | | | | Even if the ranges can be merge rangeUnion was returning false. Most probably this was a typo. Change-Id: I4cf8a19bd701a8501c2d49cf0bfa996f9e12c02f
* | Merge changes Ibc381479,I21a2430cXavier Ducrohet2013-08-143-30/+15
|\ \ | | | | | | | | | | | | | | | * changes: ColorBuffer: Remove the y-invert Intel GPU bug workaround EglMacApi: Use the right pbuffer texture target and format parameters
| * | ColorBuffer: Remove the y-invert Intel GPU bug workaroundMartin Storsjo2013-08-102-29/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The fix in 57501158 makes sure pbuffers get initialized properly. The previously incorrect pbuffer texture parameters had different effects on different GPUs/drivers. On a Nvidia GT 650M, the buffers were rendered properly but glReadPixels calls were inverted, while Intel HD 3000/4000 seemed to get the rendering inverted as well. By passing proper pbuffer texture parameters, the bug (which in itself was no driver bug but inconsistent behaviour when given invalid parameters) vanishes. This reverts the bug workaround parts of 9322c5cb (from development.git). Change-Id: Ibc38147967361cba6ba85cdf3b4e9a2e2ee6d881
| * | EglMacApi: Use the right pbuffer texture target and format parametersMartin Storsjo2013-08-101-1/+10
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The target and format parameters are in the EGL parameter range (and are stored in EGLints), while nsCreatePBuffer (which calls NSOpenGLPixelBuffer initWithTextureTarget) takes GLenums. This is pretty much similar to the same function in EglWindowsApi.cpp, but contrary to that function, there's nothing similar to WGL_NO_TEXTURE_ARB in initWithTextureTarget, so something has to be specified in all cases. Previously, the default EGL_NO_TEXTURE (0x305C) was passed through. While this mostly worked just fine, it had the surprising hidden side effect of using a vertically flipped coordinate system in glReadPixels (with the origin being the top left corner instead of the bottom left one, which is default in OpenGL). This makes the EncodeDecodeTest media CTS test pass with surface output on the emulator on Mac OS X. (This test renders the decoded video to a pbuffer and checks individual pixel values using glReadPixels.) Change-Id: I21a2430ce6334a5e82ea3203c4d157f5bad1558d
* | Check the return value of eglChooseConfigMartin Storsjo2013-08-111-1/+3
|/ | | | | | | | | | | | The EGL specs say that eglChooseConfig doesn't update num_config if it returns a failure (which is exactly what Translator/EGL/EglImp.cpp does). Therefore, if this function returned a failure (e.g. due to an unsupported egl attribute), nConfigs was left untouched, meaning that the configs array was left uninitialized but treated as if it was full of valid configs. Change-Id: I3809272298ea10d65dc939849d2e3c17d1158da6
* Merge "Fix RenderThreadInfo lifetime and cleanup"Jesse Hall2013-07-116-62/+45
|\
| * Fix RenderThreadInfo lifetime and cleanupJesse Hall2013-06-186-62/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of using a TLS destructor, RenderThreadInfo is now an automatic variable of RenderThread::Main(), so is automatically destroyed on thread exit. RenderThread::Main() now explicitly unbinds the thread's context and surfaces from the FrameBuffer, ensuring that the thread has released all references before it exits. This fixes a bug where RenderThreadInfo's destructor was releasing the references in the TLS destructor, which caused ColorBuffer's destructor to call FrameBuffer::bind_locked() when the FrameBuffer lock wasn't held. By clearing the references in FrameBuffer::bindContext(), locking around destruction happens correctly. Change-Id: I617cea838d5f352a597ccc6d3dbd8f9c08cb91bd
* | Fix a crash which occured with some graphic libraries.Deepanshu Gupta2013-06-211-4/+4
|/ | | | | | | Fix a small bug that caused the emulator to crash when used with some graphic libraries. Change-Id: Ifb7e0b11a8302d0538632dac467d187dfcdfda47
* Prevent SocketStream to be freed twicePetar Jovanovic2013-05-171-8/+8
| | | | | | | | | In cases when RenderThread failed to start, RenderServer would free the stream first and then the thread. However, the thread itself also attemps to free the stream and this caused a crash of the emulator in some corner cases. Change-Id: I2e508c37ab0a09c9261b30e59072bf1a44982dfe
* use tlsDestruct in linux to destroy thread specific OpenGl resourceskeunyoung2013-04-052-29/+23
| | | | | | - lack of tlsDestruct causes resource leakage in linux Change-Id: I6f5308fd00da06dbecd9246393021e3d72aa40c3
* delete socket when the thread is destroyedkeunyoung2013-04-012-1/+6
| | | | | | | - SocketStream is passed from RenderServer::Main, but it is not deleted. - As a result, emulator will keep opening these sockets. Change-Id: I4f2445855fc45a8d5f20f4d598e7021e8f3e000c
* prevent dead-lock by removing mutex lock in errorHandlerProckeunyoung2013-03-281-1/+0
| | | | | | | | - setting int should be OK even without lock as there is no synchronization in reader side - dead-lock can happen inside constructor if the same error handler is already set and if error happens inside constructor in place like XSync Change-Id: I2f401067e0555ae092df23f57cc9ab054a1555d7
* Delete duplicate filesYing Wang2013-02-2810-3689/+0
| | | | | | These files are already in development/tools/emulator. Change-Id: I58988ce49804583b06e7d93380c44ba800448216
* Extend Mac Intel graphics bug workaround to HD 4000Jesse Hall2012-12-101-8/+11
| | | | | Bug: 39835 Change-Id: Ied3f43b76d2bb1bdba478f57122ec0ef4d967ae4
* Add a new skin 'dynamic'.Siva Velusamy2012-10-0825-0/+914
| | | | | | | | | | | This skin only defines the parts that can be used. Its layout section is expected to be generated at runtime by the emulator when the option -dynamic-skin is used. The assets used to generate this skin are placed in the assets folder. Change-Id: Ib252ed6a7b1ef16c21c3d45bdc0c977c1ad42466
* Check that the native display is valid before using itJesse Hall2012-08-245-0/+16
| | | | | | | | | | | EglOS::getDefaultDisplay() can return an invalid display, e.g. on X11 if $DISPLAY is not set. This is called from the EglGlobalInfo constructor, which doesn't have a good way to indicate failure. So instead EglGlobalInfo::addDisplay() checks that the display is valid before wrapping it in a EglDisplay. Bug: 7020498 Change-Id: Id18fc568dae5bff4b45b706f3322ae5e4785d95d
* host modules don't need LOCAL_MODULE_TAGSJoe Onorato2012-08-161-1/+1
| | | | Change-Id: I5412777820c8b0e691d07b10df348a739f92f291
* Fixed "Bus error" running tests triangleV2 and triangleCMAndrew Hsieh2012-08-102-6/+14
| | | | | | | | | | Function __dyld_func_lookup is deprecated and invisible in Mac SDK 10.6+. Instruct linker to resolve it at run-time. Related CL https://android-review.googlesource.com/#/c/37355/ fix the build, but cause run-time "Bus error". Change-Id: Icf3ea7a0b8ac29c69482e372f34e0b2e364472d8
* Send full-size framebuffer to OnPost callbackJesse Hall2012-07-203-10/+23
| | | | | | | | | | | When the emulator window has non-1.0 scaling, the scale is applied when blitting the Android framebuffer to the host window. For the OnPost callback, we were not only reading the image back from the window (so post-scaling), we were also storing it in a 1.0-scaled buffer. Now we read back from the Android framebuffer image, which is always 1.0-scaled. Change-Id: Ia9c974711a9a4b0b19f4b997f65ecc64481b4c6a
* Fix OSX emulator build due to missing headerJesse Hall2012-07-121-0/+1
| | | | Change-Id: I84133fb36d8f15ed33e6bcba2be158e43c903901