summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Simmons <jsimmons@infradead.org>2013-07-14 11:14:00 -0400
committerJames Simmons <jsimmons@infradead.org>2013-07-14 11:14:00 -0400
commitc41db44466d9fc856fab1c4207483230deda6031 (patch)
tree25e54df84100db3aff34d4a4e1f1771503a8ce77
parentf264f523ac80fc9eebec66945fe89243eabbf081 (diff)
With hotplug an output is enabled but its not attached to a crtc by default. When the display is issued a resize now when we encounter a disabled crtc a unbound ouput is then attached to it.
-rw-r--r--src/via_driver.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/via_driver.c b/src/via_driver.c
index 0f24ebe..b1b6e16 100644
--- a/src/via_driver.c
+++ b/src/via_driver.c
@@ -807,7 +807,7 @@ via_xf86crtc_resize(ScrnInfoPtr scrn, int width, int height)
{
xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
struct buffer_object *old_front = NULL, *new_front = NULL;
- int cpp = (scrn->bitsPerPixel + 7) >> 3, fd, i;
+ int cpp = (scrn->bitsPerPixel + 7) >> 3, fd, i, j;
int old_width, old_height, old_dwidth, format;
ScreenPtr screen = scrn->pScreen;
VIAPtr pVia = VIAPTR(scrn);
@@ -859,8 +859,18 @@ via_xf86crtc_resize(ScrnInfoPtr scrn, int width, int height)
drmmode_crtc_private_ptr drmmode_crtc;
drmmode_ptr drmmode;
- if (!xf86CrtcInUse(crtc) || !crtc->driver_private)
- continue;
+ if (!xf86CrtcInUse(crtc)) {
+ for (j = 0; j < xf86_config->num_output; j++) {
+ xf86OutputPtr output = xf86_config->output[j];
+
+ if (!output->crtc) {
+ output->crtc = crtc;
+ ret = TRUE;
+ }
+ }
+ if (!ret)
+ continue;
+ }
drmmode_crtc = crtc->driver_private;
drmmode = drmmode_crtc->drmmode;