drm/mediatek: Filter modes according to hardware capability
authorHsiao Chien Sung <shawn.sung@mediatek.corp-partner.google.com>
Tue, 20 Feb 2024 09:37:11 +0000 (17:37 +0800)
committerChun-Kuang Hu <chunkuang.hu@kernel.org>
Tue, 27 Feb 2024 00:02:55 +0000 (00:02 +0000)
commit5306b3fe57370e8f42f5d2924c063226e76b16a4
tree6a1d0bce3a275b83b67ac54f050c28d8f782678a
parente14cba94bc19ff78545d87a6f85b871cf012df3f
drm/mediatek: Filter modes according to hardware capability

We found a stability issue on MT8188 when connecting an external monitor
in 2560x1440@144Hz mode. Checked with the designer, there is a function
called "prefetch" which is working during VBP (triggered by VSYNC).
If the duration of VBP is too short, the throughput requirement could
increase more than 3 times and lead to stability issues.

The mode settings that VDOSYS supports are mainly affected by clock
rate and throughput, display driver should filter these settings
according to the SoC's limitation to avoid unstable conditions.

Since currently the mode filter is only available on MT8195 and MT8188
and they share the same compatible name, the reference number (8250)
is hard coded instead of in the driver data.

Signed-off-by: Hsiao Chien Sung <shawn.sung@mediatek.corp-partner.google.com>
Reviewed-by: CK Hu <ck.hu@mediatek.com>
Link: https://patchwork.kernel.org/project/dri-devel/patch/20240220093711.20546-2-shawn.sung@mediatek.com/
Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>
drivers/gpu/drm/mediatek/mtk_disp_drv.h
drivers/gpu/drm/mediatek/mtk_disp_merge.c
drivers/gpu/drm/mediatek/mtk_disp_ovl_adaptor.c
drivers/gpu/drm/mediatek/mtk_drm_crtc.c
drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.c
drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.h