Backed out changeset c92c76073e9c (bug 1160877) for causing B2G phone startup crashes.
authorRyan VanderMeulen <ryanvm@gmail.com>
Thu, 07 May 2015 09:24:35 -0400
changeset 242635 5e13fa41d549c6c99bac590fa2369d06e0138287
parent 242634 af7357d7fd10f8e4becfecd0e455abc1850817c2
child 242636 0df9e0c692a3afd096fa931911ea4c1d6dc4e0e7
push id28704
push userryanvm@gmail.com
push dateThu, 07 May 2015 13:27:19 +0000
treeherdermozilla-central@0df9e0c692a3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1160877
milestone40.0a1
backs outc92c76073e9cb2294cdac7dfc80431b2224c4c93
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
Backed out changeset c92c76073e9c (bug 1160877) for causing B2G phone startup crashes.
widget/gonk/libdisplay/GonkDisplayJB.cpp
widget/gonk/libdisplay/GonkDisplayJB.h
--- a/widget/gonk/libdisplay/GonkDisplayJB.cpp
+++ b/widget/gonk/libdisplay/GonkDisplayJB.cpp
@@ -162,18 +162,19 @@ GonkDisplayJB::~GonkDisplayJB()
     if (mFBDevice)
         framebuffer_close(mFBDevice);
     free(mList);
 }
 
 ANativeWindow*
 GonkDisplayJB::GetNativeWindow()
 {
-    StopBootAnim();
-
+    if (!mBootAnimBuffer.get()) {
+        StopBootAnimation();
+    }
     return mSTClient.get();
 }
 
 void
 GonkDisplayJB::SetEnabled(bool enabled)
 {
     if (enabled) {
         autosuspend_disable();
@@ -229,17 +230,20 @@ void*
 GonkDisplayJB::GetDispSurface()
 {
     return mDispSurface.get();
 }
 
 bool
 GonkDisplayJB::SwapBuffers(EGLDisplay dpy, EGLSurface sur)
 {
-    StopBootAnim();
+    if (mBootAnimBuffer.get()) {
+        StopBootAnimation();
+        mBootAnimBuffer = nullptr;
+    }
 
     // Should be called when composition rendering is complete for a frame.
     // Only HWC v1.0 needs this call.
     // HWC > v1.0 case, do not call compositionComplete().
     // mFBDevice is present only when HWC is v1.0.
     if (mFBDevice && mFBDevice->compositionComplete) {
         mFBDevice->compositionComplete(mFBDevice);
     }
@@ -328,42 +332,35 @@ GonkDisplayJB::QueueBuffer(ANativeWindow
         error = mSTClient->queueBuffer(mSTClient.get(), buf, mFence);
     }
     return error == 0 && success;
 }
 
 void
 GonkDisplayJB::UpdateDispSurface(EGLDisplay dpy, EGLSurface sur)
 {
-    StopBootAnim();
-
+    if (mBootAnimBuffer.get()) {
+        StopBootAnimation();
+        mBootAnimBuffer = nullptr;
+    }
     eglSwapBuffers(dpy, sur);
 }
 
 void
 GonkDisplayJB::SetDispReleaseFd(int fd)
 {
     mDispSurface->setReleaseFenceFd(fd);
 }
 
 int
 GonkDisplayJB::GetPrevDispAcquireFd()
 {
     return mDispSurface->GetPrevDispAcquireFd();
 }
 
-void
-GonkDisplayJB::StopBootAnim()
-{
-    if (mBootAnimBuffer.get()) {
-        mBootAnimBuffer = nullptr;
-    }
-    StopBootAnimation();
-}
-
 __attribute__ ((visibility ("default")))
 GonkDisplay*
 GetGonkDisplay()
 {
     if (!sGonkDisplay)
         sGonkDisplay = new GonkDisplayJB();
     return sGonkDisplay;
 }
--- a/widget/gonk/libdisplay/GonkDisplayJB.h
+++ b/widget/gonk/libdisplay/GonkDisplayJB.h
@@ -50,18 +50,16 @@ public:
 
     virtual void SetDispReleaseFd(int fd);
 
     virtual int GetPrevDispAcquireFd();
 
     bool Post(buffer_handle_t buf, int fence);
 
 private:
-    void StopBootAnim();
-
     hw_module_t const*        mModule;
     hw_module_t const*        mFBModule;
     hwc_composer_device_1_t*  mHwc;
     framebuffer_device_t*     mFBDevice;
     power_module_t*           mPowerModule;
     android::sp<android::DisplaySurface> mDispSurface;
     android::sp<ANativeWindow> mSTClient;
     android::sp<android::IGraphicBufferAlloc> mAlloc;