Merge "hwc: Configure MDP with updated crop and whf for PTOR layers"
This commit is contained in:
committed by
Gerrit - the friendly Code Review server
commit
aa18901d75
@@ -248,14 +248,6 @@ bool CopyBit::prepareOverlap(hwc_context_t *ctx,
|
|||||||
getBufferSizeAndDimensions(finalW, finalH, HAL_PIXEL_FORMAT_RGBA_8888,
|
getBufferSizeAndDimensions(finalW, finalH, HAL_PIXEL_FORMAT_RGBA_8888,
|
||||||
alignW, alignH);
|
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)) {
|
if ((mAlignedWidth != alignW) || (mAlignedHeight != alignH)) {
|
||||||
// Overlap rect has changed, so free render buffers
|
// Overlap rect has changed, so free render buffers
|
||||||
freeRenderBuffers();
|
freeRenderBuffers();
|
||||||
|
|||||||
@@ -849,18 +849,19 @@ bool MDPComp::fullMDPCompWithPTOR(hwc_context_t *ctx,
|
|||||||
// Overlap area > (1/3 * FrameBuffer) area, based on Perf inputs.
|
// Overlap area > (1/3 * FrameBuffer) area, based on Perf inputs.
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
// Found the PTOR layer
|
bool found = false;
|
||||||
bool found = true;
|
|
||||||
for (int j = i-1; j >= 0; j--) {
|
for (int j = i-1; j >= 0; j--) {
|
||||||
// Check if the layers below this layer qualifies for PTOR comp
|
// Check if the layers below this layer qualifies for PTOR comp
|
||||||
hwc_layer_1_t* layer = &list->hwLayers[j];
|
hwc_layer_1_t* layer = &list->hwLayers[j];
|
||||||
hwc_rect_t disFrame = layer->displayFrame;
|
hwc_rect_t disFrame = layer->displayFrame;
|
||||||
//layer below PTOR is intersecting and has 90 degree transform or
|
// Layer below PTOR is intersecting and has 90 degree transform or
|
||||||
// needs scaling cannot be supported.
|
// needs scaling cannot be supported.
|
||||||
if ((isValidRect(getIntersection(dispFrame, disFrame)))
|
if (isValidRect(getIntersection(dispFrame, disFrame))) {
|
||||||
&& (has90Transform(layer) || needsScaling(layer))) {
|
if (has90Transform(layer) || needsScaling(layer)) {
|
||||||
found = false;
|
found = false;
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
found = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Store the minLayer Index
|
// Store the minLayer Index
|
||||||
@@ -903,11 +904,30 @@ bool MDPComp::fullMDPCompWithPTOR(hwc_context_t *ctx,
|
|||||||
sourceCrop[i] = integerizeSourceCrop(layer->sourceCropf);
|
sourceCrop[i] = integerizeSourceCrop(layer->sourceCropf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private_handle_t *renderBuf = ctx->mCopyBit[mDpy]->getCurrentRenderBuffer();
|
||||||
|
Whf layerWhf[numPTORLayersFound]; // To store w,h,f of PTOR layers
|
||||||
|
|
||||||
for(int j = 0; j < numPTORLayersFound; j++) {
|
for(int j = 0; j < numPTORLayersFound; j++) {
|
||||||
int index = ctx->mPtorInfo.layerIndex[j];
|
int index = ctx->mPtorInfo.layerIndex[j];
|
||||||
|
|
||||||
|
// Update src crop of PTOR layer
|
||||||
|
hwc_layer_1_t* layer = &list->hwLayers[index];
|
||||||
|
layer->sourceCropf.left = (float)ctx->mPtorInfo.displayFrame[j].left;
|
||||||
|
layer->sourceCropf.top = (float)ctx->mPtorInfo.displayFrame[j].top;
|
||||||
|
layer->sourceCropf.right = (float)ctx->mPtorInfo.displayFrame[j].right;
|
||||||
|
layer->sourceCropf.bottom =(float)ctx->mPtorInfo.displayFrame[j].bottom;
|
||||||
|
|
||||||
|
// Store & update w, h, format of PTOR layer
|
||||||
|
private_handle_t *hnd = (private_handle_t *)layer->handle;
|
||||||
|
Whf whf(hnd->width, hnd->height, hnd->format, hnd->size);
|
||||||
|
layerWhf[j] = whf;
|
||||||
|
hnd->width = renderBuf->width;
|
||||||
|
hnd->height = renderBuf->height;
|
||||||
|
hnd->format = renderBuf->format;
|
||||||
|
|
||||||
// Remove overlap from crop & displayFrame of below layers
|
// Remove overlap from crop & displayFrame of below layers
|
||||||
for (int i = 0; i < index && index !=-1; i++) {
|
for (int i = 0; i < index && index !=-1; i++) {
|
||||||
hwc_layer_1_t* layer = &list->hwLayers[i];
|
layer = &list->hwLayers[i];
|
||||||
if(!isValidRect(getIntersection(layer->displayFrame,
|
if(!isValidRect(getIntersection(layer->displayFrame,
|
||||||
overlapRect[j]))) {
|
overlapRect[j]))) {
|
||||||
continue;
|
continue;
|
||||||
@@ -944,6 +964,15 @@ bool MDPComp::fullMDPCompWithPTOR(hwc_context_t *ctx,
|
|||||||
layer->sourceCropf.bottom = (float)sourceCrop[i].bottom;
|
layer->sourceCropf.bottom = (float)sourceCrop[i].bottom;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Restore w,h,f of PTOR layers
|
||||||
|
for (int i = 0; i < numPTORLayersFound; i++) {
|
||||||
|
int idx = ctx->mPtorInfo.layerIndex[i];
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
if (!result) {
|
if (!result) {
|
||||||
// reset PTOR
|
// reset PTOR
|
||||||
ctx->mPtorInfo.count = 0;
|
ctx->mPtorInfo.count = 0;
|
||||||
@@ -1928,8 +1957,7 @@ bool MDPCompNonSplit::draw(hwc_context_t *ctx, hwc_display_contents_1_t* list) {
|
|||||||
if (!mDpy && (index != -1)) {
|
if (!mDpy && (index != -1)) {
|
||||||
hnd = ctx->mCopyBit[mDpy]->getCurrentRenderBuffer();
|
hnd = ctx->mCopyBit[mDpy]->getCurrentRenderBuffer();
|
||||||
fd = hnd->fd;
|
fd = hnd->fd;
|
||||||
// Use the offset of the RenderBuffer
|
offset = 0;
|
||||||
offset = ctx->mPtorInfo.mRenderBuffOffset[index];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ALOGD_IF(isDebug(),"%s: MDP Comp: Drawing layer: %p hnd: %p \
|
ALOGD_IF(isDebug(),"%s: MDP Comp: Drawing layer: %p hnd: %p \
|
||||||
@@ -2180,7 +2208,7 @@ bool MDPCompSplit::draw(hwc_context_t *ctx, hwc_display_contents_1_t* list) {
|
|||||||
if (!mDpy && (index != -1)) {
|
if (!mDpy && (index != -1)) {
|
||||||
hnd = ctx->mCopyBit[mDpy]->getCurrentRenderBuffer();
|
hnd = ctx->mCopyBit[mDpy]->getCurrentRenderBuffer();
|
||||||
fd = hnd->fd;
|
fd = hnd->fd;
|
||||||
offset = ctx->mPtorInfo.mRenderBuffOffset[index];
|
offset = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(ctx->mAD->draw(ctx, fd, offset)) {
|
if(ctx->mAD->draw(ctx, fd, offset)) {
|
||||||
|
|||||||
@@ -137,7 +137,6 @@ struct ListStats {
|
|||||||
struct PtorInfo {
|
struct PtorInfo {
|
||||||
int count;
|
int count;
|
||||||
int layerIndex[MAX_PTOR_LAYERS];
|
int layerIndex[MAX_PTOR_LAYERS];
|
||||||
int mRenderBuffOffset[MAX_PTOR_LAYERS];
|
|
||||||
hwc_rect_t displayFrame[MAX_PTOR_LAYERS];
|
hwc_rect_t displayFrame[MAX_PTOR_LAYERS];
|
||||||
bool isActive() { return (count>0); }
|
bool isActive() { return (count>0); }
|
||||||
int getPTORArrayIndex(int index) {
|
int getPTORArrayIndex(int index) {
|
||||||
|
|||||||
Reference in New Issue
Block a user