[PATCH 1/3] present: Requery pending flips with the right sync_flip mode

Michel Dänzer michel at daenzer.net
Thu Nov 19 01:17:45 PST 2015


On 08.02.2015 18:47, Chris Wilson wrote:
> When verifying whether a pending flip is still valid, we need to pass
> down the orignal sync_flip mode (e.g. if the driver only supports sync
> flips, verifying a async flip will falsely fail).
> 
> Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
> ---
>  present/present.c      | 5 +++--
>  present/present_priv.h | 1 +
>  2 files changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/present/present.c b/present/present.c
> index 4a1cf0c..ce978f4 100644
> --- a/present/present.c
> +++ b/present/present.c
> @@ -453,6 +453,7 @@ present_flip_notify(present_vblank_ptr vblank, uint64_t ust, uint64_t crtc_msc)
>      screen_priv->flip_window = vblank->window;
>      screen_priv->flip_serial = vblank->serial;
>      screen_priv->flip_pixmap = vblank->pixmap;
> +    screen_priv->flip_sync = vblank->sync_flip;
>      screen_priv->flip_idle_fence = vblank->idle_fence;
>  
>      vblank->pixmap = NULL;
> @@ -541,14 +542,14 @@ present_check_flip_window (WindowPtr window)
>           * Check current flip
>           */
>          if (window == screen_priv->flip_window) {
> -            if (!present_check_flip(screen_priv->flip_crtc, window, screen_priv->flip_pixmap, FALSE, NULL, 0, 0))
> +            if (!present_check_flip(screen_priv->flip_crtc, window, screen_priv->flip_pixmap, screen_priv->flip_sync, NULL, 0, 0))
>                  present_unflip(screen);
>          }
>      }
>  
>      /* Now check any queued vblanks */
>      xorg_list_for_each_entry(vblank, &window_priv->vblank, window_list) {
> -        if (vblank->queued && vblank->flip && !present_check_flip(vblank->crtc, window, vblank->pixmap, FALSE, NULL, 0, 0))
> +        if (vblank->queued && vblank->flip && !present_check_flip(vblank->crtc, window, vblank->pixmap, vblank->sync_flip, NULL, 0, 0))
>              vblank->flip = FALSE;
>      }
>  }
> diff --git a/present/present_priv.h b/present/present_priv.h
> index f5c1652..110c925 100644
> --- a/present/present_priv.h
> +++ b/present/present_priv.h
> @@ -93,6 +93,7 @@ typedef struct present_screen_priv {
>      uint32_t                    flip_serial;
>      PixmapPtr                   flip_pixmap;
>      present_fence_ptr           flip_idle_fence;
> +    Bool                        flip_sync;
>  
>      present_screen_info_ptr     info;
>  } present_screen_priv_rec, *present_screen_priv_ptr;
> 

Reviewed-by: Michel Dänzer <michel.daenzer at amd.com>


-- 
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer


More information about the xorg-devel mailing list