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>
This commit is contained in:
Chris Wilson 2013-09-05 20:52:11 +01:00
parent b57dfc5331
commit d9a48bd0a3
1 changed files with 4 additions and 5 deletions

View File

@ -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;
}
}
}