[PATCH 1/3] present: Copy unflip contents back to the Screen Pixmap

Michel Dänzer michel at daenzer.net
Mon May 25 00:40:35 PDT 2015


Keith, this is also an important fix:

On 06.02.2015 17:25, Chris Wilson wrote:
> As we unflip after the flip Window no longer passes the pixel ownership
> test for the full Screen Pixmap, we can no longer utilize that Window to
> copy the contents back to the backing pixmap. To first flip means that
> the Window was originally backed by the Screen Pixmap and wholly covered
> the Pixmap, thus we need to copy the last frame contents to the Screen
> Pixmap when the flip chain is complete.
> 
> Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

Without this fix, one can momentarily see stale screen contents when
unflipping, e.g. when quitting a fullscreen app or switching from
fullscreen to windowed mode.

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


> ---
> present/present.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/present/present.c b/present/present.c
> index 38f24ba..8c50664 100644
> --- a/present/present.c
> +++ b/present/present.c
> @@ -409,20 +409,20 @@ static void
>  present_unflip(ScreenPtr screen)
>  {
>      present_screen_priv_ptr screen_priv = present_screen_priv(screen);
> +    PixmapPtr pixmap = (*screen->GetScreenPixmap)(screen);
>  
>      assert (!screen_priv->unflip_event_id);
>      assert (!screen_priv->flip_pending);
>  
>      if (screen_priv->flip_window)
> -        present_set_tree_pixmap(screen_priv->flip_window,
> -                                  (*screen->GetScreenPixmap)(screen));
> +        present_set_tree_pixmap(screen_priv->flip_window, pixmap);
>  
> -    present_set_tree_pixmap(screen->root, (*screen->GetScreenPixmap)(screen));
> +    present_set_tree_pixmap(screen->root, pixmap);
>  
>      /* Update the screen pixmap with the current flip pixmap contents
>       */
>      if (screen_priv->flip_pixmap && screen_priv->flip_window) {
> -        present_copy_region(&screen_priv->flip_window->drawable,
> +        present_copy_region(&pixmap->drawable,
>                              screen_priv->flip_pixmap,
>                              NULL, 0, 0);
>      }
> 


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



More information about the xorg-devel mailing list