Backed out changeset bcf74bd6c78f (bug 959719) for JB bustage.

This commit is contained in:
Ryan VanderMeulen 2014-01-15 11:37:15 -05:00
parent 9daee56b1f
commit 39e2640046

View File

@ -469,66 +469,34 @@ HwcComposer2D::TryHwComposition()
Prepare(fbsurface->lastHandle, -1); Prepare(fbsurface->lastHandle, -1);
/* Possible composition paths, after hwc prepare: bool fullHwcComposite = true;
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++) { for (int j = 0; j < idx; j++) {
if (mList->hwLayers[j].compositionType == HWC_FRAMEBUFFER || if (mList->hwLayers[j].compositionType == HWC_FRAMEBUFFER) {
mList->hwLayers[j].compositionType == HWC_BLIT) { // After prepare, if there is an HWC_FRAMEBUFFER layer,
// Full OVERLAY composition is not possible on this frame // it means full HWC Composition is not possible this time
// It is either GPU / BLIT / partial OVERLAY composition. LOGD("GPU or Partial HWC Composition");
overlayComposite = false; fullHwcComposite = false;
break; break;
} }
} }
if (!overlayComposite) { if (!fullHwcComposite) {
for (int k=0; k < idx; k++) { for (int k=0; k < idx; k++) {
switch (mList->hwLayers[k].compositionType) { if (mList->hwLayers[k].compositionType == HWC_OVERLAY) {
case HWC_FRAMEBUFFER:
gpuComposite = true;
break;
case HWC_BLIT:
blitComposite = true;
break;
case HWC_OVERLAY:
// HWC will compose HWC_OVERLAY layers in partial // HWC will compose HWC_OVERLAY layers in partial
// Overlay Composition, set layer composition flag // HWC Composition, so set layer composition flag
// on mapped LayerComposite to skip GPU composition // on mapped LayerComposite to skip GPU composition
mHwcLayerMap[k]->SetLayerComposited(true); mHwcLayerMap[k]->SetLayerComposited(true);
break;
default:
break;
} }
} }
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; return false;
} }
mList->hwLayers[idx].handle = fbsurface->lastHandle;
mList->hwLayers[idx].acquireFenceFd = fbsurface->lastFenceFD;
}
}
// BLIT or full OVERLAY Composition // Full HWC Composition
Commit(); Commit();
GetGonkDisplay()->SetFBReleaseFd(mList->hwLayers[idx].releaseFenceFd); // No composition on FB layer, so closing releaseFenceFd
close(mList->hwLayers[idx].releaseFenceFd);
return true; return true;
} }