[PATCH 1/1] drm/mediatek: Add check framebuffer width and height size before config ovl

From: Xiandong Wang
Date: Mon Nov 17 2025 - 21:25:19 EST


During the execution of the IGT test kms_cursor_edge_walk,
the screen experiences glitches and the hardware hangs.
It was discovered that the framebuffer dimensions (width and height)
provided by IGT to the display driver are zero, leading to
abnormal parameters that cause the hardware to freeze.
Therefore, it is necessary to verify the buffer dimensions
before successfully passing the IGT test.

Signed-off-by: Xiandong Wang <xiandong.wang@xxxxxxxxxxxx>
---
drivers/gpu/drm/mediatek/mtk_disp_ovl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/mediatek/mtk_disp_ovl.c b/drivers/gpu/drm/mediatek/mtk_disp_ovl.c
index f1fa1f1c3ff0..bb207aee91f2 100644
--- a/drivers/gpu/drm/mediatek/mtk_disp_ovl.c
+++ b/drivers/gpu/drm/mediatek/mtk_disp_ovl.c
@@ -611,7 +611,7 @@ void mtk_ovl_layer_config(struct device *dev, unsigned int idx,
unsigned int ignore_pixel_alpha = 0;
unsigned int con;

- if (!pending->enable) {
+ if (!pending->enable || !pending->height || !pending->width) {
mtk_ovl_layer_off(dev, idx, cmdq_pkt);
return;
}
--
2.46.0