Bug 1151489. Enable software vsync on all b2g versions. r=kats
authorMason Chang <mchang@mozilla.com>
Wed, 08 Apr 2015 22:02:01 -0700
changeset 268151 b987bc66a933b3fb5ccc2d35a4491cb432b653ef
parent 268150 a3f6306dd05e64ea03f427652680151f89357e99
child 268152 d2a1fc813b91ec868a7e16e9de20658dc66de2ce
push id4830
push userjlund@mozilla.com
push dateMon, 29 Jun 2015 20:18:48 +0000
treeherdermozilla-beta@4c2175bb0420 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskats
bugs1151489
milestone40.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1151489. Enable software vsync on all b2g versions. r=kats
b2g/app/b2g.js
gfx/thebes/gfxAndroidPlatform.cpp
--- a/b2g/app/b2g.js
+++ b/b2g/app/b2g.js
@@ -1121,28 +1121,13 @@ pref("dom.mozSettings.SettingsService.ve
 // Controlling whether we want to allow forcing some Settings
 // IndexedDB transactions to be opened as readonly or keep everything as
 // readwrite.
 pref("dom.mozSettings.allowForceReadOnly", false);
 
 // RequestSync API is enabled by default on B2G.
 pref("dom.requestSync.enabled", true);
 
-// Only enable for kit kat and above devices
-// kit kat == 19, L = 21, 20 is kit-kat for wearables
-// 15 is for the ICS emulators which will fallback to software vsync
-#if ANDROID_VERSION == 19 || ANDROID_VERSION == 21 || ANDROID_VERSION == 15
+// Use vsync aligned rendering
 pref("gfx.vsync.hw-vsync.enabled", true);
 pref("gfx.vsync.compositor", true);
 pref("gfx.touch.resample", true);
-#else
-pref("gfx.vsync.hw-vsync.enabled", false);
-pref("gfx.vsync.compositor", false);
-pref("gfx.touch.resample", false);
-#endif
-
-// Bug 1147753 - Weird issues with vsync refresh driver on L devices
-// so disable them on L, but enable on KK and ICS
-#if ANDROID_VERSION == 19 || ANDROID_VERSION == 15
 pref("gfx.vsync.refreshdriver", true);
-#else
-pref("gfx.vsync.refreshdriver", false);
-#endif
--- a/gfx/thebes/gfxAndroidPlatform.cpp
+++ b/gfx/thebes/gfxAndroidPlatform.cpp
@@ -482,17 +482,22 @@ private:
 
   GonkDisplay mGlobalDisplay;
 }; // GonkVsyncSource
 #endif
 
 already_AddRefed<mozilla::gfx::VsyncSource>
 gfxAndroidPlatform::CreateHardwareVsyncSource()
 {
-#ifdef MOZ_WIDGET_GONK
+    // Only enable true hardware vsync on kit-kat due to L HwcComposer issues
+    // Jelly Bean has inaccurate hardware vsync so disable on JB
+    // Android pre-JB doesn't have hardware vsync
+    // Once L HwcComposer issues have been resolved, re-enable for L devices
+    // L is andriod version 21, Kit-kat is 19, 20 is kit-kat for wearables
+#if defined(MOZ_WIDGET_GONK) && (ANDROID_VERSION == 19)
     nsRefPtr<GonkVsyncSource> vsyncSource = new GonkVsyncSource();
     VsyncSource::Display& display = vsyncSource->GetGlobalDisplay();
     display.EnableVsync();
     if (!display.IsVsyncEnabled()) {
         NS_WARNING("Error enabling gonk vsync. Falling back to software vsync\n");
         return gfxPlatform::CreateHardwareVsyncSource();
     }
     display.DisableVsync();