Bug 1151489. Enable software vsync on all b2g versions. r=kats
authorMason Chang <mchang@mozilla.com>
Tue, 14 Apr 2015 10:32:47 -0400
changeset 257915 12870e4cabd72fdcce4779ae712535f66457d1db
parent 257914 eb7ef6324ddb8ab94309483d5ee877ee80c2b1a1
child 257916 b0a131a21f050ec72d6a5c732e830ca9497d6234
push id8007
push userraliiev@mozilla.com
push dateMon, 11 May 2015 19:23:16 +0000
treeherdermozilla-aurora@e2ce1aac996e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskats
bugs1151489
milestone40.0a1
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
@@ -1119,28 +1119,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();