[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20251230-mtk-afbc-fixes-v1-4-6c0247b66e32@collabora.com>
Date: Tue, 30 Dec 2025 11:03:04 -0300
From: Nícolas F. R. A. Prado <nfraprado@...labora.com>
To: Chun-Kuang Hu <chunkuang.hu@...nel.org>,
Philipp Zabel <p.zabel@...gutronix.de>, David Airlie <airlied@...il.com>,
Simona Vetter <simona@...ll.ch>, Matthias Brugger <matthias.bgg@...il.com>,
AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>,
Justin Green <greenjustin@...omium.org>
Cc: kernel@...labora.com, dri-devel@...ts.freedesktop.org,
linux-mediatek@...ts.infradead.org, linux-kernel@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, ariel.dalessandro@...labora.com,
daniels@...labora.com, kernel@...labora.com, Nancy.Lin@...iatek.com,
Jason-JH.Lin@...iatek.com,
Nícolas F. R. A. Prado <nfraprado@...labora.com>
Subject: [PATCH RFC 4/6] drm/mediatek: ovl: Disallow AFBC buffers with
width over 1920
AFBC buffers with width over 1920 are not supported by OVL. If
attempted, the image displayed contains many artifacts.
Add this restriction to the layer check callback so such configurations
are not allowed.
NOTE: This doesn't seem to be a good way to handle this restriction, as
when tested with Weston, it simply fails to render, rather than fallback
to not using the modifier:
[19:09:03.857] atomic: couldn't commit new state: Invalid argument
[19:09:03.857] repaint-flush failed: Invalid argument
Signed-off-by: Nícolas F. R. A. Prado <nfraprado@...labora.com>
---
drivers/gpu/drm/mediatek/mtk_disp_ovl.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/gpu/drm/mediatek/mtk_disp_ovl.c b/drivers/gpu/drm/mediatek/mtk_disp_ovl.c
index c6a00c2256dd..196b874057ba 100644
--- a/drivers/gpu/drm/mediatek/mtk_disp_ovl.c
+++ b/drivers/gpu/drm/mediatek/mtk_disp_ovl.c
@@ -368,6 +368,13 @@ int mtk_ovl_layer_check(struct device *dev, unsigned int idx,
if (state->fb->format->is_yuv && (state->rotation & ~DRM_MODE_ROTATE_0))
return -EINVAL;
+ /*
+ * AFBC buffers with width > 1920 are not supported and produce
+ * artifacts, so should be disabled.
+ */
+ if (state->fb->modifier != DRM_FORMAT_MOD_LINEAR && state->fb->width > 1920)
+ return -EINVAL;
+
return 0;
}
--
2.51.0
Powered by blists - more mailing lists