From a7c01da54ab43f9d29333ccbd79dfc001f9dc5e3 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Thu, 5 Jul 2012 20:34:54 +0100 Subject: [PATCH] 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 Reviewed-by: Adam Jackson Signed-off-by: Dave Airlie --- hw/xfree86/modes/xf86Rotate.c | 6 ++++++ 1 file changed, 6 insertions(+) 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;