diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2014-06-25 07:31:33 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2014-06-25 07:31:33 +0100 |
commit | 204ec74a61ba0b9628c686b98c48fa1220866c2d (patch) | |
tree | d55aac76fd0e5d433acd6cff632b01102c15ad88 | |
parent | 43ad5dbc60e1f50a9cdcfc035bc271f1f28438c2 (diff) |
sna: Check all connectors for reuse
Do not rely on the MST path being present to indicate a connector that
may be reused.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=80355
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r-- | src/sna/sna_display.c | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c index d3983ec6..9c24ea68 100644 --- a/src/sna/sna_display.c +++ b/src/sna/sna_display.c @@ -3385,19 +3385,6 @@ sna_output_add(struct sna *sna, unsigned id, unsigned serial) goto skip; } - if (serial) { - for (i = 0; i < sna->mode.num_real_output; i++) { - output = config->output[i]; - if (strcmp(output->name, name) == 0) { - assert(output->scrn == scrn); - assert(output->funcs == &sna_output_funcs); - assert(to_sna_output(output)->id == 0); - sna_output_destroy(output); - goto reset; - } - } - } - str = xf86GetOptValString(sna->Options, OPTION_ZAPHOD); if (str && !sna_zaphod_match(str, name)) { DBG(("%s: zaphod mismatch, want %s, have %s\n", __FUNCTION__, str, name)); @@ -3408,6 +3395,20 @@ sna_output_add(struct sna *sna, unsigned id, unsigned serial) len = path; } + /* Check if we are dynamically reattaching an old connector */ + if (serial) { + for (i = 0; i < sna->mode.num_real_output; i++) { + output = config->output[i]; + if (strcmp(output->name, name) == 0) { + assert(output->scrn == scrn); + assert(output->funcs == &sna_output_funcs); + assert(to_sna_output(output)->id == 0); + sna_output_destroy(output); + goto reset; + } + } + } + output = calloc(1, sizeof(*output) + len + 1); if (!output) goto cleanup; |