hwc: Configure MDP with updated content attributes of PTOR layers

Since there is no content underneath a PTOR layer, all overlapped
contents have been composed by Copybit on render buffer. So for a
PTOR layer, we can set blending to HWC_BLENDING_NONE and planeAlpha
to 0xFF. And the transform for the PTOR layer should be set to 0 to
avoid MDP flipping again.

Change-Id: I26fec26dcde4d9b0b62f94107a013d82074628b5
This commit is contained in:
Xu Yang
2014-07-30 21:57:21 +08:00
parent 1f01133450
commit cda012c674

View File

@@ -907,6 +907,11 @@ bool MDPComp::fullMDPCompWithPTOR(hwc_context_t *ctx,
private_handle_t *renderBuf = ctx->mCopyBit[mDpy]->getCurrentRenderBuffer();
Whf layerWhf[numPTORLayersFound]; // To store w,h,f of PTOR layers
// Store the blending mode, planeAlpha, and transform of PTOR layers
int32_t blending[numPTORLayersFound];
uint8_t planeAlpha[numPTORLayersFound];
uint32_t transform[numPTORLayersFound];
for(int j = 0; j < numPTORLayersFound; j++) {
int index = ctx->mPtorInfo.layerIndex[j];
@@ -925,6 +930,14 @@ bool MDPComp::fullMDPCompWithPTOR(hwc_context_t *ctx,
hnd->height = renderBuf->height;
hnd->format = renderBuf->format;
// Store & update blending mode, planeAlpha and transform of PTOR layer
blending[j] = layer->blending;
planeAlpha[j] = layer->planeAlpha;
transform[j] = layer->transform;
layer->blending = HWC_BLENDING_NONE;
layer->planeAlpha = 0xFF;
layer->transform = 0;
// Remove overlap from crop & displayFrame of below layers
for (int i = 0; i < index && index !=-1; i++) {
layer = &list->hwLayers[i];
@@ -964,13 +977,17 @@ bool MDPComp::fullMDPCompWithPTOR(hwc_context_t *ctx,
layer->sourceCropf.bottom = (float)sourceCrop[i].bottom;
}
// Restore w,h,f of PTOR layers
// Restore w,h,f, blending attributes, and transform of PTOR layers
for (int i = 0; i < numPTORLayersFound; i++) {
int idx = ctx->mPtorInfo.layerIndex[i];
hwc_layer_1_t* layer = &list->hwLayers[idx];
private_handle_t *hnd = (private_handle_t *)list->hwLayers[idx].handle;
hnd->width = layerWhf[i].w;
hnd->height = layerWhf[i].h;
hnd->format = layerWhf[i].format;
layer->blending = blending[i];
layer->planeAlpha = planeAlpha[i];
layer->transform = transform[i];
}
if (!result) {