Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0D7216E029 for ; Tue, 10 Aug 2021 10:54:23 +0000 (UTC) From: =?UTF-8?q?Zbigniew=20Kempczy=C5=84ski?= Date: Tue, 10 Aug 2021 12:53:17 +0200 Message-Id: <20210810105323.31375-49-zbigniew.kempczynski@intel.com> In-Reply-To: <20210810105323.31375-1-zbigniew.kempczynski@intel.com> References: <20210810105323.31375-1-zbigniew.kempczynski@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Subject: [igt-dev] [PATCH i-g-t v7 48/54] tests/kms_flip: Adopt to use allocator List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: igt-dev-bounces@lists.freedesktop.org Sender: "igt-dev" To: igt-dev@lists.freedesktop.org List-ID: From: Bhanuprakash Modem For newer gens kernel will reject relocations returning -EINVAL so we should just provide the allocator handle to inject the hang. V2: * Drop is_i915_device() check Signed-off-by: Bhanuprakash Modem Cc: Zbigniew Kempczyński Cc: Petri Latvala Cc: Ashutosh Dixit Reviewed-by: Zbigniew Kempczyński --- tests/kms_flip.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tests/kms_flip.c b/tests/kms_flip.c index f2fce8d2a..b4836a44d 100755 --- a/tests/kms_flip.c +++ b/tests/kms_flip.c @@ -616,9 +616,9 @@ static void recreate_fb(struct test_output *o) o->fb_info[o->current_fb_id].fb_id = new_fb_id; } -static igt_hang_t hang_gpu(int fd) +static igt_hang_t hang_gpu(int fd, uint64_t ahnd) { - return igt_hang_ring(fd, I915_EXEC_DEFAULT); + return igt_hang_ring_with_ahnd(fd, I915_EXEC_DEFAULT, ahnd); } static void unhang_gpu(int fd, igt_hang_t hang) @@ -675,6 +675,7 @@ static bool run_test_step(struct test_output *o, unsigned int *events) struct vblank_reply vbl_reply; unsigned int target_seq; igt_hang_t hang; + uint64_t ahnd = 0; target_seq = o->vblank_state.seq_step; /* Absolute waits only works once we have a frame counter. */ @@ -776,8 +777,10 @@ static bool run_test_step(struct test_output *o, unsigned int *events) igt_print_activity(); memset(&hang, 0, sizeof(hang)); - if (do_flip && (o->flags & TEST_HANG)) - hang = hang_gpu(drm_fd); + if (do_flip && (o->flags & TEST_HANG)) { + ahnd = get_reloc_ahnd(drm_fd, 0); + hang = hang_gpu(drm_fd, ahnd); + } /* try to make sure we can issue two flips during the same frame */ if (do_flip && (o->flags & TEST_EBUSY)) { @@ -847,6 +850,7 @@ static bool run_test_step(struct test_output *o, unsigned int *events) igt_assert(do_page_flip(o, new_fb_id, false) == expected_einval); unhang_gpu(drm_fd, hang); + put_ahnd(ahnd); *events = completed_events; -- 2.26.0