[PATCH i-g-t v4 3/5] lib/monitor_edids: Add helper to print all available EDID names
Louis Chauvet
louis.chauvet at bootlin.com
Fri Jan 10 18:05:43 UTC 2025
During the chamelium v3 configuration, it may be required to know the list
of supported EDID names, so add an helper to print them.
Signed-off-by: Louis Chauvet <louis.chauvet at bootlin.com>
---
lib/monitor_edids/monitor_edids_helper.c | 17 +++++++++++++++++
lib/monitor_edids/monitor_edids_helper.h | 2 ++
2 files changed, 19 insertions(+)
diff --git a/lib/monitor_edids/monitor_edids_helper.c b/lib/monitor_edids/monitor_edids_helper.c
index 01feb34a5516916b615a741f773316159c38fccf..34ae6be9dd65e4e34777f9b929358eb7c86aeafc 100644
--- a/lib/monitor_edids/monitor_edids_helper.c
+++ b/lib/monitor_edids/monitor_edids_helper.c
@@ -200,3 +200,20 @@ 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 6d9e3fc89592229cac5122c9275fcf226465ab3e..7ae0fd40c041b5d37e09b3bd494c6c90cf12fe97 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.47.1
More information about the igt-dev
mailing list