summaryrefslogtreecommitdiff
path: root/hw/xfree86
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2016-09-06 11:50:50 +0200
committerHans de Goede <hdegoede@redhat.com>2016-09-13 10:27:07 +0200
commitf82fd47016628e8bcdcba3aab506a919fe8c49d8 (patch)
tree59687ed165092552c9e4999f6b6a9ae664dbf4e9 /hw/xfree86
parentb0b04cb266a62675dd7cde97111ebe7c1552db9a (diff)
xf86Cursor: Fix xf86_crtc_rotate_coord using width/height wrongly
xf86_crtc_rotate_coord should be the exact inverse operation of xf86_crtc_rotate_coord_back, but when calculating x / y for 90 / 270 degrees rotation it was using height to calculate x / width to calculate y, instead of the otherway around. This was likely not noticed before since xf86_crtc_rotate_coord until now was only used with cursor_info->MaxWidth and cursor_info->MaxHeight, which are usally the same. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Diffstat (limited to 'hw/xfree86')
-rw-r--r--hw/xfree86/modes/xf86Cursors.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/hw/xfree86/modes/xf86Cursors.c b/hw/xfree86/modes/xf86Cursors.c
index d1e3302b0..c83653457 100644
--- a/hw/xfree86/modes/xf86Cursors.c
+++ b/hw/xfree86/modes/xf86Cursors.c
@@ -74,7 +74,7 @@ xf86_crtc_rotate_coord(Rotation rotation,
break;
case RR_Rotate_90:
t = x_dst;
- x_dst = height - y_dst - 1;
+ x_dst = width - y_dst - 1;
y_dst = t;
break;
case RR_Rotate_180:
@@ -84,7 +84,7 @@ xf86_crtc_rotate_coord(Rotation rotation,
case RR_Rotate_270:
t = x_dst;
x_dst = y_dst;
- y_dst = width - t - 1;
+ y_dst = height - t - 1;
break;
}
if (rotation & RR_Reflect_X)