diff options
author | Mathias Agopian <mathias@google.com> | 2011-11-04 18:46:11 -0700 |
---|---|---|
committer | Dave Burke <daveburke@google.com> | 2011-11-09 16:01:07 -0800 |
commit | 3e458306b0caf4e21294acc58286b24bda08a242 (patch) | |
tree | be02311312135a55de46f0e0562b06501a596c36 | |
parent | 3124bf64404dbb90cc521abf4c7bf8d438346362 (diff) | |
download | frameworks_base-3e458306b0caf4e21294acc58286b24bda08a242.zip frameworks_base-3e458306b0caf4e21294acc58286b24bda08a242.tar.gz frameworks_base-3e458306b0caf4e21294acc58286b24bda08a242.tar.bz2 |
Set the WM refresh rate to 60 Hz for tuna devices only DO
NOT MERGE
This approach is TEMPORARY until we can do this properly.
Change-Id: I81a8f852df501b2faccffdae7cac954855a6c98f
-rw-r--r-- | services/java/com/android/server/wm/WindowManagerService.java | 8 | ||||
-rw-r--r-- | services/surfaceflinger/Android.mk | 4 | ||||
-rw-r--r-- | services/surfaceflinger/DisplayHardware/DisplayHardware.cpp | 11 |
3 files changed, 17 insertions, 6 deletions
diff --git a/services/java/com/android/server/wm/WindowManagerService.java b/services/java/com/android/server/wm/WindowManagerService.java index 6546d61..122d515 100644 --- a/services/java/com/android/server/wm/WindowManagerService.java +++ b/services/java/com/android/server/wm/WindowManagerService.java @@ -227,11 +227,6 @@ public class WindowManagerService extends IWindowManager.Stub static final int DEFAULT_FADE_IN_OUT_DURATION = 400; /** - * Frame rate. TODO: Replace with Display.getRefreshRate() when that is reliable. - */ - static final int FRAME_RATE = 48; - - /** * If true, the window manager will do its own custom freezing and general * management of the screen during rotation. */ @@ -8665,7 +8660,8 @@ public class WindowManagerService extends IWindowManager.Stub if (needRelayout) { requestAnimationLocked(0); } else if (animating) { - requestAnimationLocked(currentTime+(1000/FRAME_RATE)-SystemClock.uptimeMillis()); + final int refreshTimeUs = (int)(1000 / mDisplay.getRefreshRate()); + requestAnimationLocked(currentTime + refreshTimeUs - SystemClock.uptimeMillis()); } // Finally update all input windows now that the window changes have stabilized. diff --git a/services/surfaceflinger/Android.mk b/services/surfaceflinger/Android.mk index 61a8358..10686c0 100644 --- a/services/surfaceflinger/Android.mk +++ b/services/surfaceflinger/Android.mk @@ -30,6 +30,10 @@ ifeq ($(TARGET_BOARD_PLATFORM), s5pc110) LOCAL_CFLAGS += -DHAS_CONTEXT_PRIORITY -DNEVER_DEFAULT_TO_ASYNC_MODE endif +ifneq (,$(findstring $(TARGET_DEVICE),tuna toro maguro)) + LOCAL_CFLAGS += -DREFRESH_RATE=60 +endif + LOCAL_SHARED_LIBRARIES := \ libcutils \ diff --git a/services/surfaceflinger/DisplayHardware/DisplayHardware.cpp b/services/surfaceflinger/DisplayHardware/DisplayHardware.cpp index f4be168..329c052 100644 --- a/services/surfaceflinger/DisplayHardware/DisplayHardware.cpp +++ b/services/surfaceflinger/DisplayHardware/DisplayHardware.cpp @@ -141,6 +141,17 @@ void DisplayHardware::init(uint32_t dpy) mDpiY = mNativeWindow->ydpi; mRefreshRate = fbDev->fps; + +/* FIXME: this is a temporary HACK until we are able to report the refresh rate + * properly from the HAL. The WindowManagerService now relies on this value. + */ +#ifndef REFRESH_RATE + mRefreshRate = fbDev->fps; +#else + mRefreshRate = REFRESH_RATE; +#warning "refresh rate set via makefile to REFRESH_RATE" +#endif + EGLint w, h, dummy; EGLint numConfigs=0; EGLSurface surface; |