summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2013-09-05 20:52:11 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2013-09-05 20:52:11 +0100
commitd9a48bd0a3cd3ca99b29a4038ea16a87771bfe31 (patch)
treebee15ece17c132b6fd4d5460727a61125156ab1d /tools
parentb57dfc53312d9d7f30bfe45af44036b4c3c03790 (diff)
intel-virtual-output: Just walk the list of clones attached to the display
Rather searching the entire array of all clones, just walk the presorted list from the display. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'tools')
-rw-r--r--tools/virtual.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/tools/virtual.c b/tools/virtual.c
index e8155b4b..23157d56 100644
--- a/tools/virtual.c
+++ b/tools/virtual.c
@@ -2620,12 +2620,11 @@ int main(int argc, char **argv)
XRRNotifyEvent *re = (XRRNotifyEvent *)&e;
if (re->subtype == RRNotify_OutputChange) {
XRROutputPropertyNotifyEvent *ro = (XRROutputPropertyNotifyEvent *)re;
- int j;
+ struct clone *clone;
- for (j = 0; j < ctx.nclone; j++) {
- if (ctx.clones[j].dst.display == &ctx.display[i] &&
- ctx.clones[j].dst.rr_output == ro->output)
- rr_update = ctx.clones[j].rr_update = 1;
+ for (clone = ctx.display[i].clone; clone; clone = clone->next) {
+ if (clone->dst.rr_output == ro->output)
+ rr_update = clone->rr_update = 1;
}
}
}