From 39e2640046e7969bbb3d4ec9dc75e115504bc371 Mon Sep 17 00:00:00 2001 From: Ryan VanderMeulen Date: Wed, 15 Jan 2014 11:37:15 -0500 Subject: [PATCH] Backed out changeset bcf74bd6c78f (bug 959719) for JB bustage. --- widget/gonk/HwcComposer2D.cpp | 66 +++++++++-------------------------- 1 file changed, 17 insertions(+), 49 deletions(-) diff --git a/widget/gonk/HwcComposer2D.cpp b/widget/gonk/HwcComposer2D.cpp index 1f8b928eb92..9415ac8cd87 100644 --- a/widget/gonk/HwcComposer2D.cpp +++ b/widget/gonk/HwcComposer2D.cpp @@ -469,66 +469,34 @@ HwcComposer2D::TryHwComposition() Prepare(fbsurface->lastHandle, -1); - /* Possible composition paths, after hwc prepare: - 1. GPU Composition - 2. BLIT Composition - 3. Full OVERLAY Composition - 4. Partial OVERLAY Composition (GPU + OVERLAY) */ - - bool gpuComposite = false; - bool blitComposite = false; - bool overlayComposite = true; - - for (int j=0; j < idx; j++) { - if (mList->hwLayers[j].compositionType == HWC_FRAMEBUFFER || - mList->hwLayers[j].compositionType == HWC_BLIT) { - // Full OVERLAY composition is not possible on this frame - // It is either GPU / BLIT / partial OVERLAY composition. - overlayComposite = false; + bool fullHwcComposite = true; + for (int j = 0; j < idx; j++) { + if (mList->hwLayers[j].compositionType == HWC_FRAMEBUFFER) { + // After prepare, if there is an HWC_FRAMEBUFFER layer, + // it means full HWC Composition is not possible this time + LOGD("GPU or Partial HWC Composition"); + fullHwcComposite = false; break; } } - if (!overlayComposite) { + if (!fullHwcComposite) { for (int k=0; k < idx; k++) { - switch (mList->hwLayers[k].compositionType) { - case HWC_FRAMEBUFFER: - gpuComposite = true; - break; - case HWC_BLIT: - blitComposite = true; - break; - case HWC_OVERLAY: - // HWC will compose HWC_OVERLAY layers in partial - // Overlay Composition, set layer composition flag - // on mapped LayerComposite to skip GPU composition - mHwcLayerMap[k]->SetLayerComposited(true); - break; - default: - break; + if (mList->hwLayers[k].compositionType == HWC_OVERLAY) { + // HWC will compose HWC_OVERLAY layers in partial + // HWC Composition, so set layer composition flag + // on mapped LayerComposite to skip GPU composition + mHwcLayerMap[k]->SetLayerComposited(true); } } - - if (gpuComposite) { - // GPU or partial OVERLAY Composition - return false; - } else if (blitComposite) { - // BLIT Composition, flip FB target - GetGonkDisplay()->UpdateFBSurface(mDpy, mSur); - FramebufferSurface* fbsurface = (FramebufferSurface*)(GetGonkDisplay()->GetFBSurface()); - if (!fbsurface) { - LOGE("H/W Composition failed. NULL FBSurface."); - return false; - } - mList->hwLayers[idx].handle = fbsurface->lastHandle; - mList->hwLayers[idx].acquireFenceFd = fbsurface->lastFenceFD; - } + return false; } - // BLIT or full OVERLAY Composition + // Full HWC Composition Commit(); - GetGonkDisplay()->SetFBReleaseFd(mList->hwLayers[idx].releaseFenceFd); + // No composition on FB layer, so closing releaseFenceFd + close(mList->hwLayers[idx].releaseFenceFd); return true; }