st/xorg: Add a customizer option to get rid of annoying cursor update flicker
authorThomas Hellstrom <thellstrom@vmware.com>
Tue, 12 Oct 2010 09:59:45 +0000 (11:59 +0200)
committerThomas Hellstrom <thellstrom@vmware.com>
Tue, 12 Oct 2010 13:09:05 +0000 (15:09 +0200)
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
src/gallium/state_trackers/xorg/xorg_crtc.c
src/gallium/state_trackers/xorg/xorg_driver.c
src/gallium/state_trackers/xorg/xorg_tracker.h

index 26a907f205e7f8bbed34bb02ff7dcd5931c20f3d..c65da71cdba6f6b4bba68be7ae234ac80c3397d5 100644 (file)
@@ -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:
index 835f06a73b18e5bdb12a096c46c5bb0fbacd3280..f7b3ad3505c0640b3c3f591714c4e9bddc8e5f0e 100644 (file)
@@ -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 */
index be1a9fda48d1f037655a05f9846d705903a6386a..a3fb5e5dad0551402147dbc218fd55d84f91ac60 100644 (file)
@@ -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);