[igt-dev] [PATCH i-g-t] lib/drmtest: add support for STM drivers

Raphaël Gallais-Pou raphael.gallais-pou at foss.st.com
Wed Feb 23 08:45:53 UTC 2022


From: Raphael Gallais-Pou <raphael.gallais-pou at foss.st.com>

Since CRC feature is now supported on STM display drivers, IGT would be
an interesting solution for testing.

This patch adds basic support for IGT to run with STM drivers.

Signed-off-by: Raphael Gallais-Pou <raphael.gallais-pou at foss.st.com>
---
 lib/drmtest.c | 13 +++++++++++++
 lib/drmtest.h |  3 +++
 2 files changed, 16 insertions(+)

diff --git a/lib/drmtest.c b/lib/drmtest.c
index 09a9a229..e6886c1c 100644
--- a/lib/drmtest.c
+++ b/lib/drmtest.c
@@ -134,6 +134,11 @@ bool is_nouveau_device(int fd)
 #endif
 }
 
+bool is_stm_device(int fd)
+{
+	return __is_device(fd, "stm");
+}
+
 bool is_vc4_device(int fd)
 {
 	return __is_device(fd, "vc4");
@@ -186,6 +191,7 @@ static const struct module {
 	{ DRIVER_INTEL, "i915", modprobe_i915 },
 	{ DRIVER_MSM, "msm" },
 	{ DRIVER_PANFROST, "panfrost" },
+	{ DRIVER_STM, "stm32-display" },
 	{ DRIVER_V3D, "v3d" },
 	{ DRIVER_VC4, "vc4" },
 	{ DRIVER_VGEM, "vgem" },
@@ -547,6 +553,8 @@ static const char *chipset_to_str(int chipset)
 		return "panfrost";
 	case DRIVER_MSM:
 		return "msm";
+	case DRIVER_STM:
+		return "stm";
 	case DRIVER_ANY:
 		return "any";
 	default:
@@ -651,6 +659,11 @@ void igt_require_nouveau(int fd)
 	igt_require(is_nouveau_device(fd));
 }
 
+void igt_require_stm(int fd)
+{
+	igt_require(is_stm_device(fd));
+}
+
 void igt_require_vc4(int fd)
 {
 	igt_require(is_vc4_device(fd));
diff --git a/lib/drmtest.h b/lib/drmtest.h
index b5debd44..6a7ab082 100644
--- a/lib/drmtest.h
+++ b/lib/drmtest.h
@@ -51,6 +51,7 @@
 #define DRIVER_V3D	(1 << 4)
 #define DRIVER_PANFROST	(1 << 5)
 #define DRIVER_MSM	(1 << 6)
+#define DRIVER_STM	(1 << 7)
 
 /*
  * Exclude DRVER_VGEM from DRIVER_ANY since if you run on a system
@@ -99,6 +100,7 @@ int __drm_open_driver_render(int chipset);
 void igt_require_amdgpu(int fd);
 void igt_require_intel(int fd);
 void igt_require_nouveau(int fd);
+void igt_require_stm(int fd);
 void igt_require_vc4(int fd);
 
 bool is_amdgpu_device(int fd);
@@ -106,6 +108,7 @@ bool is_i915_device(int fd);
 bool is_mtk_device(int fd);
 bool is_msm_device(int fd);
 bool is_nouveau_device(int fd);
+bool is_stm_device(int fd);
 bool is_vc4_device(int fd);
 
 /**
-- 
2.25.1



More information about the igt-dev mailing list