[PATCH i-g-t v2 32/39] tests/chamelium/v3: Implement 4K EDID stress test
Louis Chauvet
louis.chauvet at bootlin.com
Tue Jul 9 15:34:48 UTC 2024
This commit introduces helper functions to utilize monitor EDIDs and
upload them to the Chamelium.
The existing EDID test has been enhanced to also test 4K screens. The
current EDID database includes entries for HDMI and DP ports.
Signed-off-by: Louis Chauvet <louis.chauvet at bootlin.com>
---
tests/chamelium/v3/kms_chamelium_v3_edid.c | 46 ++++++++++++++++++++++++++++++
1 file changed, 46 insertions(+)
diff --git a/tests/chamelium/v3/kms_chamelium_v3_edid.c b/tests/chamelium/v3/kms_chamelium_v3_edid.c
index b8d750ad771d..deef04d97bec 100644
--- a/tests/chamelium/v3/kms_chamelium_v3_edid.c
+++ b/tests/chamelium/v3/kms_chamelium_v3_edid.c
@@ -1,6 +1,8 @@
// SPDX-License-Identifier: MIT
#include <igt.h>
+
+#include "monitor_edids/monitor_edids_helper.h"
#include "chamelium/v3/igt_chamelium.h"
static void collect_and_compare_edid(int drm_fd,
@@ -52,6 +54,21 @@ static void igt_custom_edid_type_read(int drm_fd, struct igt_chamelium_v3 *chame
upload_and_read_edid(drm_fd, chamelium, port_mapping, igt_kms_get_custom_edid(edid));
}
+static void edid_stress_resolution(int drm_fd, struct igt_chamelium_v3 *chamelium,
+ struct chamelium_v3_port_mapping *port_mapping,
+ monitor_edid edids_list[],
+ size_t edids_list_len)
+{
+ for (int i = 0; i < edids_list_len; i++) {
+ struct edid *edid = edid_from_monitor_edid(&edids_list[i]);
+
+ igt_info("Testing out the EDID for %s\n",
+ monitor_edid_get_name(&edids_list[i]));
+ upload_and_read_edid(drm_fd, chamelium, port_mapping, edid);
+ free(edid);
+ }
+}
+
igt_main
{
struct igt_chamelium_v3 *chamelium;
@@ -88,6 +105,35 @@ igt_main
}
}
+ igt_describe("Read many different 4k EDID from the chamelium");
+ igt_subtest_with_dynamic("edid-stress-4k") {
+ struct chamelium_v3_port_mapping *port, *tmp;
+
+ igt_list_for_each_entry_safe(port, tmp, chamelium_v3_get_port_mapping(chamelium),
+ link) {
+ igt_dynamic_f("port-%d", port->port_id) {
+ drmModeConnectorPtr connector;
+ size_t edid_count = 0;
+ char *name;
+
+ igt_require(!chamelium_v3_is_mst(chamelium, port->port_id));
+
+ name = chamelium_v3_get_port_name(chamelium, port->port_id);
+ igt_info("Testing port %s (%s)\n", port->connector_name, name);
+ free(name);
+
+ connector = chamelium_v3_port_mapping_get_connector(port, drm_fd);
+ igt_assert(connector);
+ edid_stress_resolution(drm_fd, chamelium, port,
+ get_edids_for_connector_type(connector->connector_type,
+ &edid_count,
+ true),
+ edid_count);
+ drmModeFreeConnector(connector);
+ }
+ }
+ }
+
igt_fixture {
chamelium_v3_uninit(chamelium);
drm_close_driver(drm_fd);
--
2.44.2
More information about the igt-dev
mailing list