Module: Mesa
Branch: 7.9
Commit: ee6417f97fdea8f41df7e7f8416c212868eb39b7
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=ee6417f97fdea8f41df7e7f8416c212868eb39b7

Author: Thomas Hellstrom <thellst...@vmware.com>
Date:   Tue Oct 12 11:59:45 2010 +0200

st/xorg: Add a customizer option to get rid of annoying cursor update flicker

Signed-off-by: Thomas Hellstrom <thellst...@vmware.com>

---

 src/gallium/state_trackers/xorg/xorg_crtc.c    |    8 ++++++++
 src/gallium/state_trackers/xorg/xorg_driver.c  |    4 +++-
 src/gallium/state_trackers/xorg/xorg_tracker.h |    1 +
 3 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/src/gallium/state_trackers/xorg/xorg_crtc.c 
b/src/gallium/state_trackers/xorg/xorg_crtc.c
index 26a907f..c65da71 100644
--- a/src/gallium/state_trackers/xorg/xorg_crtc.c
+++ b/src/gallium/state_trackers/xorg/xorg_crtc.c
@@ -234,6 +234,10 @@ crtc_load_cursor_argb_ga3d(xf86CrtcPtr crtc, CARD32 * 
image)
                   64, 64, (void*)image, 64 * 4, 0, 0);
     ms->ctx->transfer_unmap(ms->ctx, transfer);
     ms->ctx->transfer_destroy(ms->ctx, transfer);
+
+    if (crtc->cursor_shown)
+       drmModeSetCursor(ms->fd, crtcp->drm_crtc->crtc_id,
+                        crtcp->cursor_handle, 64, 64);
 }
 
 #if HAVE_LIBKMS
@@ -271,6 +275,10 @@ crtc_load_cursor_argb_kms(xf86CrtcPtr crtc, CARD32 * image)
     memcpy(ptr, image, 64*64*4);
     kms_bo_unmap(crtcp->cursor_bo);
 
+    if (crtc->cursor_shown)
+       drmModeSetCursor(ms->fd, crtcp->drm_crtc->crtc_id,
+                        crtcp->cursor_handle, 64, 64);
+
     return;
 
 err_bo_destroy:
diff --git a/src/gallium/state_trackers/xorg/xorg_driver.c 
b/src/gallium/state_trackers/xorg/xorg_driver.c
index 835f06a..f7b3ad3 100644
--- a/src/gallium/state_trackers/xorg/xorg_driver.c
+++ b/src/gallium/state_trackers/xorg/xorg_driver.c
@@ -791,7 +791,9 @@ drv_screen_init(int scrnIndex, ScreenPtr pScreen, int argc, 
char **argv)
     if (!ms->SWCursor)
        xf86_cursors_init(pScreen, 64, 64,
                          HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_64 |
-                         HARDWARE_CURSOR_ARGB);
+                         HARDWARE_CURSOR_ARGB |
+                         ((cust && cust->unhidden_hw_cursor_update) ?
+                          HARDWARE_CURSOR_UPDATE_UNHIDDEN : 0));
 
     /* Must force it before EnterVT, so we are in control of VT and
      * later memory should be bound when allocating, e.g rotate_mem */
diff --git a/src/gallium/state_trackers/xorg/xorg_tracker.h 
b/src/gallium/state_trackers/xorg/xorg_tracker.h
index be1a9fd..a3fb5e5 100644
--- a/src/gallium/state_trackers/xorg/xorg_tracker.h
+++ b/src/gallium/state_trackers/xorg/xorg_tracker.h
@@ -76,6 +76,7 @@ typedef struct _CustomizerRec
     Bool dirty_throttling;
     Bool swap_throttling;
     Bool no_3d;
+    Bool unhidden_hw_cursor_update;
     Bool (*winsys_pre_init) (struct _CustomizerRec *cust, int fd);
     Bool (*winsys_screen_init)(struct _CustomizerRec *cust);
     Bool (*winsys_screen_close)(struct _CustomizerRec *cust);

_______________________________________________
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to