[igt-dev] [PATCH v2] tests/kms_flip: Skip detiler fences subtest on platforms w/o aperture

Imre Deak imre.deak at intel.com
Fri Apr 3 12:42:08 UTC 2020


On platforms w/o an aperture subtests using fences are not relevant, so
skip them. This also fixes a use-after-free error happening as a
side-effect of running the test on such platforms.

v2: Call igt_require() earlier to speed up runtime. (José)

Cc: José Roberto de Souza <jose.souza at intel.com>
Signed-off-by: Imre Deak <imre.deak at intel.com>
---
 tests/kms_flip.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/tests/kms_flip.c b/tests/kms_flip.c
index 9ce83c53d..254fef3ae 100755
--- a/tests/kms_flip.c
+++ b/tests/kms_flip.c
@@ -216,6 +216,7 @@ static void emit_fence_stress(struct test_output *o)
 
 	igt_require(bufmgr);
 
+	igt_assert(num_fences);
 	bo = calloc(sizeof(*bo), num_fences);
 	exec = calloc(sizeof(*exec), num_fences+1);
 	for (i = 0; i < num_fences - 1; i++) {
@@ -1339,6 +1340,8 @@ static int run_test(int duration, int flags)
 	int i, n, modes = 0;
 
 	igt_require((flags & TEST_HANG) == 0 || !is_wedged(drm_fd));
+	igt_require((flags & TEST_FENCE_STRESS) &&
+		    gem_available_fences(drm_fd));
 
 	resources = drmModeGetResources(drm_fd);
 	igt_require(resources);
@@ -1396,6 +1399,8 @@ static int run_pair(int duration, int flags)
 	int i, j, m, n, modes = 0;
 
 	igt_require((flags & TEST_HANG) == 0 || !is_wedged(drm_fd));
+	igt_require((flags & TEST_FENCE_STRESS) &&
+		    gem_available_fences(drm_fd));
 
 	resources = drmModeGetResources(drm_fd);
 	igt_require(resources);
-- 
2.23.1



More information about the igt-dev mailing list