Skip to content

Commit 042b871

Browse files
AngeloGioacchino Del RegnoChun-Kuang Hu
authored andcommitted
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 <[email protected]> Reviewed-by: Fei Shao <[email protected]> Tested-by: Fei Shao <[email protected]> Reviewed-by: Daniel Stone <[email protected]> Reviewed-by: CK Hu <[email protected]> Link: https://patchwork.kernel.org/project/dri-devel/patch/[email protected]/ Signed-off-by: Chun-Kuang Hu <[email protected]>
1 parent 8400291 commit 042b871

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/gpu/drm/mediatek/mtk_drm_drv.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -539,8 +539,8 @@ static int mtk_drm_kms_init(struct drm_device *drm)
539539
}
540540

541541
/* IGT will check if the cursor size is configured */
542-
drm->mode_config.cursor_width = drm->mode_config.max_width;
543-
drm->mode_config.cursor_height = drm->mode_config.max_height;
542+
drm->mode_config.cursor_width = 512;
543+
drm->mode_config.cursor_height = 512;
544544

545545
/* Use OVL device for all DMA memory allocations */
546546
crtc = drm_crtc_from_index(drm, 0);

0 commit comments

Comments
 (0)