[PATCH xserver 1/3] modesetting: Hide cursor during DPMS

Keith Packard keithp at keithp.com
Wed Aug 2 10:42:11 UTC 2017


This makes sure the cursor doesn't appear on the output at some later
time, as when leased by an X client.

Signed-off-by: Keith Packard <keithp at keithp.com>
---
 hw/xfree86/drivers/modesetting/drmmode_display.c | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.c b/hw/xfree86/drivers/modesetting/drmmode_display.c
index b5a03256e..89e972538 100644
--- a/hw/xfree86/drivers/modesetting/drmmode_display.c
+++ b/hw/xfree86/drivers/modesetting/drmmode_display.c
@@ -54,6 +54,11 @@ static Bool drmmode_xf86crtc_resize(ScrnInfoPtr scrn, int width, int height);
 static PixmapPtr drmmode_create_pixmap_header(ScreenPtr pScreen, int width, int height,
                                               int depth, int bitsPerPixel, int devKind,
                                               void *pPixData);
+
+static Bool drmmode_set_cursor(xf86CrtcPtr crtc);
+
+static void drmmode_hide_cursor(xf86CrtcPtr crtc);
+
 static Bool
 drmmode_zaphod_string_matches(ScrnInfoPtr scrn, const char *s, char *output_name)
 {
@@ -494,6 +499,16 @@ drmmode_crtc_dpms(xf86CrtcPtr crtc, int mode)
 {
     drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private;
     drmmode_crtc->dpms_mode = mode;
+
+    if (mode == DPMSModeOn) {
+        if (drmmode_crtc->cursor_up)
+            drmmode_set_cursor(crtc);
+    } else {
+        if (drmmode_crtc->cursor_up) {
+            drmmode_hide_cursor(crtc);
+            drmmode_crtc->cursor_up = TRUE;
+        }
+    }
 }
 
 #ifdef GLAMOR_HAS_GBM
@@ -789,8 +804,6 @@ drmmode_set_cursor(xf86CrtcPtr crtc)
     return TRUE;
 }
 
-static void drmmode_hide_cursor(xf86CrtcPtr crtc);
-
 /*
  * The load_cursor_argb_check driver hook.
  *
-- 
2.11.0



More information about the xorg-devel mailing list