From 05c63d2a02d55ff8b8bfb0c5b05a2f76fbeb1a62 Mon Sep 17 00:00:00 2001 From: nerdopolis Date: Tue, 28 May 2024 06:31:21 -0400 Subject: [PATCH] modesetting: Fix hang when all probed cursor sizes fail to find a minimum one This fixes a hang on simpledrm where min_cursor_height and min_cursor_width is never established, and drmmode_load_cursor_argb_check would infinitely when the minimum values where 0 or less. --- hw/xfree86/drivers/modesetting/drmmode_display.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.c b/hw/xfree86/drivers/modesetting/drmmode_display.c index 6942126c0..505960737 100644 --- a/hw/xfree86/drivers/modesetting/drmmode_display.c +++ b/hw/xfree86/drivers/modesetting/drmmode_display.c @@ -4377,6 +4377,9 @@ static void drmmode_probe_cursor_size(xf86CrtcPtr crtc) drmmode_ptr drmmode = drmmode_crtc->drmmode; int width, height, size; + ms->min_cursor_width = ms->max_cursor_width; + ms->min_cursor_height = ms->max_cursor_height; + /* probe square min first */ for (size = 1; size <= ms->max_cursor_width && size <= ms->max_cursor_height; size *= 2) {