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-07 10:37:45 +0100
commita7c01da54ab43f9d29333ccbd79dfc001f9dc5e3 (patch)
tree3bbfe6db202ebe1c8bc3c0ac7566648378ae72f7
parentcc02f4ef3e407be794132d004c947c9a4e14f4c2 (diff)
xf86: make sure rotate calcs are done on the right screen boundaries
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;