[PATCH 2/3] present: Query the Window's CRTC every time

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


Keith, this is an important fix:

On 06.02.2015 17:25, Chris Wilson wrote:
> As the Window may flip between CRTC's between frames, we need to recheck
> which CRTC to use every frame or else attempt to flip on an invalid
> CRTC.

This description is slightly misleading, though: The old code also
called present_get_crtc() unless pixmap == NULL, so the problem couldn't
affect flips but only MSC waits.

The problem I was hitting was that this code was running for an MSC wait
when the CRTC referenced by window_priv->crtc was already disabled for
DPMS off. This caused hangs at the GNOME lock screen. This patch seems
to fix that problem.

So, I vote for applying this patch (possibly with a better commit log)
to master ASAP and backporting it to stable branches.

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


> ---
> present/present.c | 11 ++---------
>  1 file changed, 2 insertions(+), 9 deletions(-)
> 
> diff --git a/present/present.c b/present/present.c
> index 8c50664..1ce587e 100644
> --- a/present/present.c
> +++ b/present/present.c
> @@ -724,15 +724,8 @@ present_pixmap(WindowPtr window,
>  
>      if (!screen_priv || !screen_priv->info)
>          target_crtc = NULL;
> -    else if (!target_crtc) {
> -        /* Update the CRTC if we have a pixmap or we don't have a CRTC
> -         */
> -        if (!pixmap)
> -            target_crtc = window_priv->crtc;
> -
> -        if (!target_crtc || target_crtc == PresentCrtcNeverSet)
> -            target_crtc = present_get_crtc(window);
> -    }
> +    else if (!target_crtc)
> +	target_crtc = present_get_crtc(window);
>  
>      present_get_ust_msc(screen, target_crtc, &ust, &crtc_msc);
>  
> 


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


More information about the xorg-devel mailing list