* [PATCH] drm/mediatek: ovl: Report coverage blending on older SoCs
@ 2026-11-20 20:05 Ryan Brue
2026-11-20 20:15 ` sashiko-bot
0 siblings, 1 reply; 2+ messages in thread
From: Ryan Brue @ 2026-11-20 20:05 UTC (permalink / raw)
To: Chun-Kuang Hu, Philipp Zabel, David Airlie, Simona Vetter,
Matthias Brugger, AngeloGioacchino Del Regno
Cc: dri-devel, linux-mediatek, linux-kernel, linux-arm-kernel,
Ryan Brue
Since commit 860e748bddcc ("drm: ensure blend mode supported if pixel
format with alpha exposed"), every OVL plane on MT2701, MT8167, MT8173
and MT8183 warns at boot:
[drm] [PLANE:37:plane-0] pixel format with alpha exposed but blend
mode not setup. Please fix.
These OVLs expose ARGB formats but don't have blend_modes in their driver
data, so no "pixel blend mode" property is created. They can't blend
premultiplied pixels: mtk_ovl_fmt_convert() always selects the
non-premultiplied color formats for them, which is the DRM "Coverage"
equation. Since commit 9813e158d13d ("drm/drm_blend: allow blend mode
property without PREMULTI") a coverage-only property is allowed, so
advertise it and drop the comment saying it couldn't be created.
The plane state now defaults to Coverage instead of Pre-multiplied. Both
are non-zero, so mtk_ovl_layer_config() programs the same registers as
before.
Tested on MT8173 (Amazon Fire HD 10 2017). The warning is gone, every
plane reports a "pixel blend mode" of Coverage, and the OVL0 layer
registers are unchanged.
Signed-off-by: Ryan Brue <ryanbrue.dev@gmail.com>
---
Since 7.3, MT8173 and the other OVLs without premultiplied alpha log
"pixel format with alpha exposed but blend mode not setup" for every
plane at boot. They blend in coverage mode, and the blend mode helper
now accepts a coverage-only property, so this patch advertises that.
No register changes; tested on MT8173 (Amazon Fire HD 10 2017).
This patch was developed with the help of an LLM.
---
drivers/gpu/drm/mediatek/mtk_disp_ovl.c | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/drivers/gpu/drm/mediatek/mtk_disp_ovl.c b/drivers/gpu/drm/mediatek/mtk_disp_ovl.c
index 5445870716f9..81a4143f294d 100644
--- a/drivers/gpu/drm/mediatek/mtk_disp_ovl.c
+++ b/drivers/gpu/drm/mediatek/mtk_disp_ovl.c
@@ -412,12 +412,8 @@ static unsigned int mtk_ovl_fmt_convert(struct mtk_disp_ovl *ovl,
* and supports premultiplied color formats, such as OVL_CON_CLRFMT_PARGB8888.
*
* Check blend_modes in the driver data to see if premultiplied mode is supported.
- * If not, use coverage mode instead to set it to the supported color formats.
- *
- * Current DRM assumption is that alpha is default premultiplied, so the bitmask of
- * blend_modes must include BIT(DRM_MODE_BLEND_PREMULTI). Otherwise, mtk_plane_init()
- * will get an error return from drm_plane_create_blend_mode_property() and
- * state->base.pixel_blend_mode should not be used.
+ * If not, the hardware only blends in coverage mode, which is the only mode
+ * those platforms advertise.
*/
if (ovl->data->blend_modes & BIT(DRM_MODE_BLEND_PREMULTI))
blend_mode = state->base.pixel_blend_mode;
@@ -667,6 +663,7 @@ static const struct mtk_disp_ovl_data mt2701_ovl_driver_data = {
.gmc_bits = 8,
.layer_nr = 4,
.fmt_rgb565_is_0 = false,
+ .blend_modes = BIT(DRM_MODE_BLEND_COVERAGE),
.formats = mt8173_formats,
.num_formats = ARRAY_SIZE(mt8173_formats),
};
@@ -677,6 +674,7 @@ static const struct mtk_disp_ovl_data mt8167_ovl_driver_data = {
.layer_nr = 4,
.fmt_rgb565_is_0 = true,
.smi_id_en = true,
+ .blend_modes = BIT(DRM_MODE_BLEND_COVERAGE),
.formats = mt8173_formats,
.num_formats = ARRAY_SIZE(mt8173_formats),
};
@@ -686,6 +684,7 @@ static const struct mtk_disp_ovl_data mt8173_ovl_driver_data = {
.gmc_bits = 8,
.layer_nr = 4,
.fmt_rgb565_is_0 = true,
+ .blend_modes = BIT(DRM_MODE_BLEND_COVERAGE),
.formats = mt8173_formats,
.num_formats = ARRAY_SIZE(mt8173_formats),
};
@@ -695,6 +694,7 @@ static const struct mtk_disp_ovl_data mt8183_ovl_driver_data = {
.gmc_bits = 10,
.layer_nr = 4,
.fmt_rgb565_is_0 = true,
+ .blend_modes = BIT(DRM_MODE_BLEND_COVERAGE),
.formats = mt8173_formats,
.num_formats = ARRAY_SIZE(mt8173_formats),
};
@@ -704,6 +704,7 @@ static const struct mtk_disp_ovl_data mt8183_ovl_2l_driver_data = {
.gmc_bits = 10,
.layer_nr = 2,
.fmt_rgb565_is_0 = true,
+ .blend_modes = BIT(DRM_MODE_BLEND_COVERAGE),
.formats = mt8173_formats,
.num_formats = ARRAY_SIZE(mt8173_formats),
};
---
base-commit: aebb7274476403040d582c61478df8f4a7bf9cd3
change-id: 20261118-rbrue-suez-mtk-ovl-coverage-198c11ba8b14
Best regards,
--
Ryan Brue <ryanbrue.dev@gmail.com>
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] drm/mediatek: ovl: Report coverage blending on older SoCs
2026-11-20 20:05 [PATCH] drm/mediatek: ovl: Report coverage blending on older SoCs Ryan Brue
@ 2026-11-20 20:15 ` sashiko-bot
0 siblings, 0 replies; 2+ messages in thread
From: sashiko-bot @ 2026-11-20 20:15 UTC (permalink / raw)
To: Ryan Brue; +Cc: dri-devel
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [High] drm/mediatek: ovl: mtk_ovl_layer_config() sets OVL_CON_AEN on
XRGB formats
--
commit ecc63cbd272ca62ff2a9d686e47d8eb659dfe660
Author: Ryan Brue <ryanbrue.dev@gmail.com>
drm/mediatek: ovl: Report coverage blending on older SoCs
This commit sets .blend_modes = BIT(DRM_MODE_BLEND_COVERAGE) on MT2701,
MT8167, MT8173, and MT8183 OVL driver data to eliminate the DRM plane
init warning when exposing alpha formats without a blend mode property.
> diff --git a/drivers/gpu/drm/mediatek/mtk_disp_ovl.c b/drivers/gpu/drm/mediatek/mtk_disp_ovl.c
> index 5445870716f94..81a4143f294d5 100644
> --- a/drivers/gpu/drm/mediatek/mtk_disp_ovl.c
> +++ b/drivers/gpu/drm/mediatek/mtk_disp_ovl.c
[ ... ]
> @@ -667,6 +663,7 @@ static const struct mtk_disp_ovl_data mt2701_ovl_driver_data = {
> .gmc_bits = 8,
> .layer_nr = 4,
> .fmt_rgb565_is_0 = false,
> + .blend_modes = BIT(DRM_MODE_BLEND_COVERAGE),
> .formats = mt8173_formats,
> .num_formats = ARRAY_SIZE(mt8173_formats),
> };
> @@ -677,6 +674,7 @@ static const struct mtk_disp_ovl_data mt8167_ovl_driver_data = {
> .layer_nr = 4,
> .fmt_rgb565_is_0 = true,
> .smi_id_en = true,
> + .blend_modes = BIT(DRM_MODE_BLEND_COVERAGE),
> .formats = mt8173_formats,
> .num_formats = ARRAY_SIZE(mt8173_formats),
> };
> @@ -686,6 +684,7 @@ static const struct mtk_disp_ovl_data mt8173_ovl_driver_data = {
> .gmc_bits = 8,
> .layer_nr = 4,
> .fmt_rgb565_is_0 = true,
> + .blend_modes = BIT(DRM_MODE_BLEND_COVERAGE),
> .formats = mt8173_formats,
> .num_formats = ARRAY_SIZE(mt8173_formats),
> };
> @@ -695,6 +694,7 @@ static const struct mtk_disp_ovl_data mt8183_ovl_driver_data = {
> .gmc_bits = 10,
> .layer_nr = 4,
> .fmt_rgb565_is_0 = true,
> + .blend_modes = BIT(DRM_MODE_BLEND_COVERAGE),
> .formats = mt8173_formats,
> .num_formats = ARRAY_SIZE(mt8173_formats),
> };
> @@ -704,6 +704,7 @@ static const struct mtk_disp_ovl_data mt8183_ovl_2l_driver_data = {
> .gmc_bits = 10,
> .layer_nr = 2,
> .fmt_rgb565_is_0 = true,
> + .blend_modes = BIT(DRM_MODE_BLEND_COVERAGE),
> .formats = mt8173_formats,
> .num_formats = ARRAY_SIZE(mt8173_formats),
> };
[Severity: High]
Does advertising BIT(DRM_MODE_BLEND_COVERAGE) on these SoCs cause
mtk_ovl_layer_config() to set OVL_CON_AEN on opaque formats such as
DRM_FORMAT_XRGB8888?
DRM_MODE_BLEND_PREMULTI is 0 while DRM_MODE_BLEND_COVERAGE is 1. When
.blend_modes was 0, state->base.pixel_blend_mode stayed at 0, so
mtk_ovl_layer_config() only set OVL_CON_AEN when has_alpha was true:
drivers/gpu/drm/mediatek/mtk_disp_ovl.c:mtk_ovl_layer_config() {
...
unsigned int blend_mode = state->base.pixel_blend_mode;
...
if (blend_mode || state->base.fb->format->has_alpha)
con |= OVL_CON_AEN;
...
}
With state->base.pixel_blend_mode now initialized to
DRM_MODE_BLEND_COVERAGE (1), blend_mode is non-zero and OVL_CON_AEN is
always set. Because these older OVL blocks map XRGB8888 to
OVL_CON_CLRFMT_ARGB8888 and do not support OVL_CONST_BLEND, enabling
OVL_CON_AEN makes the hardware read the X byte from memory as per-pixel
alpha, reintroducing the XRGB scanout regression fixed by 995d4d558eea
("drm/mediatek: ovl: Fix XRGB format breakage for blend_modes unsupported
SoCs").
Checking whether ovl->data->blend_modes includes
BIT(DRM_MODE_BLEND_PIXEL_NONE) instead of testing blend_mode as a boolean
would preserve OVL_CON_AEN behavior on coverage-only SoCs.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261120-rbrue-suez-mtk-ovl-coverage-v1-1-35040085fc37@gmail.com?part=1
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-11-20 20:15 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-20 20:05 [PATCH] drm/mediatek: ovl: Report coverage blending on older SoCs Ryan Brue
2026-11-20 20:15 ` sashiko-bot
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.