modesetting: try and use hotspot cursor support
Signed-off-by: Dave Airlie <airlied@redhat.com>
This commit is contained in:
		
							parent
							
								
									4aab7aa7c1
								
							
						
					
					
						commit
						fac2bcf1da
					
				|  | @ -43,6 +43,8 @@ | ||||||
| #include "xf86Crtc.h" | #include "xf86Crtc.h" | ||||||
| #include "drmmode_display.h" | #include "drmmode_display.h" | ||||||
| 
 | 
 | ||||||
|  | #include <cursorstr.h> | ||||||
|  | 
 | ||||||
| /* DPMS */ | /* DPMS */ | ||||||
| #ifdef HAVE_XEXTPROTO_71 | #ifdef HAVE_XEXTPROTO_71 | ||||||
| #include <X11/extensions/dpmsconst.h> | #include <X11/extensions/dpmsconst.h> | ||||||
|  | @ -491,6 +493,18 @@ drmmode_show_cursor (xf86CrtcPtr crtc) | ||||||
| 	drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; | 	drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; | ||||||
| 	drmmode_ptr drmmode = drmmode_crtc->drmmode; | 	drmmode_ptr drmmode = drmmode_crtc->drmmode; | ||||||
| 	uint32_t handle = drmmode_crtc->cursor_bo->handle; | 	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, | 	drmModeSetCursor(drmmode->fd, drmmode_crtc->mode_crtc->crtc_id, handle, | ||||||
| 			 ms->cursor_width, ms->cursor_height); | 			 ms->cursor_width, ms->cursor_height); | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue