summaryrefslogtreecommitdiff
path: root/randr
diff options
context:
space:
mode:
authorDavid Sodman <dsodman@chromium.org>2014-02-10 09:07:33 -0800
committerKeith Packard <keithp@keithp.com>2014-02-24 16:33:35 -0800
commitcaf1dec2a76fbbd21259fe4cc809e24a55ff79b4 (patch)
tree5785a508d32efd06eb5cc5df084f1cb2d4121d8e /randr
parent249565a07d1d243e27440e2a5ecf4c95490903c6 (diff)
V2: Add check for link from output to crtc before optimizing out a CrtcSet call
The function RRCrtcSet call checks to see if the config being set is already configured, but, doesn't check that the selected outputs are connected to the crtc before skipping. This means that the following sequence will omit the final CrtcSet call to the driver: CRTC c1 connect to output o CRTC c2 connect to output o CRTC c1 connect to output o This change adds the check to ensure that each of the calls are made to the driver. Signed-off-by: David Sodman <dsodman@chromium.org> Reviewed-by: Stéphane Marchesin <marcheu@chromium.org> Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'randr')
-rw-r--r--randr/rrcrtc.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/randr/rrcrtc.c b/randr/rrcrtc.c
index 6e181ba2c..6da698ea0 100644
--- a/randr/rrcrtc.c
+++ b/randr/rrcrtc.c
@@ -522,9 +522,19 @@ RRCrtcSet(RRCrtcPtr crtc,
ScreenPtr pScreen = crtc->pScreen;
Bool ret = FALSE;
Bool recompute = TRUE;
+ Bool crtcChanged;
+ int o;
rrScrPriv(pScreen);
+ crtcChanged = FALSE;
+ for (o = 0; o < numOutputs; o++) {
+ if (outputs[o] && outputs[o]->crtc != crtc) {
+ crtcChanged = TRUE;
+ break;
+ }
+ }
+
/* See if nothing changed */
if (crtc->mode == mode &&
crtc->x == x &&
@@ -532,7 +542,8 @@ RRCrtcSet(RRCrtcPtr crtc,
crtc->rotation == rotation &&
crtc->numOutputs == numOutputs &&
!memcmp(crtc->outputs, outputs, numOutputs * sizeof(RROutputPtr)) &&
- !RRCrtcPendingProperties(crtc) && !RRCrtcPendingTransform(crtc)) {
+ !RRCrtcPendingProperties(crtc) && !RRCrtcPendingTransform(crtc) &&
+ !crtcChanged) {
recompute = FALSE;
ret = TRUE;
}
@@ -604,7 +615,6 @@ RRCrtcSet(RRCrtcPtr crtc,
#endif
}
if (ret) {
- int o;
RRTellChanged(pScreen);