summaryrefslogtreecommitdiff
path: root/hw/xfree86/modes/xf86Rotate.c
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2008-12-15 11:39:24 -0800
committerKeith Packard <keithp@keithp.com>2008-12-15 11:45:43 -0800
commitfde2f961035609cfff8761ef1e0f23e6a9761be2 (patch)
tree767dafa52fa86df801ba831aad03a6113ab28bd6 /hw/xfree86/modes/xf86Rotate.c
parent29a5b0596b396d3e4a8a014cacd3e3ef77467ab7 (diff)
Use scrn->virtualX/virtualY in xf86CrtcFitsScreen. Fix bug 19017.
pScreen->width/height are not initialized when doing initial mode setting, which makes this function incorrectly fail. Using scrn->virtualX should work in all cases though. Bug 19017 reports a crash in xf86CrtcSetModeTransform when doing a modeset for output probing, long before the screen array is initialized; that was caused by a work-around to set pScreen->width/height so that xf86CrtcFitsScreen could find the right values. Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'hw/xfree86/modes/xf86Rotate.c')
-rw-r--r--hw/xfree86/modes/xf86Rotate.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/hw/xfree86/modes/xf86Rotate.c b/hw/xfree86/modes/xf86Rotate.c
index 793b1a99b..348b793d0 100644
--- a/hw/xfree86/modes/xf86Rotate.c
+++ b/hw/xfree86/modes/xf86Rotate.c
@@ -364,12 +364,8 @@ static Bool
xf86CrtcFitsScreen (xf86CrtcPtr crtc, struct pict_f_transform *crtc_to_fb)
{
ScrnInfoPtr pScrn = crtc->scrn;
- /* if this is called during ScreenInit() we don't have pScrn->pScreen yet */
- ScreenPtr pScreen = screenInfo.screens[pScrn->scrnIndex];
BoxRec b;
- if (!pScreen)
- return TRUE;
b.x1 = 0;
b.y1 = 0;
b.x2 = crtc->mode.HDisplay;
@@ -383,8 +379,8 @@ xf86CrtcFitsScreen (xf86CrtcPtr crtc, struct pict_f_transform *crtc_to_fb)
b.y2 += crtc->y;
}
- return (0 <= b.x1 && b.x2 <= pScreen->width &&
- 0 <= b.y1 && b.y2 <= pScreen->height);
+ return (0 <= b.x1 && b.x2 <= pScrn->virtualX &&
+ 0 <= b.y1 && b.y2 <= pScrn->virtualY);
}
Bool