linux/drivers/gpu/drm/display
Hans Verkuil 6daaae5ff7 gpu: drm_dp_cec: fix broken CEC adapter properties check
If the hotplug detect of a display is low for longer than one second
(configurable through drm_dp_cec_unregister_delay), then the CEC adapter
is unregistered since we assume the display was disconnected. If the
HPD went low for less than one second, then we check if the properties
of the CEC adapter have changed, since that indicates that we actually
switch to new hardware and we have to unregister the old CEC device and
register a new one.

Unfortunately, the test for changed properties was written poorly, and
after a new CEC capability was added to the CEC core code the test always
returned true (i.e. the properties had changed).

As a result the CEC device was unregistered and re-registered for every
HPD toggle. If the CEC remote controller integration was also enabled
(CONFIG_MEDIA_CEC_RC was set), then the corresponding input device was
also unregistered and re-registered. As a result the input device in
/sys would keep incrementing its number, e.g.:

/sys/devices/pci0000:00/0000:00:08.1/0000:e7:00.0/rc/rc0/input20

Since short HPD toggles are common, the number could over time get into
the thousands.

While not a serious issue (i.e. nothing crashes), it is not intended
to work that way.

This patch changes the test so that it only checks for the single CEC
capability that can actually change, and it ignores any other
capabilities, so this is now safe as well if new caps are added in
the future.

With the changed test the bit under #ifndef CONFIG_MEDIA_CEC_RC can be
dropped as well, so that's a nice cleanup.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Reported-by: Farblos <farblos@vodafonemail.de>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Fixes: 2c6d1fffa1 ("drm: add support for DisplayPort CEC-Tunneling-over-AUX")
Tested-by: Farblos <farblos@vodafonemail.de>
Link: https://patchwork.freedesktop.org/patch/msgid/361bb03d-1691-4e23-84da-0861ead5dbdc@xs4all.nl
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
2025-01-31 15:06:40 +02:00
..
Kconfig drm/display/hdmi: implement hotplug functions 2025-01-04 08:47:11 +02:00
Makefile drm/connector: implement generic HDMI audio helpers 2025-01-04 08:47:11 +02:00
drm_bridge_connector.c Linux 6.13 2025-01-23 14:42:21 +01:00
drm_display_helper_mod.c
drm_dp_aux_bus.c drm: display: Set fwnode for aux bus devices 2024-11-05 14:03:27 +01:00
drm_dp_aux_dev.c driver core: class: remove module * from class_create() 2023-03-17 15:16:33 +01:00
drm_dp_cec.c gpu: drm_dp_cec: fix broken CEC adapter properties check 2025-01-31 15:06:40 +02:00
drm_dp_dual_mode_helper.c drm/display: Fix building with GCC 15 2024-10-10 14:56:46 +03:00
drm_dp_helper.c drm/dp: extract drm_dp_dpcd_clear_payload() 2024-12-03 21:35:58 +02:00
drm_dp_helper_internal.h drm/display: Make DisplayPort AUX Chardev Kconfig name consistent 2024-03-28 11:26:46 +01:00
drm_dp_mst_topology.c drm/mst: remove mgr parameter and debug logging from drm_dp_get_vc_payload_bw() 2025-01-07 18:43:18 +02:00
drm_dp_mst_topology_internal.h drm/dp_mst: avoid includes in drm_dp_mst_topology_internal.h 2024-03-11 11:47:06 +02:00
drm_dp_tunnel.c drm/display: use ERR_PTR on DP tunnel manager creation fail 2024-12-13 18:57:34 +02:00
drm_dsc_helper.c drm/display/dsc: Add a helper to dump the DSC configuration 2024-07-03 18:05:12 +03:00
drm_hdcp_helper.c drm/sysfs: rename drm_sysfs_connector_status_event() 2023-06-23 15:54:00 +02:00
drm_hdmi_audio_helper.c drm/connector: implement generic HDMI audio helpers 2025-01-04 08:47:11 +02:00
drm_hdmi_helper.c drm/display: hdmi: Add HDMI compute clock helper 2024-05-28 10:12:25 +02:00
drm_hdmi_state_helper.c drm/display: hdmi: Do not read EDID on disconnected connectors 2025-01-14 18:53:33 +01:00
drm_scdc_helper.c drm/scdc-helper: Pimp SCDC debugs 2023-04-06 01:30:12 +03:00