Bug 1047149 - Add check to validate acquire fence of FB layer. r=sotaro

This commit is contained in:
Sushil Chauhan 2014-08-07 14:34:25 -07:00
parent 7e71862ad0
commit 26c50a63d4
2 changed files with 8 additions and 1 deletions

View File

@ -608,6 +608,7 @@ HwcComposer2D::TryHwComposition()
Commit();
GetGonkDisplay()->SetFBReleaseFd(mList->hwLayers[idx].releaseFenceFd);
mList->hwLayers[idx].releaseFenceFd = -1;
return true;
}
@ -648,6 +649,7 @@ HwcComposer2D::Render(EGLDisplay dpy, EGLSurface sur)
Commit();
GetGonkDisplay()->SetFBReleaseFd(mList->hwLayers[mList->numHwLayers - 1].releaseFenceFd);
mList->hwLayers[mList->numHwLayers - 1].releaseFenceFd = -1;
return true;
}
@ -692,6 +694,7 @@ HwcComposer2D::Commit()
displays[HWC_DISPLAY_PRIMARY] = mList;
for (uint32_t j=0; j < (mList->numHwLayers - 1); j++) {
mList->hwLayers[j].acquireFenceFd = -1;
if (mHwcLayerMap.IsEmpty() ||
(mList->hwLayers[j].compositionType == HWC_FRAMEBUFFER)) {
continue;

View File

@ -168,7 +168,11 @@ status_t FramebufferSurface::setReleaseFenceFd(int fenceFd) {
}
int FramebufferSurface::GetPrevFBAcquireFd() {
return mPrevFBAcquireFence.get() ? mPrevFBAcquireFence->dup() : -1;
if (mPrevFBAcquireFence.get() && mPrevFBAcquireFence->isValid()) {
return mPrevFBAcquireFence->dup();
}
ALOGE("GetPrevFBAcquireFd: FB acquire fence is invalid!");
return -1;
}
status_t FramebufferSurface::setUpdateRectangle(const Rect& r)