xf86crtc: don't use scrn->display for gpu screens

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.

Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
This commit is contained in:
Dave Airlie 2013-01-09 12:52:03 +10:00
parent f0d0d75bfe
commit 16077b81c5

View File

@ -2449,11 +2449,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;
@ -2517,8 +2517,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];
@ -2566,7 +2568,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.
@ -2581,8 +2583,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)