From 5b424b562eee863b11571de4cd0019cd9bc5b379 Mon Sep 17 00:00:00 2001 From: Gustavo Pichorim Boiko Date: Mon, 23 Jul 2007 18:27:41 -0300 Subject: [PATCH] Set the crtc before the output change is notified Set the new randr crtc of the output before the output change notification is delivered to the clients. Remove RROutputSetCrtc as it is not really necessary. All we have to do is set the output's crtc on RRCrtcNotify --- hw/xfree86/modes/xf86RandR12.c | 1 - randr/randrstr.h | 5 ----- randr/rrcrtc.c | 2 ++ randr/rrinfo.c | 1 - randr/rroutput.c | 9 --------- 5 files changed, 2 insertions(+), 16 deletions(-) diff --git a/hw/xfree86/modes/xf86RandR12.c b/hw/xfree86/modes/xf86RandR12.c index 6c3bf8d09c..889be6f278 100644 --- a/hw/xfree86/modes/xf86RandR12.c +++ b/hw/xfree86/modes/xf86RandR12.c @@ -951,7 +951,6 @@ xf86RandR12SetInfo12 (ScreenPtr pScreen) return FALSE; } - RROutputSetCrtc (output->randr_output, randr_crtc); RROutputSetPhysicalSize(output->randr_output, output->mm_width, output->mm_height); diff --git a/randr/randrstr.h b/randr/randrstr.h index 4cc3a469e7..bd19fe9d00 100644 --- a/randr/randrstr.h +++ b/randr/randrstr.h @@ -694,9 +694,6 @@ RROutputSetCrtcs (RROutputPtr output, RRCrtcPtr *crtcs, int numCrtcs); -void -RROutputSetCrtc (RROutputPtr output, RRCrtcPtr crtc); - Bool RROutputSetConnection (RROutputPtr output, CARD8 connection); @@ -802,7 +799,6 @@ Query state: 1.2: RRScreenSetSizeRange RROutputSetCrtcs - RROutputSetCrtc RRModeGet RROutputSetModes RROutputSetConnection @@ -822,7 +818,6 @@ Query state: RRCrtcCreate RROutputCreate RROutputSetCrtcs - RROutputSetCrtc RROutputSetConnection RROutputSetSubpixelOrder RROldModeAdd • This adds modes one-at-a-time diff --git a/randr/rrcrtc.c b/randr/rrcrtc.c index 3ce9e21552..db5007e282 100644 --- a/randr/rrcrtc.c +++ b/randr/rrcrtc.c @@ -134,6 +134,7 @@ RRCrtcNotify (RRCrtcPtr crtc, break; if (j == crtc->numOutputs) { + outputs[i]->crtc = crtc; RROutputChanged (outputs[i], FALSE); RRCrtcChanged (crtc, FALSE); } @@ -149,6 +150,7 @@ RRCrtcNotify (RRCrtcPtr crtc, break; if (i == numOutputs) { + crtc->outputs[j]->crtc = NULL; RROutputChanged (crtc->outputs[j], FALSE); RRCrtcChanged (crtc, FALSE); } diff --git a/randr/rrinfo.c b/randr/rrinfo.c index 5ef1a6b838..858b1edfe5 100644 --- a/randr/rrinfo.c +++ b/randr/rrinfo.c @@ -98,7 +98,6 @@ RRScanOldConfig (ScreenPtr pScreen, Rotation rotations) if (!output) return; RROutputSetCrtcs (output, &crtc, 1); - RROutputSetCrtc (output, crtc); RROutputSetConnection (output, RR_Connected); #ifdef RENDER RROutputSetSubpixelOrder (output, PictureGetSubpixelOrder (pScreen)); diff --git a/randr/rroutput.c b/randr/rroutput.c index e001162832..1e1cfa5a97 100644 --- a/randr/rroutput.c +++ b/randr/rroutput.c @@ -286,15 +286,6 @@ RROutputSetCrtcs (RROutputPtr output, return TRUE; } -void -RROutputSetCrtc (RROutputPtr output, RRCrtcPtr crtc) -{ - if (output->crtc == crtc) - return; - output->crtc = crtc; - RROutputChanged (output, FALSE); -} - Bool RROutputSetConnection (RROutputPtr output, CARD8 connection)