]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/mediatek: Support DRM plane alpha in OVL
authorHsiao Chien Sung <shawn.sung@mediatek.com>
Wed, 19 Jun 2024 16:38:53 +0000 (00:38 +0800)
committerChun-Kuang Hu <chunkuang.hu@kernel.org>
Thu, 20 Jun 2024 13:57:36 +0000 (13:57 +0000)
Set the plane alpha according to DRM plane property.

Reviewed-by: CK Hu <ck.hu@mediatek.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Fixes: 119f5173628a ("drm/mediatek: Add DRM Driver for Mediatek SoC MT8173.")
Signed-off-by: Hsiao Chien Sung <shawn.sung@mediatek.com>
Link: https://patchwork.kernel.org/project/dri-devel/patch/20240620-igt-v3-13-a9d62d2e2c7e@mediatek.com/
Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>
drivers/gpu/drm/mediatek/mtk_disp_ovl.c

index 943db4f1bd6b4230c7eb1d5102fccf429a7112a3..4b370bc0746d8fc60273919946202cd2ee2973cc 100644 (file)
@@ -458,8 +458,10 @@ void mtk_ovl_layer_config(struct device *dev, unsigned int idx,
        }
 
        con = ovl_fmt_convert(ovl, fmt);
-       if (state->base.fb && state->base.fb->format->has_alpha)
-               con |= OVL_CON_AEN | OVL_CON_ALPHA;
+       if (state->base.fb) {
+               con |= OVL_CON_AEN;
+               con |= state->base.alpha & OVL_CON_ALPHA;
+       }
 
        /* CONST_BLD must be enabled for XRGB formats although the alpha channel
         * can be ignored, or OVL will still read the value from memory.