]> www.infradead.org Git - users/jedix/linux-maple.git/commit
drm/mediatek: Set sensible cursor width/height values to fix crash
authorAngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Thu, 18 Jul 2024 08:24:10 +0000 (10:24 +0200)
committerChun-Kuang Hu <chunkuang.hu@kernel.org>
Mon, 5 Aug 2024 13:06:20 +0000 (13:06 +0000)
commit042b8711a0beafb2c3b888bebe3c300ab4c817fa
treeebb2521c05a755d50dd8ec337342175171548f84
parent8400291e289ee6b2bf9779ff1c83a291501f017b
drm/mediatek: Set sensible cursor width/height values to fix crash

Hardware-speaking, there is no feature-reduced cursor specific
plane, so this driver reserves the last all Overlay plane as a
Cursor plane, but sets the maximum cursor width/height to the
maximum value that the full overlay plane can use.

While this could be ok, it raises issues with common userspace
using libdrm (especially Mutter, but other compositors too) which
will crash upon performing allocations and/or using said cursor
plane.

Reduce the maximum width/height for the cursor to 512x512 pixels,
value taken from IGT's maximum cursor size test, which succeeds.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Reviewed-by: Fei Shao <fshao@chromium.org>
Tested-by: Fei Shao <fshao@chromium.org>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: CK Hu <ck.hu@mediatek.com>
Link: https://patchwork.kernel.org/project/dri-devel/patch/20240718082410.204459-1-angelogioacchino.delregno@collabora.com/
Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>
drivers/gpu/drm/mediatek/mtk_drm_drv.c