diff mbox

[3/3] uxa: Fix load_cursor_argb for the new Xorg ABI.

Message ID 1397082263-21043-3-git-send-email-eric@anholt.net (mailing list archive)
State New, archived
Headers show

Commit Message

Eric Anholt April 9, 2014, 10:24 p.m. UTC
Returning an undefined value meant we might get sw cursors.
---
 src/uxa/intel_display.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
diff mbox

Patch

diff --git a/src/uxa/intel_display.c b/src/uxa/intel_display.c
index 39d8507..23eb2c7 100644
--- a/src/uxa/intel_display.c
+++ b/src/uxa/intel_display.c
@@ -606,6 +606,21 @@  intel_crtc_set_cursor_position (xf86CrtcPtr crtc, int x, int y)
 	drmModeMoveCursor(mode->fd, crtc_id(intel_crtc), x, y);
 }
 
+#if XORG_VERSION_CURRENT >= XORG_VERSION_NUMERIC(1,15,99,902,0)
+static Bool
+intel_crtc_load_cursor_argb(xf86CrtcPtr crtc, CARD32 *image)
+{
+	struct intel_crtc *intel_crtc = crtc->driver_private;
+	int ret;
+
+	ret = dri_bo_subdata(intel_crtc->cursor, 0, 64*64*4, image);
+	if (ret)
+		xf86DrvMsg(crtc->scrn->scrnIndex, X_ERROR,
+			   "failed to set cursor: %s\n", strerror(-ret));
+
+	return !ret;
+}
+#else
 static void
 intel_crtc_load_cursor_argb(xf86CrtcPtr crtc, CARD32 *image)
 {
@@ -617,6 +632,7 @@  intel_crtc_load_cursor_argb(xf86CrtcPtr crtc, CARD32 *image)
 		xf86DrvMsg(crtc->scrn->scrnIndex, X_ERROR,
 			   "failed to set cursor: %s\n", strerror(-ret));
 }
+#endif
 
 static void
 intel_crtc_hide_cursor(xf86CrtcPtr crtc)