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

2016-05-27 Thread Michel Dänzer
From: Michel Dänzer 

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 
---
 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

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

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

2016-05-27 Thread Keith Packard
Michel Dänzer  writes:

> From: Michel Dänzer 
>
> 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.

It doesn't matter -- xf86_config->cursor is supposed to be a temporary
field until drivers are converted over to xf86CurrentCursor, which
doesn't care whether the cursor is HW or SW.

Nacked-by: Keith Packard 

-- 
-keith


signature.asc
Description: PGP signature
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel