From dce9d84ef797c9b56f2ae5403919fc392f590b01 Mon Sep 17 00:00:00 2001 From: Gustavo Pichorim Boiko Date: Thu, 2 Aug 2007 18:29:06 -0300 Subject: [PATCH] Make sure outputs get updated when getting info Make sure outputs get their crtcs updated by calling the proper CrtcNotify function. --- hw/xfree86/modes/xf86RandR12.c | 23 +++++++++++++++++++++++ 1 files changed, 23 insertions(+), 0 deletions(-) diff --git a/hw/xfree86/modes/xf86RandR12.c b/hw/xfree86/modes/xf86RandR12.c index 9d74e53..fa1daab 100644 --- a/hw/xfree86/modes/xf86RandR12.c +++ b/hw/xfree86/modes/xf86RandR12.c @@ -927,9 +927,13 @@ xf86RandR12SetInfo12 (ScreenPtr pScreen) int o, c, l; RRCrtcPtr randr_crtc; int nclone; + RRCrtcPtr *changed_crtcs; + int nchanged; clones = ALLOCATE_LOCAL(config->num_output * sizeof (RROutputPtr)); crtcs = ALLOCATE_LOCAL (config->num_crtc * sizeof (RRCrtcPtr)); + changed_crtcs = ALLOCATE_LOCAL(config->num_crtc * sizeof (RRCrtcPtr)); + nchanged = 0; for (o = 0; o < config->num_output; o++) { xf86OutputPtr output = config->output[o]; @@ -940,7 +944,17 @@ xf86RandR12SetInfo12 (ScreenPtr pScreen) crtcs[ncrtc++] = config->crtc[c]->randr_crtc; if (output->crtc) + { randr_crtc = output->crtc->randr_crtc; + /* + * mark the crtc of this output as changed + */ + for (c = 0; c < nchanged; c++) + if (changed_crtcs[c] == randr_crtc) + break; + if (c == nchanged) + changed_crtcs[nchanged++] = randr_crtc; + } else randr_crtc = NULL; @@ -988,8 +1002,17 @@ xf86RandR12SetInfo12 (ScreenPtr pScreen) return FALSE; } } + + /* + * notify the crtcs that have been changed + * in order to get output information updated + */ + for (c = 0; c < nchanged; c++) + xf86RandR12CrtcNotify(changed_crtcs[c]); + DEALLOCATE_LOCAL (crtcs); DEALLOCATE_LOCAL (clones); + DEALLOCATE_LOCAL (changed_crtcs); return TRUE; } -- 1.5.2.4