[PATCH xserver] modesetting: Hide cursor when initializing crtc

Hans de Goede hdegoede at redhat.com
Wed Aug 31 11:55:14 UTC 2016


When Xorg gets started directly from a wayland-gdm the crtc still has the
wayland hw cursor set. Combine this with Xorg immediately falling back to
a sw cursor because a slave-output has a monitor attached at startup; and
we end up with the wayland hardware cursor overlay fixed in its last
position + the Xorg sw cursor resulting in 2 cursors.

This commit fixes this by hiding any left-over cursors when initializing
the crtc.

Signed-off-by: Hans de Goede <hdegoede at redhat.com>
---
 hw/xfree86/drivers/modesetting/drmmode_display.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.c b/hw/xfree86/drivers/modesetting/drmmode_display.c
index e9fce81..645d54c 100644
--- a/hw/xfree86/drivers/modesetting/drmmode_display.c
+++ b/hw/xfree86/drivers/modesetting/drmmode_display.c
@@ -1147,6 +1147,9 @@ drmmode_crtc_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, drmModeResPtr mode_res
     drmmode_crtc->vblank_pipe = drmmode_crtc_vblank_pipe(num);
     crtc->driver_private = drmmode_crtc;
 
+    /* Hide any cursors which me be active from previous users */
+    drmModeSetCursor(drmmode->fd, drmmode_crtc->mode_crtc->crtc_id, 0, 0, 0);
+
     /* Mark num'th crtc as in use on this device. */
     ms_ent->assigned_crtcs |= (1 << num);
     xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, MS_LOGLEVEL_DEBUG,
-- 
2.9.3



More information about the xorg-devel mailing list