drm/nouveau/kms: Don't change EDID when it hasn't actually changed
authorLyude Paul <lyude@redhat.com>
Wed, 26 Aug 2020 18:24:54 +0000 (14:24 -0400)
committerLyude Paul <lyude@redhat.com>
Mon, 31 Aug 2020 23:10:09 +0000 (19:10 -0400)
commitf28e32d3906eac2e1cb3291b448f0d528ec93996
treeabaef9a58157a3312e09b46557a5e84e1a43e624
parenta4efad354cf1b9d5275adc85f67fcaaa1c2912d8
drm/nouveau/kms: Don't change EDID when it hasn't actually changed

Currently in nouveau_connector_ddc_detect() and
nouveau_connector_detect_lvds(), we start the connector probing process
by releasing the previous EDID and informing DRM of the change. However,
since commit 5186421cbfe2 ("drm: Introduce epoch counter to
drm_connector") drm_connector_update_edid_property() actually checks
whether the new EDID we've specified is different from the previous one,
and updates the connector's epoch accordingly if it is. But, because we
always set the EDID to NULL first in nouveau_connector_ddc_detect() and
nouveau_connector_detect_lvds() we end up making DRM think that the EDID
changes every single time we do a connector probe - which isn't needed.

So, let's fix this by not clearing the EDID at the start of the
connector probing process, and instead simply changing or removing it
once near the end of the probing process. This will help prevent us from
sending unneeded hotplug events to userspace when nothing has actually
changed.

Signed-off-by: Lyude Paul <lyude@redhat.com>
Reviewed-by: Ben Skeggs <bskeggs@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200826182456.322681-19-lyude@redhat.com
drivers/gpu/drm/nouveau/nouveau_connector.c