Lines Matching refs:layer

222         hwc_layer_1_t* layer = &(list->hwLayers[index]);
225 layer->compositionType = HWC_OVERLAY;
226 layer->hints |= HWC_HINT_CLEAR_FB;
228 /* Drop the layer when its already present in FB OR when it lies
231 layer->compositionType = HWC_OVERLAY;
274 // populate layer and MDP maps
325 bool MDPComp::isSupportedForMDPComp(hwc_context_t *ctx, hwc_layer_1_t* layer) {
326 private_handle_t *hnd = (private_handle_t *)layer->handle;
327 if((has90Transform(layer) and (not isRotationDoable(ctx, hnd))) ||
328 (not isValidDimension(ctx,layer))
336 bool MDPComp::isValidDimension(hwc_context_t *ctx, hwc_layer_1_t *layer) {
337 private_handle_t *hnd = (private_handle_t *)layer->handle;
340 if (layer->flags & HWC_COLOR_FILL) {
341 // Color layer
344 ALOGE("%s: layer handle is NULL", __FUNCTION__);
349 if(!isSecureBuffer(hnd) && isNonIntegralSourceCrop(layer->sourceCropf))
352 hwc_rect_t crop = integerizeSourceCrop(layer->sourceCropf);
353 hwc_rect_t dst = layer->displayFrame;
354 bool rotated90 = (bool)(layer->transform & HAL_TRANSFORM_ROT_90);
455 * 2) If we have a scaling layer which needs cropping against generated
469 const hwc_layer_1_t* layer = &list->hwLayers[i];
470 hwc_rect_t dstRect = layer->displayFrame;
477 /* Reset frame ROI when any layer which needs scaling also needs ROI
479 if(!isSameRect(res, dstRect) && needsScaling (layer)) {
487 if (layer->blending == HWC_BLENDING_NONE)
494 /* Calculate ROI for the frame by accounting all the layer's dispalyFrame which
496 * the changing layer's dirtyRegion. */
508 hwc_layer_1_t* layer = &list->hwLayers[index];
509 if ((mCachedFrame.hnd[index] != layer->handle) ||
510 isYuvBuffer((private_handle_t *)layer->handle)) {
511 hwc_rect_t dst = layer->displayFrame;
515 if(!needsScaling(layer) && !layer->transform)
517 hwc_rect_t src = integerizeSourceCrop(layer->sourceCropf);
520 updatingRect = moveRect(layer->dirtyRect, x_off, y_off);
528 /* No layer is updating. Still SF wants a refresh.*/
553 * ROI's and drop them from composition. If a layer is spanning across both
556 * 2) If we have a scaling layer which needs cropping against generated
574 const hwc_layer_1_t* layer = &list->hwLayers[i];
575 hwc_rect_t dstRect = layer->displayFrame;
585 /* Reset frame ROI when any layer which needs scaling also needs ROI
587 if(!isSameRect(res, dstRect) && needsScaling (layer)) {
593 if (layer->blending == HWC_BLENDING_NONE) {
601 /* Calculate ROI for the frame by accounting all the layer's dispalyFrame which
603 * the changing layer's dirtyRegion. */
622 hwc_layer_1_t* layer = &list->hwLayers[index];
623 private_handle_t *hnd = (private_handle_t *)layer->handle;
624 if ((mCachedFrame.hnd[index] != layer->handle) ||
626 hwc_rect_t dst = layer->displayFrame;
630 if(!needsScaling(layer) && !layer->transform)
632 hwc_rect_t src = integerizeSourceCrop(layer->sourceCropf);
635 updatingRect = moveRect(layer->dirtyRect, x_off, y_off);
659 /* No layer is updating. Still SF wants a refresh. */
719 hwc_layer_1_t* layer = &list->hwLayers[i];
720 private_handle_t *hnd = (private_handle_t *)layer->handle;
722 if(has90Transform(layer) && isRotationDoable(ctx, hnd)) {
730 //For 8x26 with panel width>1k, if RGB layer needs HFLIP fail mdp comp
734 (layer->transform & HWC_TRANSFORM_FLIP_H) &&
761 //Will benefit presentation / secondary-only layer.
770 hwc_layer_1_t* layer = &list->hwLayers[i];
772 not isSupportedForMDPComp(ctx, layer)) {
773 ALOGD_IF(isDebug(), "%s: Unsupported layer in list",__FUNCTION__);
800 * covered by the smallest layer at a higher z-order, gets composed
825 hwc_layer_1_t* layer = &list->hwLayers[i];
826 if(not isSupportedForMDPComp(ctx, layer)) {
827 ALOGD_IF(isDebug(), "%s: Unsupported layer in list",__FUNCTION__);
833 1. A below layer needs scaling.
835 3. Overlap or a below layer has 90 degree transform.
846 hwc_layer_1_t* layer = &list->hwLayers[i];
847 hwc_rect_t crop = integerizeSourceCrop(layer->sourceCropf);
848 hwc_rect_t dispFrame = layer->displayFrame;
850 // PTOR layer should be peripheral and cannot have transform
852 has90Transform(layer)) {
860 // Found the PTOR layer
863 // Check if the layers below this layer qualifies for PTOR comp
864 hwc_layer_1_t* layer = &list->hwLayers[j];
865 hwc_rect_t disFrame = layer->displayFrame;
866 //layer below PTOR is intersecting and has 90 degree transform or
869 && (has90Transform(layer) || needsScaling(layer))) {
909 hwc_layer_1_t* layer = &list->hwLayers[i];
910 displayFrame[i] = layer->displayFrame;
911 sourceCrop[i] = integerizeSourceCrop(layer->sourceCropf);
918 hwc_layer_1_t* layer = &list->hwLayers[i];
919 if(!isValidRect(getIntersection(layer->displayFrame,
923 // Update layer attributes
924 hwc_rect_t srcCrop = integerizeSourceCrop(layer->sourceCropf);
925 hwc_rect_t destRect = deductRect(layer->displayFrame,
927 qhwc::calculate_crop_rects(srcCrop, layer->displayFrame, destRect,
928 layer->transform);
929 layer->sourceCropf.left = (float)srcCrop.left;
930 layer->sourceCropf.top = (float)srcCrop.top;
931 layer->sourceCropf.right = (float)srcCrop.right;
932 layer->sourceCropf.bottom = (float)srcCrop.bottom;
945 // Restore layer attributes
947 hwc_layer_1_t* layer = &list->hwLayers[i];
948 layer->displayFrame = displayFrame[i];
949 layer->sourceCropf.left = (float)sourceCrop[i].left;
950 layer->sourceCropf.top = (float)sourceCrop[i].top;
951 layer->sourceCropf.right = (float)sourceCrop[i].right;
952 layer->sourceCropf.bottom = (float)sourceCrop[i].bottom;
997 //If an MDP marked layer is unsupported cannot do partial MDP Comp
1000 hwc_layer_1_t* layer = &list->hwLayers[i];
1001 if(not isSupportedForMDPComp(ctx, layer)) {
1002 ALOGD_IF(isDebug(), "%s: Unsupported layer in list",
1068 hwc_layer_1_t* layer = &list->hwLayers[i];
1069 if(not isSupportedForMDPComp(ctx, layer)) {
1202 bool MDPComp::isYUVDoable(hwc_context_t* ctx, hwc_layer_1_t* layer) {
1203 if(isSkipLayer(layer)) {
1208 if(has90Transform(layer) && !canUseRotator(ctx, mDpy)) {
1213 if(isSecuring(ctx, layer)) {
1218 if(!isValidDimension(ctx, layer)) {
1224 if(layer->planeAlpha < 0xFF) {
1225 ALOGD_IF(isDebug(), "%s: Cannot handle YUV layer with plane alpha\
1234 /* starts at fromIndex and check for each layer to find
1235 * if it it has overlapping with any Updating layer above it in zorder
1249 /* Checks if given layer at targetLayerIndex has any
1278 int updatingLayersAbove = 0;//Updating layer count in middle of batch
1300 // We have a valid updating layer already. If layer-i not
1302 // batch-start and i, then we can add layer i to batch.
1350 * NEVER mark an updating layer for caching.
1372 hwc_layer_1_t* layer = &list->hwLayers[i];
1376 //If an unsupported layer is being attempted to
1378 if(not isSupportedForMDPComp(ctx, layer)) {
1427 hwc_layer_1_t* layer = &list->hwLayers[nYuvIndex];
1429 if(!isYUVDoable(ctx, layer)) {
1436 private_handle_t *hnd = (private_handle_t *)layer->handle;
1458 hwc_layer_1_t* layer = &list->hwLayers[i];
1459 hwc_rect_t dst = layer->displayFrame;
1504 hwc_layer_1_t* layer = &list->hwLayers[index];
1513 private_handle_t *hnd = (private_handle_t *)layer->handle;
1515 if(configure4k2kYuv(ctx, layer,
1519 for layer %d",__FUNCTION__, index);
1527 if(configure(ctx, layer, mCurrentFrame.mdpToLayer[mdpIndex]) != 0 ){
1529 layer %d",__FUNCTION__, index);
1557 hwc_layer_1_t* layer = &list->hwLayers[index];
1558 private_handle_t *hnd = (private_handle_t *)layer->handle;
1559 if(has90Transform(layer) && isRotationDoable(ctx, hnd)) {
1577 //If a layer need alpha scaling, MDP can not support.
1597 //if layer-i is marked for MDP and needs downscaling
1598 //check if any MDP layer on top of i & overlaps with layer-i
1641 ALOGI("%s: Unsupported layer count for mdp composition",
1748 //If 4k2k Yuv layer split is possible, and if
1749 //fbz is above 4k2k layer, increment fb zorder by 1
1750 //as we split 4k2k layer and increment zorder for right half
1751 //of the layer
1762 hwc_layer_1_t* layer = &list->hwLayers[index];
1763 private_handle_t *hnd = (private_handle_t *)layer->handle;
1768 //As we split 4kx2k yuv layer and program to 2 VG pipes
1780 int MDPCompNonSplit::configure(hwc_context_t *ctx, hwc_layer_1_t *layer,
1789 ALOGD_IF(isDebug(),"%s: configuring: layer: %p z_order: %d dest_pipe: %d",
1790 __FUNCTION__, layer, zOrder, dest);
1792 return configureNonSplit(ctx, layer, mDpy, mdpFlags, zOrder, isFg, dest,
1802 hwc_layer_1_t* layer = &list->hwLayers[index];
1803 private_handle_t *hnd = (private_handle_t *)layer->handle;
1819 pipeSpecs.needsScaling = qhwc::needsScaling(layer) or
1836 int MDPCompNonSplit::configure4k2kYuv(hwc_context_t *ctx, hwc_layer_1_t *layer,
1846 return configureSourceSplit(ctx, layer, mDpy, mdpFlagsL, zOrder, isFg,
1870 hwc_layer_1_t *layer = &list->hwLayers[i];
1871 private_handle_t *hnd = (private_handle_t *)layer->handle;
1873 if (!(layer->flags & HWC_COLOR_FILL)) {
1877 // No PLAY for Color layer
1900 ALOGD_IF(isDebug(),"%s: MDP Comp: Drawing layer: %p hnd: %p \
1901 using pipe: %d", __FUNCTION__, layer, hnd, indexL );
1911 ALOGD_IF(isDebug(),"%s: MDP Comp: Drawing layer: %p hnd: %p \
1912 using pipe: %d", __FUNCTION__, layer, hnd, indexR );
1943 ALOGD_IF(isDebug(),"%s: MDP Comp: Drawing layer: %p hnd: %p \
1944 using pipe: %d", __FUNCTION__, layer,
1971 //if 4kx2k yuv layer is totally present in either in left half
1972 //or right half then try splitting the yuv layer to avoid decimation
1982 hwc_layer_1_t* layer = &list->hwLayers[index];
1983 private_handle_t *hnd = (private_handle_t *)layer->handle;
1985 hwc_rect_t dst = layer->displayFrame;
1998 bool MDPCompSplit::acquireMDPPipes(hwc_context_t *ctx, hwc_layer_1_t* layer,
2002 private_handle_t *hnd = (private_handle_t *)layer->handle;
2003 hwc_rect_t dst = layer->displayFrame;
2010 pipeSpecs.needsScaling = qhwc::needsScalingWithSplit(ctx, layer, mDpy);
2041 hwc_layer_1_t* layer = &list->hwLayers[index];
2042 private_handle_t *hnd = (private_handle_t *)layer->handle;
2043 hwc_rect_t dst = layer->displayFrame;
2058 if(!acquireMDPPipes(ctx, layer, pipe_info)) {
2067 int MDPCompSplit::configure4k2kYuv(hwc_context_t *ctx, hwc_layer_1_t *layer,
2070 hwc_rect_t dst = layer->displayFrame;
2080 return configureSourceSplit(ctx, layer, mDpy, mdpFlagsL, zOrder, isFg,
2084 return configure(ctx, layer, PipeLayerPair);
2091 int MDPCompSplit::configure(hwc_context_t *ctx, hwc_layer_1_t *layer,
2101 ALOGD_IF(isDebug(),"%s: configuring: layer: %p z_order: %d dest_pipeL: %d"
2102 "dest_pipeR: %d",__FUNCTION__, layer, zOrder, lDest, rDest);
2104 return configureSplit(ctx, layer, mDpy, mdpFlagsL, zOrder, isFg, lDest,
2128 hwc_layer_1_t *layer = &list->hwLayers[i];
2129 private_handle_t *hnd = (private_handle_t *)layer->handle;
2157 ALOGD_IF(isDebug(),"%s: MDP Comp: Drawing layer: %p hnd: %p \
2158 using pipe: %d", __FUNCTION__, layer, hnd, indexL );
2168 ALOGD_IF(isDebug(),"%s: MDP Comp: Drawing layer: %p hnd: %p \
2169 using pipe: %d", __FUNCTION__, layer, hnd, indexR );
2208 ALOGD_IF(isDebug(),"%s: MDP Comp: Drawing layer: %p hnd: %p \
2209 using pipe: %d", __FUNCTION__, layer, hnd, indexL );
2220 ALOGD_IF(isDebug(),"%s: MDP Comp: Drawing layer: %p hnd: %p \
2221 using pipe: %d", __FUNCTION__, layer, hnd, indexR );
2237 bool MDPCompSrcSplit::acquireMDPPipes(hwc_context_t *ctx, hwc_layer_1_t* layer,
2239 private_handle_t *hnd = (private_handle_t *)layer->handle;
2240 hwc_rect_t dst = layer->displayFrame;
2241 hwc_rect_t crop = integerizeSourceCrop(layer->sourceCropf);
2252 pipeSpecs.needsScaling = qhwc::needsScaling(layer);
2256 //1 pipe by default for a layer
2267 if the layer's width is > mixer's width
2297 int MDPCompSrcSplit::configure(hwc_context_t *ctx, hwc_layer_1_t *layer,
2299 private_handle_t *hnd = (private_handle_t *)layer->handle;
2301 ALOGE("%s: layer handle is NULL", __FUNCTION__);
2312 hwc_rect_t crop = integerizeSourceCrop(layer->sourceCropf);
2313 hwc_rect_t dst = layer->displayFrame;
2314 int transform = layer->transform;
2321 ALOGD_IF(isDebug(),"%s: configuring: layer: %p z_order: %d dest_pipeL: %d"
2322 "dest_pipeR: %d",__FUNCTION__, layer, z, lDest, rDest);
2325 if (layer->flags & HWC_FORMAT_RB_SWAP) {
2333 setMdpFlags(ctx, layer, mdpFlags, 0, transform);
2340 if(has90Transform(layer) && isRotationDoable(ctx, hnd)) {
2343 ctx->mLayerRotMap[mDpy]->add(layer, *rot);
2357 //If 2 pipes being used, divide layer into half, crop and dst
2385 static_cast<eRotFlags>(rotFlags), layer->planeAlpha,
2386 (ovutils::eBlending) getBlending(layer->blending));
2399 layer->planeAlpha,
2400 (ovutils::eBlending) getBlending(layer->blending));