summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2013-10-21 11:06:30 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2013-10-21 11:12:05 +0100
commit0b87b0c49a5208383e7472b58d36d3a558144496 (patch)
treed14e8ef4be4037059e0143b97d68bbd219572dcf
parent33be42bf509b6d57face6b8d99d72dd5f6c90900 (diff)
sna: Suppress log messages for unchanging EDID
Whenever we reprobe an unchanging output and re-read its EDID, we emit a useless log message. Previously this was squelched by trying to spot when an EDID was unchanged through the use of its blob.id, however we need to do a complete check on the contents in case the kernel returns us a new EDID with the old id. So make a temporary copy of the current EDID data and only squelch the log messages if the new EDID is an exact match. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/sna_display.c22
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);