diff options
author | Jesse Hall <jessehall@google.com> | 2012-05-04 14:52:40 -0700 |
---|---|---|
committer | Jesse Hall <jessehall@google.com> | 2012-05-04 15:21:35 -0700 |
commit | 201f3b2da572eb27b9d4b3131e6d8c3c92a13de8 (patch) | |
tree | 63081cff37d3ed3c304ac162faa4c41b23765911 /opengl | |
parent | 5c8a608497f12ecea4d6e8f1f286baf57c161ea3 (diff) | |
download | frameworks_native-201f3b2da572eb27b9d4b3131e6d8c3c92a13de8.zip frameworks_native-201f3b2da572eb27b9d4b3131e6d8c3c92a13de8.tar.gz frameworks_native-201f3b2da572eb27b9d4b3131e6d8c3c92a13de8.tar.bz2 |
Disable EGL hibernation due to jank
Hibernating EGL takes a long time (>100 ms) and blocks all other
rendering. During window animations, the outgoing activity begins
hibernation before the animation stops, causing visible stutter.
Hibernation is still available by setting 'BOARD_ALLOW_EGL_HIBERNATION
:= true' in the devices BoardConfig.mk
Change-Id: Iab4e00723a1adcd97481e81b2efdc821b3e9712f
Diffstat (limited to 'opengl')
-rw-r--r-- | opengl/libs/Android.mk | 4 | ||||
-rw-r--r-- | opengl/libs/EGL/egl_display.cpp | 2 | ||||
-rw-r--r-- | opengl/libs/EGL/egl_display.h | 18 |
3 files changed, 17 insertions, 7 deletions
diff --git a/opengl/libs/Android.mk b/opengl/libs/Android.mk index 66bc64d..c5c2618 100644 --- a/opengl/libs/Android.mk +++ b/opengl/libs/Android.mk @@ -36,6 +36,10 @@ LOCAL_CFLAGS += -DGL_GLEXT_PROTOTYPES -DEGL_EGLEXT_PROTOTYPES LOCAL_CFLAGS += -fvisibility=hidden LOCAL_CFLAGS += -DEGL_TRACE=1 +ifeq ($(BOARD_ALLOW_EGL_HIBERNATION),true) + LOCAL_CFLAGS += -DBOARD_ALLOW_EGL_HIBERNATION +endif + ifeq ($(TARGET_BOARD_PLATFORM),msm7k) LOCAL_CFLAGS += -DADRENO130=1 endif diff --git a/opengl/libs/EGL/egl_display.cpp b/opengl/libs/EGL/egl_display.cpp index f2e3897..2cd1a93 100644 --- a/opengl/libs/EGL/egl_display.cpp +++ b/opengl/libs/EGL/egl_display.cpp @@ -420,7 +420,7 @@ void egl_display_t::HibernationMachine::decWakeCount(WakeRefStrength strength) { if (mWakeCount == 0 && CC_UNLIKELY(mAttemptHibernation)) { egl_connection_t* const cnx = &gEGLImpl; mAttemptHibernation = false; - if (mDpyValid && + if (mAllowHibernation && mDpyValid && cnx->egl.eglHibernateProcessIMG && cnx->egl.eglAwakenProcessIMG) { ALOGV("Hibernating\n"); diff --git a/opengl/libs/EGL/egl_display.h b/opengl/libs/EGL/egl_display.h index 412568b..7bb09a3 100644 --- a/opengl/libs/EGL/egl_display.h +++ b/opengl/libs/EGL/egl_display.h @@ -155,7 +155,12 @@ private: }; HibernationMachine(): mWakeCount(0), mHibernating(false), - mAttemptHibernation(false), mDpyValid(false) + mAttemptHibernation(false), mDpyValid(false), +#if BOARD_ALLOW_EGL_HIBERNATION + mAllowHibernation(true) +#else + mAllowHibernation(false) +#endif {} ~HibernationMachine() {} @@ -165,11 +170,12 @@ private: void setDisplayValid(bool valid); private: - Mutex mLock; - int32_t mWakeCount; - bool mHibernating; - bool mAttemptHibernation; - bool mDpyValid; + Mutex mLock; + int32_t mWakeCount; + bool mHibernating; + bool mAttemptHibernation; + bool mDpyValid; + const bool mAllowHibernation; }; HibernationMachine mHibernation; }; |