Skip to content

Commit 28fbc32

Browse files
Jason-JH.LinChun-Kuang Hu
authored andcommitted
drm/mediatek: ovl: Refine ignore_pixel_alpha comment and placement
Refine the comment for ignore_pixel_alpha flag and move it to if(state->fb) statement to make it less conditional. Signed-off-by: Jason-JH.Lin <[email protected]> Reviewed-by: AngeloGioacchino Del Regno <[email protected]> Reviewed-by: CK Hu <[email protected]> Link: https://patchwork.kernel.org/project/dri-devel/patch/[email protected]/ Signed-off-by: Chun-Kuang Hu <[email protected]>
1 parent 995d4d5 commit 28fbc32

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

drivers/gpu/drm/mediatek/mtk_disp_ovl.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -481,16 +481,16 @@ void mtk_ovl_layer_config(struct device *dev, unsigned int idx,
481481
*/
482482
if (blend_mode || state->base.fb->format->has_alpha)
483483
con |= OVL_CON_AEN;
484-
}
485484

486-
/* CONST_BLD must be enabled for XRGB formats although the alpha channel
487-
* can be ignored, or OVL will still read the value from memory.
488-
* For RGB888 related formats, whether CONST_BLD is enabled or not won't
489-
* affect the result. Therefore we use !has_alpha as the condition.
490-
*/
491-
if ((state->base.fb && !state->base.fb->format->has_alpha) ||
492-
blend_mode == DRM_MODE_BLEND_PIXEL_NONE)
493-
ignore_pixel_alpha = OVL_CONST_BLEND;
485+
/*
486+
* Although the alpha channel can be ignored, CONST_BLD must be enabled
487+
* for XRGB format, otherwise OVL will still read the value from memory.
488+
* For RGB888 related formats, whether CONST_BLD is enabled or not won't
489+
* affect the result. Therefore we use !has_alpha as the condition.
490+
*/
491+
if (blend_mode == DRM_MODE_BLEND_PIXEL_NONE || !state->base.fb->format->has_alpha)
492+
ignore_pixel_alpha = OVL_CONST_BLEND;
493+
}
494494

495495
if (pending->rotation & DRM_MODE_REFLECT_Y) {
496496
con |= OVL_CON_VIRT_FLIP;

0 commit comments

Comments
 (0)