[PATCH 1/2] lib/amd: check output has hpd before trigger hotplug

Alex Hung alex.hung at amd.com
Thu Mar 21 02:03:53 UTC 2024


With commit ff1d9a601 writeback connector will be enabled and it has no
hotplug capability. As a result, this function always fails for such
cases. This is fixed by checking HDP in advance.

Signed-off-by: Alex Hung <alex.hung at amd.com>
---
 lib/igt_amd.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/lib/igt_amd.c b/lib/igt_amd.c
index d0b53c08a..623883dbc 100644
--- a/lib/igt_amd.c
+++ b/lib/igt_amd.c
@@ -799,6 +799,9 @@ int igt_amd_trigger_hotplug(int drm_fd, char *connector_name)
         int wr_len;
         const char *enable_hpd = "1";
 
+	if (!igt_amd_output_has_hpd(drm_fd, connector_name))
+		return 0;
+
         fd = igt_debugfs_connector_dir(drm_fd, connector_name, O_RDONLY);
         igt_assert(fd >= 0);
         hpd_fd = openat(fd, DEBUGFS_HPD_TRIGGER, O_WRONLY);
-- 
2.34.1



More information about the igt-dev mailing list