diff options
-rw-r--r-- | src/sna/sna_display.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c index 6da56be8..a7957eb9 100644 --- a/src/sna/sna_display.c +++ b/src/sna/sna_display.c @@ -1951,7 +1951,7 @@ sna_output_attach_edid(xf86OutputPtr output) struct sna *sna = to_sna(output->scrn); struct sna_output *sna_output = output->driver_private; struct drm_mode_get_blob blob; - void *raw = NULL; + void *old, *raw = NULL; xf86MonPtr mon = NULL; if (sna_output->edid_idx == -1) @@ -1960,6 +1960,12 @@ sna_output_attach_edid(xf86OutputPtr output) raw = sna_output->edid_raw; blob.length = sna_output->edid_len; + if (blob.length && output->MonInfo) { + old = alloca(blob.length); + memcpy(old, raw, blob.length); + } else + old = NULL; + blob.blob_id = sna_output->prop_values[sna_output->edid_idx]; DBG(("%s: attaching EDID id=%d, current=%d\n", __FUNCTION__, blob.blob_id, sna_output->edid_blob_id)); @@ -1997,6 +2003,20 @@ sna_output_attach_edid(xf86OutputPtr output) goto done; } + if (old && + blob.length == sna_output->edid_len && + memcmp(old, raw, blob.length) == 0) { + assert(sna_output->edid_raw == raw); + sna_output->edid_blob_id = blob.blob_id; + RRChangeOutputProperty(output->randr_output, + MakeAtom("EDID", strlen("EDID"), TRUE), + XA_INTEGER, 8, PropModeReplace, + sna_output->edid_len, + sna_output->edid_raw, + FALSE, FALSE); + return; + } + skip_read: if (raw) { mon = xf86InterpretEDID(output->scrn->scrnIndex, raw); |