summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2014-08-11 12:22:17 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2014-08-11 12:23:24 +0100
commit6554cf0a69f04710b64f3488384fe5cb2748dc35 (patch)
treece620f000a307ea50bfe66444787aa9264b17d71
parent8e1961e7fc163f3103b2260cca965aefa61fed40 (diff)
sna: Parse output options early during initialisation
Before we can query whether an option is set, we first need to generate the options table. This is done through xf86OutputUseScreenMonitor() so make sure it is called as early as possible in the proceedings. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/sna_display.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c
index 3d9724b1..7c20db4a 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -3670,12 +3670,22 @@ sna_output_add(struct sna *sna, unsigned id, unsigned serial)
goto cleanup;
}
+ output->scrn = scrn;
+ output->funcs = &sna_output_funcs;
+ output->name = (char *)(output + 1);
+ memcpy(output->name, name, len + 1);
+
+ output->use_screen_monitor = config->num_output != 1;
+ xf86OutputUseScreenMonitor(output, !output->use_screen_monitor);
+ assert(output->options);
+
DBG(("%s: inserting output #%d of %d\n", __FUNCTION__, sna->mode.num_real_output, config->num_output));
for (i = config->num_output; i > sna->mode.num_real_output; i--) {
outputs[i] = outputs[i-1];
assert(outputs[i]->driver_private == NULL);
outputs[i]->possible_clones <<= 1;
}
+
if (xf86ReturnOptValBool(output->options, OPTION_PRIMARY, FALSE)) {
memmove(outputs + 1, outputs, sizeof(output)*config->num_output);
outputs[0] = output;
@@ -3685,14 +3695,6 @@ sna_output_add(struct sna *sna, unsigned id, unsigned serial)
config->num_output++;
config->output = outputs;
- output->scrn = scrn;
- output->funcs = &sna_output_funcs;
- output->name = (char *)(output + 1);
- memcpy(output->name, name, len + 1);
-
- output->use_screen_monitor = config->num_output != 1;
- xf86OutputUseScreenMonitor(output, !output->use_screen_monitor);
-
reset:
sna_output->id = compat_conn.conn.connector_id;
sna_output->is_panel = is_panel(compat_conn.conn.connector_type);