From d9a48bd0a3cd3ca99b29a4038ea16a87771bfe31 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Thu, 5 Sep 2013 20:52:11 +0100 Subject: [PATCH] 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 --- tools/virtual.c | 9 ++++----- 1 file 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; } } }