If we walk the output lists in the same order as they are listed by
RandR, we are more likely to hit favourable priority sorting. E.g. the
user is likely to setup the outputs in the same order as listed, meaning
fewer CRTC transitions etc.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
return &ctx->display[ctx->ndisplay-1];
}
+static void reverse_clone_list(struct display *display)
+{
+ struct clone *list = NULL;
+
+ while (display->clone) {
+ struct clone *clone = display->clone;
+ display->clone = clone->next;
+ clone->next = list;
+ list = clone;
+ }
+
+ display->clone = list;
+}
+
static int last_display_add_clones__randr(struct context *ctx)
{
struct display *display = last_display(ctx);
XRRFreeOutputInfo(o);
}
XRRFreeScreenResources(res);
+
+ reverse_clone_list(display);
return 0;
}
ctx->active = clone;
}
XFree(xi);
+
+ reverse_clone_list(display);
return 0;
}