From ee6417f97fdea8f41df7e7f8416c212868eb39b7 Mon Sep 17 00:00:00 2001 From: Thomas Hellstrom Date: Tue, 12 Oct 2010 11:59:45 +0200 Subject: [PATCH 06/20] st/xorg: Add a customizer option to get rid of annoying cursor update flicker Signed-off-by: Thomas Hellstrom --- 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); -- 1.7.3