[igt-dev] [PATCH i-g-t v4 2/3] tests/v3d_perfmon: Make sure v3d supports perfmon

Maíra Canal mcanal at igalia.com
Thu Jan 12 14:00:53 UTC 2023


Performance Monitors for the v3d were introduced in Linux 5.15, so a check
if v3d supports Performance Monitors is essential to assure that the tests
will perform correctly. Therefore, check if v3d has perfmon support before
running the tests.

Reviewed-by: Melissa Wen <mwen at igalia.com>
Signed-off-by: Maíra Canal <mcanal at igalia.com>
---
 tests/v3d/v3d_perfmon.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/tests/v3d/v3d_perfmon.c b/tests/v3d/v3d_perfmon.c
index bf983dbf..3f55ddb1 100644
--- a/tests/v3d/v3d_perfmon.c
+++ b/tests/v3d/v3d_perfmon.c
@@ -12,8 +12,10 @@ igt_main
 {
 	int fd;
 
-	igt_fixture
+	igt_fixture {
 		fd = drm_open_driver(DRIVER_V3D);
+		igt_require(igt_v3d_get_param(fd, DRM_V3D_PARAM_SUPPORTS_PERFMON));
+	}
 
 	igt_describe("Make sure a perfmon cannot be created with zero counters.");
 	igt_subtest("create-perfmon-0") {
-- 
2.39.0



More information about the igt-dev mailing list