[PATCH 2/4] xf86crtc: don't use scrn->display for gpu screens
Dave Airlie
airlied at gmail.com
Mon Jan 7 17:31:54 PST 2013
From: Fedora X Ninjas <x at fedoraproject.org>
scrn->display is a property of the main screen really, and we don't
want to have the GPU screens use it for anything when picking modes
or a front buffer size.
This fixes a bug where when you plugged a display link device, it
would try and allocate a screen the same size as the current running
one (3360x1050 in this case), which was too big for the device. Avoid
doing this and just pick sizes based on whats plugged into this device.
Signed-off-by: Dave Airlie <airlied at redhat.com>
---
hw/xfree86/modes/xf86Crtc.c | 18 +++++++++++-------
1 file changed, 11 insertions(+), 7 deletions(-)
diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c
index 13251cf..77a0218 100644
--- a/hw/xfree86/modes/xf86Crtc.c
+++ b/hw/xfree86/modes/xf86Crtc.c
@@ -2366,11 +2366,11 @@ xf86InitialConfiguration(ScrnInfoPtr scrn, Bool canGrow)
config->debug_modes = xf86ReturnOptValBool(config->options,
OPTION_MODEDEBUG, FALSE);
- if (scrn->display->virtualX)
+ if (scrn->display->virtualX && !scrn->is_gpu)
width = scrn->display->virtualX;
else
width = config->maxWidth;
- if (scrn->display->virtualY)
+ if (scrn->display->virtualY && !scrn->is_gpu)
height = scrn->display->virtualY;
else
height = config->maxHeight;
@@ -2434,8 +2434,10 @@ xf86InitialConfiguration(ScrnInfoPtr scrn, Bool canGrow)
/* XXX override xf86 common frame computation code */
- scrn->display->frameX0 = 0;
- scrn->display->frameY0 = 0;
+ if (!scrn->is_gpu) {
+ scrn->display->frameX0 = 0;
+ scrn->display->frameY0 = 0;
+ }
for (c = 0; c < config->num_crtc; c++) {
xf86CrtcPtr crtc = config->crtc[c];
@@ -2483,7 +2485,7 @@ xf86InitialConfiguration(ScrnInfoPtr scrn, Bool canGrow)
}
}
- if (scrn->display->virtualX == 0) {
+ if (scrn->display->virtualX == 0 || scrn->is_gpu) {
/*
* Expand virtual size to cover the current config and potential mode
* switches, if the driver can't enlarge the screen later.
@@ -2498,8 +2500,10 @@ xf86InitialConfiguration(ScrnInfoPtr scrn, Bool canGrow)
}
}
- scrn->display->virtualX = width;
- scrn->display->virtualY = height;
+ if (!scrn->is_gpu) {
+ scrn->display->virtualX = width;
+ scrn->display->virtualY = height;
+ }
}
if (width > scrn->virtualX)
--
1.8.1
More information about the xorg-devel
mailing list