[Mesa-dev] [PATCH] st/xorg: flush after loading the cursor

Michel Dänzer michel at daenzer.net
Sun May 1 23:57:25 PDT 2011


On Mon, 2011-05-02 at 00:01 +0200, Marcin Slusarz wrote: 
> We need cursor data to land in destination buffer before drmModeSetCursor.
> It fixes "cursor lag" at least on nv50.
> ---
>  src/gallium/state_trackers/xorg/xorg_crtc.c |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
> 
> diff --git a/src/gallium/state_trackers/xorg/xorg_crtc.c b/src/gallium/state_trackers/xorg/xorg_crtc.c
> index b8d9474..e8ca631 100644
> --- a/src/gallium/state_trackers/xorg/xorg_crtc.c
> +++ b/src/gallium/state_trackers/xorg/xorg_crtc.c
> @@ -247,6 +247,7 @@ 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);
> +    ms->ctx->flush(ms->ctx, NULL);
>  
>      if (crtc->cursor_shown)
>  	drmModeSetCursor(ms->fd, crtcp->drm_crtc->crtc_id,

To guarantee that the data lands before drmModeSetCursor, you'd have to
take a fence from the flush and finish that as well.


-- 
Earthling Michel Dänzer           |                http://www.vmware.com
Libre software enthusiast         |          Debian, X and DRI developer


More information about the mesa-dev mailing list