hwc: Remove need for intermediate for mdp3 composition
8x10 has a product line that is suppose to use 256MB. The intermediate buffers allocated are not needed when we can compose onto fb frame. Change-Id: I13fd2deb328a3ef4b6738cfe7030fe67ea7bd6c6
This commit is contained in:
@@ -506,7 +506,7 @@ static int hwc_set_primary(hwc_context_t *ctx, hwc_display_contents_1_t* list) {
|
|||||||
//TODO We dont check for SKIP flag on this layer because we need PAN
|
//TODO We dont check for SKIP flag on this layer because we need PAN
|
||||||
//always. Last layer is always FB
|
//always. Last layer is always FB
|
||||||
private_handle_t *hnd = (private_handle_t *)fbLayer->handle;
|
private_handle_t *hnd = (private_handle_t *)fbLayer->handle;
|
||||||
if(copybitDone) {
|
if(copybitDone && ctx->mMDP.version >= qdutils::MDP_V4_0) {
|
||||||
hnd = ctx->mCopyBit[dpy]->getCurrentRenderBuffer();
|
hnd = ctx->mCopyBit[dpy]->getCurrentRenderBuffer();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -199,7 +199,8 @@ bool CopyBit::prepare(hwc_context_t *ctx, hwc_display_contents_1_t *list,
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Allocate render buffers if they're not allocated
|
//Allocate render buffers if they're not allocated
|
||||||
if (useCopybitForYUV || useCopybitForRGB) {
|
if (ctx->mMDP.version != qdutils::MDP_V3_0_4 &&
|
||||||
|
(useCopybitForYUV || useCopybitForRGB)) {
|
||||||
int ret = allocRenderBuffers(mAlignedFBWidth,
|
int ret = allocRenderBuffers(mAlignedFBWidth,
|
||||||
mAlignedFBHeight,
|
mAlignedFBHeight,
|
||||||
HAL_PIXEL_FORMAT_RGBA_8888);
|
HAL_PIXEL_FORMAT_RGBA_8888);
|
||||||
@@ -223,7 +224,10 @@ bool CopyBit::prepare(hwc_context_t *ctx, hwc_display_contents_1_t *list,
|
|||||||
// Mark all layers to be drawn by copybit
|
// Mark all layers to be drawn by copybit
|
||||||
for (int i = ctx->listStats[dpy].numAppLayers-1; i >= 0 ; i--) {
|
for (int i = ctx->listStats[dpy].numAppLayers-1; i >= 0 ; i--) {
|
||||||
layerProp[i].mFlags |= HWC_COPYBIT;
|
layerProp[i].mFlags |= HWC_COPYBIT;
|
||||||
list->hwLayers[i].compositionType = HWC_OVERLAY;
|
if (ctx->mMDP.version == qdutils::MDP_V3_0_4)
|
||||||
|
list->hwLayers[i].compositionType = HWC_BLIT;
|
||||||
|
else
|
||||||
|
list->hwLayers[i].compositionType = HWC_OVERLAY;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -254,13 +258,20 @@ bool CopyBit::draw(hwc_context_t *ctx, hwc_display_contents_1_t *list,
|
|||||||
// draw layers marked for COPYBIT
|
// draw layers marked for COPYBIT
|
||||||
int retVal = true;
|
int retVal = true;
|
||||||
int copybitLayerCount = 0;
|
int copybitLayerCount = 0;
|
||||||
|
uint32_t last = 0;
|
||||||
LayerProp *layerProp = ctx->layerProp[dpy];
|
LayerProp *layerProp = ctx->layerProp[dpy];
|
||||||
|
private_handle_t *renderBuffer;
|
||||||
|
|
||||||
if(mCopyBitDraw == false) // there is no layer marked for copybit
|
if(mCopyBitDraw == false) // there is no layer marked for copybit
|
||||||
return false ;
|
return false ;
|
||||||
|
|
||||||
//render buffer
|
//render buffer
|
||||||
private_handle_t *renderBuffer = getCurrentRenderBuffer();
|
if (ctx->mMDP.version == qdutils::MDP_V3_0_4) {
|
||||||
|
last = list->numHwLayers - 1;
|
||||||
|
renderBuffer = (private_handle_t *)list->hwLayers[last].handle;
|
||||||
|
} else {
|
||||||
|
renderBuffer = getCurrentRenderBuffer();
|
||||||
|
}
|
||||||
if (!renderBuffer) {
|
if (!renderBuffer) {
|
||||||
ALOGE("%s: Render buffer layer handle is NULL", __FUNCTION__);
|
ALOGE("%s: Render buffer layer handle is NULL", __FUNCTION__);
|
||||||
return false;
|
return false;
|
||||||
@@ -274,9 +285,9 @@ bool CopyBit::draw(hwc_context_t *ctx, hwc_display_contents_1_t *list,
|
|||||||
mRelFd[mCurRenderBufferIndex] = -1;
|
mRelFd[mCurRenderBufferIndex] = -1;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if(mRelFd[mCurRenderBufferIndex] >=0) {
|
if(list->hwLayers[last].acquireFenceFd >=0) {
|
||||||
copybit_device_t *copybit = getCopyBitDevice();
|
copybit_device_t *copybit = getCopyBitDevice();
|
||||||
copybit->set_sync(copybit, mRelFd[mCurRenderBufferIndex]);
|
copybit->set_sync(copybit, list->hwLayers[last].acquireFenceFd);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -316,10 +327,10 @@ bool CopyBit::draw(hwc_context_t *ctx, hwc_display_contents_1_t *list,
|
|||||||
copybit_device_t *copybit = getCopyBitDevice();
|
copybit_device_t *copybit = getCopyBitDevice();
|
||||||
// Async mode
|
// Async mode
|
||||||
copybit->flush_get_fence(copybit, fd);
|
copybit->flush_get_fence(copybit, fd);
|
||||||
if(mRelFd[mCurRenderBufferIndex] >=0 &&
|
if(ctx->mMDP.version == qdutils::MDP_V3_0_4 &&
|
||||||
ctx->mMDP.version == qdutils::MDP_V3_0_4) {
|
list->hwLayers[last].acquireFenceFd >= 0) {
|
||||||
close(mRelFd[mCurRenderBufferIndex]);
|
close(list->hwLayers[last].acquireFenceFd);
|
||||||
mRelFd[mCurRenderBufferIndex] = -1;
|
list->hwLayers[last].acquireFenceFd = -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -1192,7 +1192,8 @@ int hwc_sync(hwc_context_t *ctx, hwc_display_contents_1_t* list, int dpy,
|
|||||||
|
|
||||||
//Accumulate acquireFenceFds for MDP
|
//Accumulate acquireFenceFds for MDP
|
||||||
for(uint32_t i = 0; i < list->numHwLayers; i++) {
|
for(uint32_t i = 0; i < list->numHwLayers; i++) {
|
||||||
if(list->hwLayers[i].compositionType == HWC_OVERLAY &&
|
if((list->hwLayers[i].compositionType == HWC_OVERLAY ||
|
||||||
|
list->hwLayers[i].compositionType == HWC_BLIT) &&
|
||||||
list->hwLayers[i].acquireFenceFd >= 0) {
|
list->hwLayers[i].acquireFenceFd >= 0) {
|
||||||
if(UNLIKELY(swapzero))
|
if(UNLIKELY(swapzero))
|
||||||
acquireFd[count++] = -1;
|
acquireFd[count++] = -1;
|
||||||
@@ -1234,6 +1235,7 @@ int hwc_sync(hwc_context_t *ctx, hwc_display_contents_1_t* list, int dpy,
|
|||||||
|
|
||||||
for(uint32_t i = 0; i < list->numHwLayers; i++) {
|
for(uint32_t i = 0; i < list->numHwLayers; i++) {
|
||||||
if(list->hwLayers[i].compositionType == HWC_OVERLAY ||
|
if(list->hwLayers[i].compositionType == HWC_OVERLAY ||
|
||||||
|
list->hwLayers[i].compositionType == HWC_BLIT ||
|
||||||
list->hwLayers[i].compositionType == HWC_FRAMEBUFFER_TARGET) {
|
list->hwLayers[i].compositionType == HWC_FRAMEBUFFER_TARGET) {
|
||||||
//Populate releaseFenceFds.
|
//Populate releaseFenceFds.
|
||||||
if(UNLIKELY(swapzero)) {
|
if(UNLIKELY(swapzero)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user