[i-g-t v2 11/12] tests/kms_vblank: Adopt to use allocator

Bhanuprakash Modem bhanuprakash.modem at intel.com
Mon Jun 28 12:44:31 UTC 2021


For newer gens kernel will reject relocations returning -EINVAL
so we should just provide the allocator handle to inject the hang.

Signed-off-by: Bhanuprakash Modem <bhanuprakash.modem at intel.com>
---
 tests/kms_vblank.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/tests/kms_vblank.c b/tests/kms_vblank.c
index 93b01eba02..b7754af379 100644
--- a/tests/kms_vblank.c
+++ b/tests/kms_vblank.c
@@ -118,6 +118,10 @@ static void run_test(data_t *data, void (*testfunc)(data_t *, int, int))
 	igt_output_t *output = data->output;
 	int fd = display->drm_fd;
 	igt_hang_t hang;
+	uint64_t ahnd = 0;
+
+	if (is_i915_device(fd))
+		ahnd = get_reloc_ahnd(fd, 0);
 
 	prepare_crtc(data, fd, output);
 
@@ -129,7 +133,7 @@ static void run_test(data_t *data, void (*testfunc)(data_t *, int, int))
 		 igt_output_name(output));
 
 	if (!(data->flags & NOHANG))
-		hang = igt_hang_ring(fd, I915_EXEC_DEFAULT);
+		hang = igt_hang_ring_with_ahnd(fd, I915_EXEC_DEFAULT, ahnd);
 
 	if (data->flags & BUSY) {
 		union drm_wait_vblank vbl;
@@ -166,6 +170,9 @@ static void run_test(data_t *data, void (*testfunc)(data_t *, int, int))
 	igt_info("\n%s on pipe %s, connector %s: PASSED\n\n",
 		 igt_subtest_name(), kmstest_pipe_name(data->pipe), igt_output_name(output));
 
+	if (is_i915_device(fd))
+		put_ahnd(ahnd);
+
 	/* cleanup what prepare_crtc() has done */
 	cleanup_crtc(data, fd, output);
 }
-- 
2.20.1



More information about the Intel-gfx-trybot mailing list