[PATCH xserver] randr: Fix crtc_bounds when using rotation combined with reflection

Michel Dänzer michel at daenzer.net
Tue Sep 13 00:49:02 UTC 2016


On 12/09/16 07:53 PM, Hans de Goede wrote:
> Before this commit crtc_bounds() did not take reflection into account,
> when using reflection with 0 / 180 degree rotation this was not an
> issue because of the default in the switch-case doing the right thing.
> 
> But when using 90 / 270 degree rotation we would also end up in the
> default which is wrong in this case. This would lead to the cursor
> being constrained to a height x height area of the monitor.
> 
> This commit masks out the reflection bits for the switch-case,
> making crtc_bounds return the correct bounds and fixing the
> problematic cursor constraining.
> 
> Signed-off-by: Hans de Goede <hdegoede at redhat.com>
> ---
>  randr/rrcrtc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/randr/rrcrtc.c b/randr/rrcrtc.c
> index 7636591..5d404e8 100644
> --- a/randr/rrcrtc.c
> +++ b/randr/rrcrtc.c
> @@ -281,7 +281,7 @@ crtc_bounds(RRCrtcPtr crtc, int *left, int *right, int *top, int *bottom)
>      *left = crtc->x;
>      *top = crtc->y;
>  
> -    switch (crtc->rotation) {
> +    switch (crtc->rotation & 0xf) {
>      case RR_Rotate_0:
>      case RR_Rotate_180:
>      default:
> 

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