summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2012-07-05 20:34:54 +0100
committerDave Airlie <airlied@redhat.com>2012-07-06 22:17:42 +0100
commitee95ce979365d4383d8adc927547424eabc2ed64 (patch)
treeb803c07ac2cc554d31f64d8588e9ad2d79461503
parent4cbf6d2a0539e074eda99ccc35e4d2e273dafc04 (diff)
xf86: make sure rotate calcs are done on the right screen boundariesfor-keithp-output-slave
This fixes a segfault where this code believes we are outside the screen boundaries on a slave device, but we aren't. Reviewed-by: Keith Packard <keithp@keithp.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
-rw-r--r--hw/xfree86/modes/xf86Rotate.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/hw/xfree86/modes/xf86Rotate.c b/hw/xfree86/modes/xf86Rotate.c
index 31e03727e..a3937478f 100644
--- a/hw/xfree86/modes/xf86Rotate.c
+++ b/hw/xfree86/modes/xf86Rotate.c
@@ -322,6 +322,12 @@ xf86CrtcFitsScreen(xf86CrtcPtr crtc, struct pict_f_transform *crtc_to_fb)
/* When called before PreInit, the driver is
* presumably doing load detect
*/
+ if (pScrn->is_gpu) {
+ ScreenPtr pScreen = xf86ScrnToScreen(pScrn);
+ if (pScreen->current_master)
+ pScrn = xf86ScreenToScrn(pScreen->current_master);
+ }
+
if (pScrn->virtualX == 0 || pScrn->virtualY == 0)
return TRUE;