[PATCH i-g-t v2 1/1] lib/igt_panel: Skip hdcp tests on unsupported panels
Santhosh Reddy Guddati
santhosh.reddy.guddati at intel.com
Mon May 26 12:38:21 UTC 2025
This introduces a mechanism to handle specific panels
like emulators/dummies that are known to face issues with certain
features like HDCP.
Tests are skipped for those outputs connected to prevent false negatives
and unnecessary debugging
V2: Refactor variable ,function names and fix coding style (Kamil)
Signed-off-by: Santhosh Reddy Guddati <santhosh.reddy.guddati at intel.com>
---
lib/igt_edid.c | 27 ++++++++++++++++++++++
lib/igt_edid.h | 1 +
lib/igt_panel.c | 61 +++++++++++++++++++++++++++++++++++++++++++++++++
lib/igt_panel.h | 15 ++++++++++++
lib/meson.build | 1 +
5 files changed, 105 insertions(+)
create mode 100644 lib/igt_panel.c
create mode 100644 lib/igt_panel.h
diff --git a/lib/igt_edid.c b/lib/igt_edid.c
index 80dcea112..627201c34 100644
--- a/lib/igt_edid.c
+++ b/lib/igt_edid.c
@@ -210,6 +210,33 @@ void edid_get_mfg(const struct edid *edid, char out[static 3])
out[2] = (edid->mfg_id[1] & 0x1F) + '@';
}
+void edid_get_monitor_name(const struct edid *edid, char *name, size_t name_size)
+{
+ const struct detailed_timing *dt;
+ const struct detailed_non_pixel *np;
+ const struct detailed_data_string *ds;
+ size_t i;
+
+ assert(name_size > 0);
+ name[0] = '\0';
+
+ for (i = 0; i < DETAILED_TIMINGS_LEN; i++) {
+ dt = &edid->detailed_timings[i];
+ np = &dt->data.other_data;
+
+ if (np->type != EDID_DETAIL_MONITOR_NAME)
+ continue;
+
+ ds = &np->data.string;
+ strncpy(name, ds->str, name_size - 1);
+ name[name_size - 1] = '\0';
+ igt_debug("Monitor name: %s\n", name);
+ return;
+ }
+ igt_debug("No monitor name found in EDID\n");
+ name[0] = '\0';
+}
+
static void edid_set_mfg(struct edid *edid, const char mfg[static 3])
{
edid->mfg_id[0] = (mfg[0] - '@') << 2 | (mfg[1] - '@') >> 3;
diff --git a/lib/igt_edid.h b/lib/igt_edid.h
index 02645345f..be0ccf529 100644
--- a/lib/igt_edid.h
+++ b/lib/igt_edid.h
@@ -456,5 +456,6 @@ void *dispid_block_tiled(void *ptr,
int htile, int vtile,
int hsize, int vsize,
const char *topology_id);
+void edid_get_monitor_name(const struct edid *edid, char *name, size_t name_size);
#endif
diff --git a/lib/igt_panel.c b/lib/igt_panel.c
new file mode 100644
index 000000000..ffe08f49e
--- /dev/null
+++ b/lib/igt_panel.c
@@ -0,0 +1,61 @@
+/* SPDX-License-Identifier: MIT */
+/*
+ * Copyright © 2025 Intel Corporation
+ */
+
+#include <stdbool.h>
+#include <string.h>
+
+#include "drmtest.h"
+#include "igt_panel.h"
+
+/**
+ * List of Panels that should be excluded from hdcp tests
+ *
+ * This array is used to identify and handle scenarios where the test is
+ * executed on dummy monitors, such as those found on shard machines.
+ * Since these dummy monitors are not real and always the test is not consistent,
+ * the test is skipped in such cases to avoid false negatives or
+ * irrelevant test results.
+ */
+static const char *const hdcp_blocklist[] = {
+ "DPF90435", /* Example monitor name */
+ /* Add more monitor names here as needed */
+};
+
+/**
+ * igt_is_panel_blocked - Checks if a given vendor name is present in a blocklist.
+ *
+ * @vendor_name: The name of the vendor to check for in the blocklist.
+ * @blocklist: An array of strings representing the blocklist.
+ * @blocklist_size: The number of entries in the blocklist array.
+ *
+ * Returns:
+ * true if the vendor name is found in the blocklist, false otherwise.
+ */
+static bool igt_is_panel_blocked(const char *vendor_name,
+ const char *const blocklist[],
+ size_t blocklist_size)
+{
+ int i;
+
+ for (i = 0; i < blocklist_size; i++) {
+ if (strstr(blocklist[i], vendor_name) != NULL)
+ return true;
+ }
+
+ return false;
+}
+
+/**
+ * igt_is_panel_blocked_hdcp - Checks if a panel vendor is blocklisted for HDCP.
+ * @vendor_name: The name of the panel vendor to check.
+ *
+ * Returns:
+ * true if the vendor is blocklisted for HDCP, false otherwise.
+ */
+bool igt_is_panel_blocked_hdcp(const char *vendor_name)
+{
+ return igt_is_panel_blocked(vendor_name, hdcp_blocklist,
+ ARRAY_SIZE(hdcp_blocklist));
+}
diff --git a/lib/igt_panel.h b/lib/igt_panel.h
new file mode 100644
index 000000000..79cdaf11c
--- /dev/null
+++ b/lib/igt_panel.h
@@ -0,0 +1,15 @@
+/* SPDX-License-Identifier: MIT */
+/*
+ * Copyright © 2025 Intel Corporation
+ */
+
+#ifndef IGT_PANEL_H
+#define IGT_PANEL_H
+
+#include <stdbool.h>
+#include <string.h>
+
+bool igt_is_panel_blocked_hdcp(const char *vendor_name);
+
+#endif
+
diff --git a/lib/meson.build b/lib/meson.build
index f54198051..139855f2e 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -94,6 +94,7 @@ lib_sources = [
'igt_draw.c',
'igt_list.c',
'igt_map.c',
+ 'igt_panel.c',
'igt_pm.c',
'igt_dummyload.c',
'igt_store.c',
--
2.34.1
More information about the igt-dev
mailing list