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 for (int j = 0; j < idx; j++) {
2. BLIT Composition if (mList->hwLayers[j].compositionType == HWC_FRAMEBUFFER) {
3. Full OVERLAY Composition // After prepare, if there is an HWC_FRAMEBUFFER layer,
4. Partial OVERLAY Composition (GPU + OVERLAY) */ // it means full HWC Composition is not possible this time
LOGD("GPU or Partial HWC Composition");
bool gpuComposite = false; fullHwcComposite = 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;
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: // HWC will compose HWC_OVERLAY layers in partial
gpuComposite = true; // HWC Composition, so set layer composition flag
break; // on mapped LayerComposite to skip GPU composition
case HWC_BLIT: mHwcLayerMap[k]->SetLayerComposited(true);
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;
} }
} }
return false;
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;
}
} }
// 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;
} }