[PATCH xserver] randr: Use RRTransformEqual in RRCrtcPendingTransform

Michel Dänzer michel at daenzer.net
Fri Jun 16 02:24:54 UTC 2017


On 16/06/17 06:28 AM, Aaron Plattner wrote:
> Currently, RRCrtcPendingTransform returns false unless the
> transformation matrix itself is changing. This makes RRCrtcSet skip
> doing anything if the only thing that is changing is the transform
> filter.
> 
> There's already a function for comparing RRTransformPtrs, so use that
> instead.
> 
> Tested by running
> 
>   xrandr --output DP-1 --mode 1920x1080 --rate 144 --scale 0.5x0.5 --filter nearest
> 
> follwed by
> 
>   xrandr --output DP-1 --mode 1920x1080 --rate 144 --scale 0.5x0.5 --filter bilinear
> 
> Signed-off-by: Aaron Plattner <aplattner at nvidia.com>
> ---
>  randr/rrcrtc.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/randr/rrcrtc.c b/randr/rrcrtc.c
> index d1a51f0aa341..401a1c178b64 100644
> --- a/randr/rrcrtc.c
> +++ b/randr/rrcrtc.c
> @@ -843,9 +843,8 @@ RRCrtcGetTransform(RRCrtcPtr crtc)
>  Bool
>  RRCrtcPendingTransform(RRCrtcPtr crtc)
>  {
> -    return memcmp(&crtc->client_current_transform.transform,
> -                  &crtc->client_pending_transform.transform,
> -                  sizeof(PictTransform)) != 0;
> +    return !RRTransformEqual(&crtc->client_current_transform,
> +                             &crtc->client_pending_transform);
>  }
>  
>  /*
> 

Reviewed-and-Tested-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