diff options
| author | 2017-06-14 10:47:50 -0700 | |
|---|---|---|
| committer | 2017-06-14 10:50:14 -0700 | |
| commit | a896306c38c4d11c43b967a21db6d74c251b2520 (patch) | |
| tree | d02997fd55bdbfbd05a3d09a320aba505c6c887a /libs/hwui/renderthread | |
| parent | 890cb590039774969a79ac7d0b8f27f0bb227e9f (diff) | |
Add a workaround for simulate secondary display
To workaround a deadlock caused by bufferqueue locks
we force RenderThread over to use async mode which
we enable via eglSwapInterval(0)
Bug: 38372997
Test: steps in the bug
Change-Id: Ia305f73abbdd64ab0c25d1f7d32792cc6295a0ce
Diffstat (limited to 'libs/hwui/renderthread')
| -rw-r--r-- | libs/hwui/renderthread/EglManager.cpp | 3 | ||||
| -rw-r--r-- | libs/hwui/renderthread/RenderProxy.cpp | 5 | ||||
| -rw-r--r-- | libs/hwui/renderthread/RenderProxy.h | 2 |
3 files changed, 10 insertions, 0 deletions
diff --git a/libs/hwui/renderthread/EglManager.cpp b/libs/hwui/renderthread/EglManager.cpp index 44af5fd8d0dd..ed3070887b8b 100644 --- a/libs/hwui/renderthread/EglManager.cpp +++ b/libs/hwui/renderthread/EglManager.cpp @@ -279,6 +279,9 @@ bool EglManager::makeCurrent(EGLSurface surface, EGLint* errOut) { } } mCurrentSurface = surface; + if (Properties::disableVsync) { + eglSwapInterval(mEglDisplay, 0); + } return true; } diff --git a/libs/hwui/renderthread/RenderProxy.cpp b/libs/hwui/renderthread/RenderProxy.cpp index eed523810403..d842be9e7d6e 100644 --- a/libs/hwui/renderthread/RenderProxy.cpp +++ b/libs/hwui/renderthread/RenderProxy.cpp @@ -18,6 +18,7 @@ #include "DeferredLayerUpdater.h" #include "DisplayList.h" +#include "Properties.h" #include "Readback.h" #include "Rect.h" #include "renderthread/CanvasContext.h" @@ -708,6 +709,10 @@ void RenderProxy::onBitmapDestroyed(uint32_t pixelRefId) { thread.queue(task); } +void RenderProxy::disableVsync() { + Properties::disableVsync = true; +} + void RenderProxy::post(RenderTask* task) { mRenderThread.queue(task); } diff --git a/libs/hwui/renderthread/RenderProxy.h b/libs/hwui/renderthread/RenderProxy.h index b21772cd88de..6f4e8cef4502 100644 --- a/libs/hwui/renderthread/RenderProxy.h +++ b/libs/hwui/renderthread/RenderProxy.h @@ -137,6 +137,8 @@ public: static int copyGraphicBufferInto(GraphicBuffer* buffer, SkBitmap* bitmap); static void onBitmapDestroyed(uint32_t pixelRefId); + + ANDROID_API static void disableVsync(); private: RenderThread& mRenderThread; CanvasContext* mContext; |