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
|
||||
//always. Last layer is always FB
|
||||
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();
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
if (useCopybitForYUV || useCopybitForRGB) {
|
||||
if (ctx->mMDP.version != qdutils::MDP_V3_0_4 &&
|
||||
(useCopybitForYUV || useCopybitForRGB)) {
|
||||
int ret = allocRenderBuffers(mAlignedFBWidth,
|
||||
mAlignedFBHeight,
|
||||
HAL_PIXEL_FORMAT_RGBA_8888);
|
||||
@@ -223,6 +224,9 @@ bool CopyBit::prepare(hwc_context_t *ctx, hwc_display_contents_1_t *list,
|
||||
// Mark all layers to be drawn by copybit
|
||||
for (int i = ctx->listStats[dpy].numAppLayers-1; i >= 0 ; i--) {
|
||||
layerProp[i].mFlags |= HWC_COPYBIT;
|
||||
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
|
||||
int retVal = true;
|
||||
int copybitLayerCount = 0;
|
||||
uint32_t last = 0;
|
||||
LayerProp *layerProp = ctx->layerProp[dpy];
|
||||
private_handle_t *renderBuffer;
|
||||
|
||||
if(mCopyBitDraw == false) // there is no layer marked for copybit
|
||||
return false ;
|
||||
|
||||
//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) {
|
||||
ALOGE("%s: Render buffer layer handle is NULL", __FUNCTION__);
|
||||
return false;
|
||||
@@ -274,9 +285,9 @@ bool CopyBit::draw(hwc_context_t *ctx, hwc_display_contents_1_t *list,
|
||||
mRelFd[mCurRenderBufferIndex] = -1;
|
||||
}
|
||||
} else {
|
||||
if(mRelFd[mCurRenderBufferIndex] >=0) {
|
||||
if(list->hwLayers[last].acquireFenceFd >=0) {
|
||||
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();
|
||||
// Async mode
|
||||
copybit->flush_get_fence(copybit, fd);
|
||||
if(mRelFd[mCurRenderBufferIndex] >=0 &&
|
||||
ctx->mMDP.version == qdutils::MDP_V3_0_4) {
|
||||
close(mRelFd[mCurRenderBufferIndex]);
|
||||
mRelFd[mCurRenderBufferIndex] = -1;
|
||||
if(ctx->mMDP.version == qdutils::MDP_V3_0_4 &&
|
||||
list->hwLayers[last].acquireFenceFd >= 0) {
|
||||
close(list->hwLayers[last].acquireFenceFd);
|
||||
list->hwLayers[last].acquireFenceFd = -1;
|
||||
}
|
||||
}
|
||||
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
|
||||
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) {
|
||||
if(UNLIKELY(swapzero))
|
||||
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++) {
|
||||
if(list->hwLayers[i].compositionType == HWC_OVERLAY ||
|
||||
list->hwLayers[i].compositionType == HWC_BLIT ||
|
||||
list->hwLayers[i].compositionType == HWC_FRAMEBUFFER_TARGET) {
|
||||
//Populate releaseFenceFds.
|
||||
if(UNLIKELY(swapzero)) {
|
||||
|
||||
Reference in New Issue
Block a user