From fac2bcf1da09fba8bc8b22631e31f3c5b2737efd Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Mon, 20 Jan 2014 11:06:42 +1000 Subject: [PATCH] modesetting: try and use hotspot cursor support Signed-off-by: Dave Airlie --- hw/xfree86/drivers/modesetting/drmmode_display.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.c b/hw/xfree86/drivers/modesetting/drmmode_display.c index ccfd75fa6..5b796e0cd 100644 --- a/hw/xfree86/drivers/modesetting/drmmode_display.c +++ b/hw/xfree86/drivers/modesetting/drmmode_display.c @@ -43,6 +43,8 @@ #include "xf86Crtc.h" #include "drmmode_display.h" +#include + /* DPMS */ #ifdef HAVE_XEXTPROTO_71 #include @@ -491,6 +493,18 @@ drmmode_show_cursor (xf86CrtcPtr crtc) drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; drmmode_ptr drmmode = drmmode_crtc->drmmode; uint32_t handle = drmmode_crtc->cursor_bo->handle; + static Bool use_set_cursor2 = TRUE; + + if (use_set_cursor2) { + xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(crtc->scrn); + CursorPtr cursor = xf86_config->cursor; + int ret; + ret = drmModeSetCursor2(drmmode->fd, drmmode_crtc->mode_crtc->crtc_id, handle, ms->cursor_width, ms->cursor_height, cursor->bits->xhot, cursor->bits->yhot); + if (ret == -ENOSYS) + use_set_cursor2 = FALSE; + else + return; + } drmModeSetCursor(drmmode->fd, drmmode_crtc->mode_crtc->crtc_id, handle, ms->cursor_width, ms->cursor_height);