summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2008-12-15 19:53:45 -0800
committerKeith Packard <keithp@keithp.com>2008-12-15 19:58:20 -0800
commit063eb6743cd0d98dd52d1a9559b804381ee5144d (patch)
tree96323138c0369d3a4b939aa0db2421e4195c788a
parentfde2f961035609cfff8761ef1e0f23e6a9761be2 (diff)
Patch brown-bag fix for bug 19017 (scrn->virtualX/virtualY 0 before PreInit)
When a driver uses a crtc during device detection, the scrn has not yet been configured and virtualX/virtualY are still zero. This caused the X server to try and allocate a shadow frame buffer, which couldn't work. Detect this by checking for zero virtualX/virtualY values. Signed-off-by: Keith Packard <keithp@keithp.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 348b793d0..8e03c6c11 100644
--- a/hw/xfree86/modes/xf86Rotate.c
+++ b/hw/xfree86/modes/xf86Rotate.c
@@ -366,6 +366,12 @@ xf86CrtcFitsScreen (xf86CrtcPtr crtc, struct pict_f_transform *crtc_to_fb)
ScrnInfoPtr pScrn = crtc->scrn;
BoxRec b;
+ /* When called before PreInit, the driver is
+ * presumably doing load detect
+ */
+ if (pScrn->virtualX == 0 || pScrn->virtualY == 0)
+ return TRUE;
+
b.x1 = 0;
b.y1 = 0;
b.x2 = crtc->mode.HDisplay;