]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/mediatek: Support "None" blending in Mixer
authorHsiao Chien Sung <shawn.sung@mediatek.com>
Wed, 17 Jul 2024 05:24:42 +0000 (13:24 +0800)
committerChun-Kuang Hu <chunkuang.hu@kernel.org>
Wed, 31 Jul 2024 13:24:10 +0000 (13:24 +0000)
Support "None" alpha blending mode on MediaTek's chips.

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Hsiao Chien Sung <shawn.sung@mediatek.com>
Reviewed-by: CK Hu <ck.hu@mediatek.com>
Link: https://patchwork.kernel.org/project/dri-devel/patch/20240717-alpha-blending-v4-2-4b1c806c0749@mediatek.com/
Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>
drivers/gpu/drm/mediatek/mtk_ethdr.c

index 9dfd13d32dfaae387a9393367e1fd4149ae1c6bc..80ccdad3741bdbe09a650dbc743b623d71e79ff4 100644 (file)
@@ -3,6 +3,7 @@
  * Copyright (c) 2021 MediaTek Inc.
  */
 
+#include <drm/drm_blend.h>
 #include <drm/drm_fourcc.h>
 #include <drm/drm_framebuffer.h>
 #include <linux/clk.h>
@@ -175,7 +176,8 @@ void mtk_ethdr_layer_config(struct device *dev, unsigned int idx,
                alpha_con |= state->base.alpha & MIXER_ALPHA;
        }
 
-       if (state->base.fb && !state->base.fb->format->has_alpha) {
+       if ((state->base.fb && !state->base.fb->format->has_alpha) ||
+           state->base.pixel_blend_mode == DRM_MODE_BLEND_PIXEL_NONE) {
                /*
                 * Mixer doesn't support CONST_BLD mode,
                 * use a trick to make the output equivalent