Lines Matching refs:layer

288         hwc_layer_1_t* layer = &(list->hwLayers[index]);
291 layer->compositionType = HWC_OVERLAY;
292 layer->hints |= HWC_HINT_CLEAR_FB;
294 /* Drop the layer when its already present in FB OR when it lies
297 layer->compositionType = HWC_OVERLAY;
340 // populate layer and MDP maps
375 hwc_layer_1_t const* layer = &list->hwLayers[i];
376 if(curFrame.isFBComposed[i] && layerUpdating(layer)){
383 bool MDPComp::isSupportedForMDPComp(hwc_context_t *ctx, hwc_layer_1_t* layer) {
384 private_handle_t *hnd = (private_handle_t *)layer->handle;
385 if((has90Transform(layer) and (not isRotationDoable(ctx, hnd))) ||
386 (not isValidDimension(ctx,layer))
394 bool MDPComp::isValidDimension(hwc_context_t *ctx, hwc_layer_1_t *layer) {
395 private_handle_t *hnd = (private_handle_t *)layer->handle;
398 if (layer->flags & HWC_COLOR_FILL) {
399 // Color layer
402 ALOGD_IF(isDebug(), "%s: layer handle is NULL", __FUNCTION__);
407 if(!isSecureBuffer(hnd) && isNonIntegralSourceCrop(layer->sourceCropf))
410 hwc_rect_t crop = integerizeSourceCrop(layer->sourceCropf);
411 hwc_rect_t dst = layer->displayFrame;
412 bool rotated90 = (bool)(layer->transform & HAL_TRANSFORM_ROT_90);
511 // state to block mode. We need this to cater for the case when a layer
521 hwc_rect_t MDPComp::calculateDirtyRect(const hwc_layer_1_t* layer,
523 hwc_region_t surfDamage = layer->surfaceDamage;
524 hwc_rect_t src = integerizeSourceCrop(layer->sourceCropf);
525 hwc_rect_t dst = layer->displayFrame;
532 // full layer updating, dirty rect is full frame
533 dirtyRect = getIntersection(layer->displayFrame, scissor);
556 * 2) If we have a scaling layer which needs cropping against generated
570 const hwc_layer_1_t* layer = &list->hwLayers[i];
571 hwc_rect_t dstRect = layer->displayFrame;
578 /* Reset frame ROI when any layer which needs scaling also needs ROI
580 if(!isSameRect(res, dstRect) && needsScaling (layer)) {
588 if (layer->blending == HWC_BLENDING_NONE &&
589 layer->planeAlpha == 0xFF)
596 /* Calculate ROI for the frame by accounting all the layer's dispalyFrame which
598 * the changing layer's dirtyRegion. */
610 hwc_layer_1_t* layer = &list->hwLayers[index];
611 if (layerUpdating(layer) ||
612 isYuvBuffer((private_handle_t *)layer->handle)) {
613 hwc_rect_t dirtyRect = getIntersection(layer->displayFrame,
615 if(!needsScaling(layer) && !layer->transform) {
616 dirtyRect = calculateDirtyRect(layer, fullFrame);
623 /* No layer is updating. Still SF wants a refresh.*/
654 * ROI's and drop them from composition. If a layer is spanning across both
657 * 2) If we have a scaling layer which needs cropping against generated
675 const hwc_layer_1_t* layer = &list->hwLayers[i];
676 hwc_rect_t dstRect = layer->displayFrame;
686 /* Reset frame ROI when any layer which needs scaling also needs ROI
688 if(!isSameRect(res, dstRect) && needsScaling (layer)) {
694 if (layer->blending == HWC_BLENDING_NONE &&
695 layer->planeAlpha == 0xFF) {
703 /* Calculate ROI for the frame by accounting all the layer's dispalyFrame which
705 * the changing layer's dirtyRegion. */
724 hwc_layer_1_t* layer = &list->hwLayers[index];
725 private_handle_t *hnd = (private_handle_t *)layer->handle;
727 if (layerUpdating(layer) || isYuvBuffer(hnd)) {
728 hwc_rect_t l_dirtyRect = getIntersection(layer->displayFrame,
730 hwc_rect_t r_dirtyRect = getIntersection(layer->displayFrame,
733 if(!needsScaling(layer) && !layer->transform) {
734 l_dirtyRect = calculateDirtyRect(layer, l_frame);
735 r_dirtyRect = calculateDirtyRect(layer, r_frame);
756 /* No layer is updating. Still SF wants a refresh. */
792 * or if there is only a single layer being composed */
827 hwc_layer_1_t* layer = &list->hwLayers[i];
828 private_handle_t *hnd = (private_handle_t *)layer->handle;
830 if(has90Transform(layer) && isRotationDoable(ctx, hnd)) {
838 //For 8x26 with panel width>1k, if RGB layer needs HFLIP fail mdp comp
841 int transform = (layer->flags & HWC_COLOR_FILL) ? 0 : layer->transform;
871 hwc_layer_1_t* layer = &list->hwLayers[i];
873 not isSupportedForMDPComp(ctx, layer)) {
874 ALOGD_IF(isDebug(), "%s: Unsupported layer in list",__FUNCTION__);
901 * covered by the smallest layer at a higher z-order, gets composed
926 hwc_layer_1_t* layer = &list->hwLayers[i];
927 if(not isSupportedForMDPComp(ctx, layer)) {
928 ALOGD_IF(isDebug(), "%s: Unsupported layer in list",__FUNCTION__);
934 1. A below layer needs scaling.
936 3. Overlap or a below layer has 90 degree transform.
947 hwc_layer_1_t* layer = &list->hwLayers[i];
948 hwc_rect_t crop = integerizeSourceCrop(layer->sourceCropf);
949 hwc_rect_t dispFrame = layer->displayFrame;
951 // PTOR layer should be peripheral and cannot have transform
953 has90Transform(layer)) {
963 // Check if the layers below this layer qualifies for PTOR comp
964 hwc_layer_1_t* layer = &list->hwLayers[j];
965 hwc_rect_t disFrame = layer->displayFrame;
969 if (has90Transform(layer) || needsScaling(layer)) {
993 hwc_layer_1_t* layer = &list->hwLayers[i];
994 displayFrame[i] = layer->displayFrame;
995 sourceCrop[i] = integerizeSourceCrop(layer->sourceCropf);
1001 * from the lower PTOR layer to avoid overlapping.
1038 // Update src crop of PTOR layer
1039 hwc_layer_1_t* layer = &list->hwLayers[index];
1040 layer->sourceCropf.left = (float)ctx->mPtorInfo.displayFrame[j].left;
1041 layer->sourceCropf.top = (float)ctx->mPtorInfo.displayFrame[j].top;
1042 layer->sourceCropf.right = (float)ctx->mPtorInfo.displayFrame[j].right;
1043 layer->sourceCropf.bottom =(float)ctx->mPtorInfo.displayFrame[j].bottom;
1045 // Store & update w, h, format of PTOR layer
1046 private_handle_t *hnd = (private_handle_t *)layer->handle;
1053 // Store & update blending mode, planeAlpha and transform of PTOR layer
1054 blending[j] = layer->blending;
1055 planeAlpha[j] = layer->planeAlpha;
1056 transform[j] = layer->transform;
1057 layer->blending = HWC_BLENDING_NONE;
1058 layer->planeAlpha = 0xFF;
1059 layer->transform = 0;
1063 layer = &list->hwLayers[i];
1064 if(!isValidRect(getIntersection(layer->displayFrame,
1068 // Update layer attributes
1069 hwc_rect_t srcCrop = integerizeSourceCrop(layer->sourceCropf);
1070 hwc_rect_t destRect = deductRect(layer->displayFrame,
1071 getIntersection(layer->displayFrame, overlapRect[j]));
1072 qhwc::calculate_crop_rects(srcCrop, layer->displayFrame, destRect,
1073 layer->transform);
1074 layer->sourceCropf.left = (float)srcCrop.left;
1075 layer->sourceCropf.top = (float)srcCrop.top;
1076 layer->sourceCropf.right = (float)srcCrop.right;
1077 layer->sourceCropf.bottom = (float)srcCrop.bottom;
1096 // Restore layer attributes
1098 hwc_layer_1_t* layer = &list->hwLayers[i];
1099 layer->displayFrame = displayFrame[i];
1100 layer->sourceCropf.left = (float)sourceCrop[i].left;
1101 layer->sourceCropf.top = (float)sourceCrop[i].top;
1102 layer->sourceCropf.right = (float)sourceCrop[i].right;
1103 layer->sourceCropf.bottom = (float)sourceCrop[i].bottom;
1109 hwc_layer_1_t* layer = &list->hwLayers[idx];
1114 layer->blending = blending[i];
1115 layer->planeAlpha = planeAlpha[i];
1116 layer->transform = transform[i];
1161 //If an MDP marked layer is unsupported cannot do partial MDP Comp
1164 hwc_layer_1_t* layer = &list->hwLayers[i];
1165 if(not isSupportedForMDPComp(ctx, layer)) {
1166 ALOGD_IF(isDebug(), "%s: Unsupported layer in list",
1226 hwc_layer_1_t* layer = &list->hwLayers[i];
1227 if(not isSupportedForMDPComp(ctx, layer)) {
1337 * single layer being composed. */
1408 * single layer being composed. */
1457 bool MDPComp::isYUVDoable(hwc_context_t* ctx, hwc_layer_1_t* layer) {
1458 if(isSkipLayer(layer)) {
1463 if(has90Transform(layer) && !canUseRotator(ctx, mDpy)) {
1468 if(isSecuring(ctx, layer)) {
1473 if(!isValidDimension(ctx, layer)) {
1479 if(layer->planeAlpha < 0xFF) {
1480 ALOGD_IF(isDebug(), "%s: Cannot handle YUV layer with plane alpha\
1490 bool MDPComp::isSecureRGBDoable(hwc_context_t* ctx, hwc_layer_1_t* layer) {
1491 if(isSkipLayer(layer)) {
1492 ALOGD_IF(isDebug(), "%s: Secure RGB layer marked SKIP dpy %d",
1497 if(isSecuring(ctx, layer)) {
1502 if(not isSupportedForMDPComp(ctx, layer)) {
1503 ALOGD_IF(isDebug(), "%s: Unsupported secure RGB layer",
1510 /* starts at fromIndex and check for each layer to find
1511 * if it it has overlapping with any Updating layer above it in zorder
1525 /* Checks if given layer at targetLayerIndex has any
1554 int updatingLayersAbove = 0;//Updating layer count in middle of batch
1576 // We have a valid updating layer already. If layer-i not
1578 // batch-start and i, then we can add layer i to batch.
1626 * NEVER mark an updating layer for caching.
1648 hwc_layer_1_t* layer = &list->hwLayers[i];
1652 //If an unsupported layer is being attempted to
1654 if(not isSupportedForMDPComp(ctx, layer)) {
1680 hwc_layer_1_t * layer = &list->hwLayers[i];
1681 if (!layerUpdating(layer)) {
1702 hwc_layer_1_t * layer = &list->hwLayers[i];
1703 if(!(isAIVVideoLayer(layer) || isAIVCCLayer(layer))) {
1721 hwc_layer_1_t* layer = &list->hwLayers[nYuvIndex];
1727 if(!isYUVDoable(ctx, layer)) {
1734 private_handle_t *hnd = (private_handle_t *)layer->handle;
1752 hwc_layer_1_t* layer = &list->hwLayers[nSecureRGBIndex];
1754 if(!isSecureRGBDoable(ctx, layer)) {
1780 hwc_layer_1_t* layer = &list->hwLayers[i];
1781 hwc_rect_t dst = layer->displayFrame;
1826 hwc_layer_1_t* layer = &list->hwLayers[index];
1835 private_handle_t *hnd = (private_handle_t *)layer->handle;
1837 if(configure4k2kYuv(ctx, layer,
1841 for layer %d",__FUNCTION__, index);
1849 if(configure(ctx, layer, mCurrentFrame.mdpToLayer[mdpIndex]) != 0 ){
1851 layer %d",__FUNCTION__, index);
1887 hwc_layer_1_t* layer = &list->hwLayers[index];
1888 private_handle_t *hnd = (private_handle_t *)layer->handle;
1889 if(has90Transform(layer) && isRotationDoable(ctx, hnd)) {
1907 //If a layer need alpha scaling, MDP can not support.
1927 //if layer-i is marked for MDP and needs downscaling
1928 //check if any MDP layer on top of i & overlaps with layer-i
1945 // Checks only if videos or single layer(RGB) is updating
1947 // layer video playback
1977 //Set the new fresh rate, if there is only one updating YUV layer
1978 //or there is one single RGB layer with this request
2018 ALOGI_IF(numLayers, "%s: Unsupported layer count for mdp composition: %d",
2149 //If 4k2k Yuv layer split is possible, and if
2150 //fbz is above 4k2k layer, increment fb zorder by 1
2151 //as we split 4k2k layer and increment zorder for right half
2152 //of the layer
2163 hwc_layer_1_t* layer = &list->hwLayers[index];
2164 private_handle_t *hnd = (private_handle_t *)layer->handle;
2169 //As we split 4kx2k yuv layer and program to 2 VG pipes
2181 int MDPCompNonSplit::configure(hwc_context_t *ctx, hwc_layer_1_t *layer,
2189 ALOGD_IF(isDebug(),"%s: configuring: layer: %p z_order: %d dest_pipe: %d",
2190 __FUNCTION__, layer, zOrder, dest);
2192 return configureNonSplit(ctx, layer, mDpy, mdpFlags, zOrder, dest,
2202 hwc_layer_1_t* layer = &list->hwLayers[index];
2203 private_handle_t *hnd = (private_handle_t *)layer->handle;
2219 pipeSpecs.needsScaling = qhwc::needsScaling(layer) or
2236 int MDPCompNonSplit::configure4k2kYuv(hwc_context_t *ctx, hwc_layer_1_t *layer,
2245 return configureSourceSplit(ctx, layer, mDpy, mdpFlagsL, zOrder,
2269 hwc_layer_1_t *layer = &list->hwLayers[i];
2270 private_handle_t *hnd = (private_handle_t *)layer->handle;
2272 if (!(layer->flags & HWC_COLOR_FILL)) {
2276 // No PLAY for Color layer
2299 ALOGD_IF(isDebug(),"%s: MDP Comp: Drawing layer: %p hnd: %p \
2300 using pipe: %d", __FUNCTION__, layer, hnd, indexL );
2310 ALOGD_IF(isDebug(),"%s: MDP Comp: Drawing layer: %p hnd: %p \
2311 using pipe: %d", __FUNCTION__, layer, hnd, indexR );
2341 ALOGD_IF(isDebug(),"%s: MDP Comp: Drawing layer: %p hnd: %p \
2342 using pipe: %d", __FUNCTION__, layer,
2369 //if 4kx2k yuv layer is totally present in either in left half
2370 //or right half then try splitting the yuv layer to avoid decimation
2380 hwc_layer_1_t* layer = &list->hwLayers[index];
2381 private_handle_t *hnd = (private_handle_t *)layer->handle;
2383 hwc_rect_t dst = layer->displayFrame;
2396 bool MDPCompSplit::acquireMDPPipes(hwc_context_t *ctx, hwc_layer_1_t* layer,
2400 private_handle_t *hnd = (private_handle_t *)layer->handle;
2401 hwc_rect_t dst = layer->displayFrame;
2408 pipeSpecs.needsScaling = qhwc::needsScalingWithSplit(ctx, layer, mDpy);
2439 hwc_layer_1_t* layer = &list->hwLayers[index];
2440 private_handle_t *hnd = (private_handle_t *)layer->handle;
2441 hwc_rect_t dst = layer->displayFrame;
2456 if(!acquireMDPPipes(ctx, layer, pipe_info)) {
2465 int MDPCompSplit::configure4k2kYuv(hwc_context_t *ctx, hwc_layer_1_t *layer,
2468 hwc_rect_t dst = layer->displayFrame;
2477 return configureSourceSplit(ctx, layer, mDpy, mdpFlagsL, zOrder,
2481 return configure(ctx, layer, PipeLayerPair);
2488 int MDPCompSplit::configure(hwc_context_t *ctx, hwc_layer_1_t *layer,
2497 ALOGD_IF(isDebug(),"%s: configuring: layer: %p z_order: %d dest_pipeL: %d"
2498 "dest_pipeR: %d",__FUNCTION__, layer, zOrder, lDest, rDest);
2500 return configureSplit(ctx, layer, mDpy, mdpFlagsL, zOrder, lDest,
2524 hwc_layer_1_t *layer = &list->hwLayers[i];
2525 private_handle_t *hnd = (private_handle_t *)layer->handle;
2553 ALOGD_IF(isDebug(),"%s: MDP Comp: Drawing layer: %p hnd: %p \
2554 using pipe: %d", __FUNCTION__, layer, hnd, indexL );
2564 ALOGD_IF(isDebug(),"%s: MDP Comp: Drawing layer: %p hnd: %p \
2565 using pipe: %d", __FUNCTION__, layer, hnd, indexR );
2604 ALOGD_IF(isDebug(),"%s: MDP Comp: Drawing layer: %p hnd: %p \
2605 using pipe: %d", __FUNCTION__, layer, hnd, indexL );
2616 ALOGD_IF(isDebug(),"%s: MDP Comp: Drawing layer: %p hnd: %p \
2617 using pipe: %d", __FUNCTION__, layer, hnd, indexR );
2646 const hwc_layer_1_t* layer = &list->hwLayers[i];
2647 hwc_rect_t dstRect = layer->displayFrame;
2654 /* Reset frame ROI when any layer which needs scaling also needs ROI
2656 if(!isSameRect(res, dstRect) && needsScaling (layer)) {
2664 if (layer->blending == HWC_BLENDING_NONE &&
2665 layer->planeAlpha == 0xFF)
2689 hwc_layer_1_t* layer = &list->hwLayers[index];
2691 // If we have a RGB layer which needs rotation, no partial update
2692 if(!isYuvBuffer((private_handle_t *)layer->handle) && layer->transform)
2695 if (layerUpdating(layer) ||
2696 isYuvBuffer((private_handle_t *)layer->handle)) {
2697 hwc_rect_t dirtyRect = getIntersection(layer->displayFrame,
2699 if (!needsScaling(layer) && !layer->transform) {
2700 dirtyRect = calculateDirtyRect(layer, fullFrame);
2706 /* No layer is updating. Still SF wants a refresh.*/
2747 bool MDPCompSrcSplit::acquireMDPPipes(hwc_context_t *ctx, hwc_layer_1_t* layer,
2749 private_handle_t *hnd = (private_handle_t *)layer->handle;
2750 hwc_rect_t dst = layer->displayFrame;
2751 hwc_rect_t crop = integerizeSourceCrop(layer->sourceCropf);
2765 pipeSpecs.needsScaling = qhwc::needsScaling(layer);
2769 //1 pipe by default for a layer
2780 if the layer's width is > mixer's width
2789 uint32_t cropWidth = has90Transform(layer) ? crop.bottom - crop.top :
2791 uint32_t cropHeight = has90Transform(layer) ? crop.right - crop.left :
2798 const uint32_t downscale = getRotDownscale(ctx, layer);
2822 int MDPCompSrcSplit::configure(hwc_context_t *ctx, hwc_layer_1_t *layer,
2824 private_handle_t *hnd = (private_handle_t *)layer->handle;
2826 ALOGE("%s: layer handle is NULL", __FUNCTION__);
2836 hwc_rect_t crop = integerizeSourceCrop(layer->sourceCropf);
2837 hwc_rect_t dst = layer->displayFrame;
2838 int transform = layer->transform;
2844 ALOGD_IF(isDebug(),"%s: configuring: layer: %p z_order: %d dest_pipeL: %d"
2845 "dest_pipeR: %d",__FUNCTION__, layer, z, lDest, rDest);
2848 /* MDP driver crops layer coordinates against ROI in Non-Split
2852 * 2) We have to know the effective width of the layer that
2853 * the ROI needs to find the no. of pipes the layer needs.
2859 if (layer->flags & HWC_FORMAT_RB_SWAP) {
2865 // update source crop and destination position of AIV video layer.
2873 int downscale = getRotDownscale(ctx, layer);
2875 setMdpFlags(ctx, layer, mdpFlags, downscale, transform);
2882 if((has90Transform(layer) or downscale) and isRotationDoable(ctx, hnd)) {
2885 ctx->mLayerRotMap[mDpy]->add(layer, *rot);
2900 //If 2 pipes being used, divide layer into half, crop and dst
2938 static_cast<eRotFlags>(rotFlags), layer->planeAlpha,
2939 (ovutils::eBlending) getBlending(layer->blending));
2952 layer->planeAlpha,
2953 (ovutils::eBlending) getBlending(layer->blending));
3042 /* Send hint to mpctl when single layer is updated
3044 * happens immediately upon multiple layer update.
3058 int perfHint = 0x4501; // 45-display layer hint, 01-Enable