diff --git a/widget/gonk/HwcComposer2D.cpp b/widget/gonk/HwcComposer2D.cpp index e2bb4d50603..41b451d4696 100644 --- a/widget/gonk/HwcComposer2D.cpp +++ b/widget/gonk/HwcComposer2D.cpp @@ -715,6 +715,7 @@ HwcComposer2D::Render(nsIWidget* aWidget) if (!mHal->HasHwc() || !mList) { return GetGonkDisplay()->SwapBuffers(screen->GetDpy(), screen->GetSur()); } else if (!mList && !ReallocLayerList()) { + LOGE("Cannot realloc layer list"); return false; } @@ -811,15 +812,21 @@ bool HwcComposer2D::TryHwComposition(nsScreenGonk* aScreen) { mHal->SetEGLInfo(aScreen->GetDpy(), aScreen->GetSur()); - return !mHal->Set(mList, GonkDisplay::DISPLAY_PRIMARY); + return !mHal->Set(mList, aScreen->GetDisplayType()); } bool HwcComposer2D::Render(nsIWidget* aWidget) { nsScreenGonk* screen = static_cast(aWidget)->GetScreen(); + GetGonkDisplay()->SwapBuffers(screen->GetDpy(), screen->GetSur()); - return GetGonkDisplay()->SwapBuffers(screen->GetDpy(), screen->GetSur()); + if (!mHal->HasHwc()) { + return true; + } + + mHal->Prepare(nullptr, screen->GetDisplayType(), nullptr, -1); + return !mHal->Set(nullptr, screen->GetDisplayType()); } #endif diff --git a/widget/gonk/libdisplay/GonkDisplayICS.cpp b/widget/gonk/libdisplay/GonkDisplayICS.cpp index 7c1186ebb8c..284176f50a0 100644 --- a/widget/gonk/libdisplay/GonkDisplayICS.cpp +++ b/widget/gonk/libdisplay/GonkDisplayICS.cpp @@ -168,14 +168,7 @@ GonkDisplayICS::SwapBuffers(EGLDisplay dpy, EGLSurface sur) { // Should be called when composition rendering is complete for a frame. // Only HWC v1.0 needs this call. ICS gonk always needs the call. - mFBSurface->compositionComplete(); - - if (!mHwc) { - return true; - } - - mHwc->prepare(mHwc, nullptr); - return !mHwc->set(mHwc, dpy, sur, 0); + return !mFBSurface->compositionComplete(); } ANativeWindowBuffer*