From: Dave Airlie Date: Wed, 9 Jan 2013 02:52:03 +0000 (+1000) Subject: xf86crtc: don't use scrn->display for gpu screens X-Git-Tag: xorg-server-1.14.99.2~97 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=16077b81c502e04d77f81f683e0c213b9fe75393;p=platform%2Fupstream%2Fxorg-server.git 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 Signed-off-by: Dave Airlie --- diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c index d64f6bd..4a490c6 100644 --- a/hw/xfree86/modes/xf86Crtc.c +++ b/hw/xfree86/modes/xf86Crtc.c @@ -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)