[PATCH xserver] present: Only call restore_screen_pixmap once from set_abort_flip

Hans de Goede hdegoede at redhat.com
Tue Jul 26 12:06:22 UTC 2016


Hi,

On 26-07-16 10:29, Michel Dänzer wrote:
> From: Michel Dänzer <michel.daenzer at amd.com>
>
> present_restore_screen_pixmap's work doesn't need to be done several
> times for the same pending flip.
>
> Fixes a crash if the X server quits while a flip is pending, in which
> case present_set_abort_flip may be called several times, including when
> screen->root is already cleared to NULL.
>
> Signed-off-by: Michel Dänzer <michel.daenzer at amd.com>

LGTM:

Reviewed-by: Hans de Goede <hdegoede at redhat.com>

Regards,

Hans




> ---
>  present/present.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/present/present.c b/present/present.c
> index 5210832..5fde846 100644
> --- a/present/present.c
> +++ b/present/present.c
> @@ -455,9 +455,10 @@ present_set_abort_flip(ScreenPtr screen)
>  {
>      present_screen_priv_ptr screen_priv = present_screen_priv(screen);
>
> -    present_restore_screen_pixmap(screen);
> -
> -    screen_priv->flip_pending->abort_flip = TRUE;
> +    if (!screen_priv->flip_pending->abort_flip) {
> +        present_restore_screen_pixmap(screen);
> +        screen_priv->flip_pending->abort_flip = TRUE;
> +    }
>  }
>
>  static void
>


More information about the xorg-devel mailing list