Re: [PATCH v8 05/16] drm/mediatek: Set DRM mode configs accordingly

From: AngeloGioacchino Del Regno
Date: Mon Jun 10 2024 - 04:15:57 EST


Il 06/06/24 11:26, Shawn Sung ha scritto:
From: Hsiao Chien Sung <shawn.sung@xxxxxxxxxxxx>

Set DRM mode configs limitation according to the hardware capabilities
and pass the IGT checks as below:

- The test "graphics.IgtKms.kms_plane" requires a frame buffer with
width of 4512 pixels (> 4096).
- The test "graphics.IgtKms.kms_cursor_crc" checks if the cursor size is
defined, and run the test with cursor size from 1x1 to 512x512.

Please notice that the test conditions may change as IGT is updated.

Reviewed-by: CK Hu <ck.hu@xxxxxxxxxxxx>
Signed-off-by: Hsiao Chien Sung <shawn.sung@xxxxxxxxxxxx>
---
drivers/gpu/drm/mediatek/mtk_drm_drv.c | 22 ++++++++++++++++++++++
drivers/gpu/drm/mediatek/mtk_drm_drv.h | 4 ++++
2 files changed, 26 insertions(+)


..snip..

diff --git a/drivers/gpu/drm/mediatek/mtk_drm_drv.h b/drivers/gpu/drm/mediatek/mtk_drm_drv.h
index 78d698ede1bf..6cfa790e8df5 100644
--- a/drivers/gpu/drm/mediatek/mtk_drm_drv.h
+++ b/drivers/gpu/drm/mediatek/mtk_drm_drv.h
@@ -46,6 +46,10 @@ struct mtk_mmsys_driver_data {
bool shadow_register;
unsigned int mmsys_id;
unsigned int mmsys_dev_num;
+
+ int max_width;
+ int min_width;
+ int min_height;

Only one nit here.

Since {min,max}_{width,height}:
- Will never be negative; and
- Will never need more than 16 bits; and
- Are local to this driver and anyway copied to drm later

Can you please change them to unsigned 16-bits (u16)?

After which,

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@xxxxxxxxxxxxx>

Cheers,
Angelo

};
struct mtk_drm_private {