Merge "hwc: In PTOR, offset depends on stride calculated by gralloc"

This commit is contained in:
Linux Build Service Account
2014-07-24 21:52:59 -07:00
committed by Gerrit - the friendly Code Review server
2 changed files with 10 additions and 5 deletions

View File

@@ -234,9 +234,6 @@ bool CopyBit::prepareOverlap(hwc_context_t *ctx,
finalW = max(finalW, ALIGN((overlap.right - overlap.left), 32));
finalH += ALIGN((overlap.bottom - overlap.top), 32);
if(finalH > ALIGN((overlap.bottom - overlap.top), 32)) {
// Calculate the offset for RGBA(4BPP)
ptorInfo->mRenderBuffOffset[i] = finalW *
(finalH - ALIGN((overlap.bottom - overlap.top), 32)) * 4;
// Calculate the dest top, left will always be zero
ptorInfo->displayFrame[i].top = (finalH -
(ALIGN((overlap.bottom - overlap.top), 32)));
@@ -251,6 +248,14 @@ bool CopyBit::prepareOverlap(hwc_context_t *ctx,
getBufferSizeAndDimensions(finalW, finalH, HAL_PIXEL_FORMAT_RGBA_8888,
alignW, alignH);
int heightFromTop = 0;
for (int i = 0; i < ptorInfo->count; i++) {
// Offset depends on stride calculated by gralloc for RGBA (4 bpp)
ptorInfo->mRenderBuffOffset[i] = alignW * heightFromTop * 4;
heightFromTop += ALIGN((ptorInfo->displayFrame[i].bottom -
ptorInfo->displayFrame[i].top), 32);
}
if ((mAlignedWidth != alignW) || (mAlignedHeight != alignH)) {
// Overlap rect has changed, so free render buffers
freeRenderBuffers();

View File

@@ -1444,8 +1444,8 @@ int hwc_sync(hwc_context_t *ctx, hwc_display_contents_1_t* list, int dpy,
fd = -1;
}
if (!dpy && ctx->mCopyBit[dpy]) {
if (ctx->mPtorInfo.isActive())
if (ctx->mCopyBit[dpy]) {
if (!dpy && ctx->mPtorInfo.isActive())
ctx->mCopyBit[dpy]->setReleaseFdSync(releaseFd);
else
ctx->mCopyBit[dpy]->setReleaseFd(releaseFd);