[PATCH xserver 2/2] xfree86/modes: Don't set xf86_config->cursor if loading the cursor fails

Michel Dänzer michel at daenzer.net
Fri May 27 09:22:37 UTC 2016


From: Michel Dänzer <michel.daenzer at amd.com>

If xf86_load_cursor_argb returns FALSE, the caller is expected to fall
back to SW cursor, so xf86_config->cursor shouldn't be updated.

Signed-off-by: Michel Dänzer <michel.daenzer at amd.com>
---
 hw/xfree86/modes/xf86Cursors.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/hw/xfree86/modes/xf86Cursors.c b/hw/xfree86/modes/xf86Cursors.c
index cccfabf..feb09d5 100644
--- a/hw/xfree86/modes/xf86Cursors.c
+++ b/hw/xfree86/modes/xf86Cursors.c
@@ -591,7 +591,6 @@ xf86_load_cursor_argb(ScrnInfoPtr scrn, CursorPtr cursor)
     xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
     int c;
 
-    xf86_config->cursor = cursor;
     for (c = 0; c < xf86_config->num_crtc; c++) {
         xf86CrtcPtr crtc = xf86_config->crtc[c];
 
@@ -599,6 +598,9 @@ xf86_load_cursor_argb(ScrnInfoPtr scrn, CursorPtr cursor)
             if (!xf86_crtc_load_cursor_argb(crtc, cursor))
                 return FALSE;
     }
+
+    xf86_config->cursor = cursor;
+
     return TRUE;
 }
 
-- 
2.8.1



More information about the xorg-devel mailing list