[PATCH i-g-t v7 16/48] lib/monitor_edids: Add helper to print all available EDID names

Louis Chauvet
2026-02-23T12:09:05Z

During the unigraf configuration, it may be required to know the list
of supported EDID names, so add an helper to print them.

Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Reviewed-by: Kory Maincent <kory.maincent@bootlin.com>
Signed-off-by: Louis Chauvet <louis.chauvet@bootlin.com>
---
lib/monitor_edids/monitor_edids_helper.c | 16 ++++++++++++++++
lib/monitor_edids/monitor_edids_helper.h | 2 ++
2 files changed, 18 insertions(+)

diff --git a/lib/monitor_edids/monitor_edids_helper.c b/lib/monitor_edids/monitor_edids_helper.c
index 34446066346e..091549ac7a49 100644
--- a/lib/monitor_edids/monitor_edids_helper.c
+++ b/lib/monitor_edids/monitor_edids_helper.c
@@ -200,3 +200,19 @@ struct edid *get_edid_by_name(const char *name)

return NULL;
}
+
+/*
+ * list_edid_names:
+ * @level: Log level to write the names on
+ *
+ * Print all the EDID available in igt.
+ */
+void list_edid_names(enum igt_log_level level)
+{
+ for (int i = 0; i < ARRAY_SIZE(ALL_EDIDS); i++) {
+ for (int j = 0; j < ALL_EDIDS[i].list_size; j++) {
+ igt_log(IGT_LOG_DOMAIN, level, " - \"%s\"\n",
+ ALL_EDIDS[i].edid_list[j].name);
+ }
+ }
+}
diff --git a/lib/monitor_edids/monitor_edids_helper.h b/lib/monitor_edids/monitor_edids_helper.h
index 6d9e3fc89592..7ae0fd40c041 100644
--- a/lib/monitor_edids/monitor_edids_helper.h
+++ b/lib/monitor_edids/monitor_edids_helper.h
@@ -15,6 +15,7 @@
#include <stddef.h>
#include <stdbool.h>

+#include "igt_core.h"
#include "igt_chamelium.h"

/* Max Length can be increased as needed, when new EDIDs are added. */
@@ -35,5 +36,6 @@ void free_chamelium_edid_from_monitor_edid(struct chamelium_edid *edid);
struct edid *edid_from_monitor_edid(const monitor_edid *monitor_edid);
struct monitor_edid *get_edids_for_connector_type(uint32_t type, size_t *count, bool four_k);
struct edid *get_edid_by_name(const char *name);
+void list_edid_names(enum igt_log_level level);

#endif /* TESTS_CHAMELIUM_MONITOR_EDIDS_MONITOR_EDIDS_HELPER_H_ */

--
2.52.0