From: "Zbigniew Kempczyński" <zbigniew.kempczynski@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: Petri Latvala <petri.latvala@intel.com>
Subject: [igt-dev] [PATCH i-g-t v3 17/52] tests/gem_eio: Adopt to use allocator
Date: Mon, 26 Jul 2021 21:59:51 +0200 [thread overview]
Message-ID: <20210726200026.4815-18-zbigniew.kempczynski@intel.com> (raw)
In-Reply-To: <20210726200026.4815-1-zbigniew.kempczynski@intel.com>
For newer gens we're not able to rely on relocations. Adopt to use
offsets acquired from the allocator.
Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
Cc: Petri Latvala <petri.latvala@intel.com>
Cc: Ashutosh Dixit <ashutosh.dixit@intel.com>
---
tests/i915/gem_eio.c | 60 +++++++++++++++++++++++++++++++-------------
1 file changed, 43 insertions(+), 17 deletions(-)
diff --git a/tests/i915/gem_eio.c b/tests/i915/gem_eio.c
index 76a15274e..d9ff1981a 100644
--- a/tests/i915/gem_eio.c
+++ b/tests/i915/gem_eio.c
@@ -174,10 +174,11 @@ static int __gem_wait(int fd, uint32_t handle, int64_t timeout)
return err;
}
-static igt_spin_t * __spin_poll(int fd, const intel_ctx_t *ctx,
- unsigned long flags)
+static igt_spin_t *__spin_poll(int fd, uint64_t ahnd, const intel_ctx_t *ctx,
+ unsigned long flags)
{
struct igt_spin_factory opts = {
+ .ahnd = ahnd,
.ctx = ctx,
.engine = flags,
.flags = IGT_SPIN_NO_PREEMPTION | IGT_SPIN_FENCE_OUT,
@@ -206,10 +207,10 @@ static void __spin_wait(int fd, igt_spin_t *spin)
}
}
-static igt_spin_t * spin_sync(int fd, const intel_ctx_t *ctx,
- unsigned long flags)
+static igt_spin_t *spin_sync(int fd, uint64_t ahnd, const intel_ctx_t *ctx,
+ unsigned long flags)
{
- igt_spin_t *spin = __spin_poll(fd, ctx, flags);
+ igt_spin_t *spin = __spin_poll(fd, ahnd, ctx, flags);
__spin_wait(fd, spin);
@@ -346,6 +347,7 @@ static void __test_banned(int fd)
igt_until_timeout(5) {
igt_spin_t *hang;
+ uint64_t ahnd;
if (__gem_execbuf(fd, &execbuf) == -EIO) {
uint32_t ctx = 0;
@@ -366,9 +368,11 @@ static void __test_banned(int fd)
}
/* Trigger a reset, making sure we are detected as guilty */
- hang = spin_sync(fd, intel_ctx_0(fd), 0);
+ ahnd = get_reloc_ahnd(fd, 0);
+ hang = spin_sync(fd, ahnd, intel_ctx_0(fd), 0);
trigger_reset(fd);
igt_spin_free(fd, hang);
+ put_ahnd(ahnd);
count++;
}
@@ -428,6 +432,7 @@ static void test_banned(int fd)
static void test_wait(int fd, unsigned int flags, unsigned int wait)
{
igt_spin_t *hang;
+ uint64_t ahnd;
fd = reopen_device(fd);
@@ -441,12 +446,14 @@ static void test_wait(int fd, unsigned int flags, unsigned int wait)
else
igt_require(i915_reset_control(fd, true));
- hang = spin_sync(fd, intel_ctx_0(fd), I915_EXEC_DEFAULT);
+ ahnd = get_reloc_ahnd(fd, 0);
+ hang = spin_sync(fd, ahnd, intel_ctx_0(fd), I915_EXEC_DEFAULT);
igt_debugfs_dump(fd, "i915_engine_info");
check_wait(fd, hang->handle, wait, NULL);
igt_spin_free(fd, hang);
+ put_ahnd(ahnd);
igt_require(i915_reset_control(fd, true));
@@ -490,8 +497,10 @@ static void test_inflight(int fd, unsigned int wait)
struct drm_i915_gem_exec_object2 obj[2];
struct drm_i915_gem_execbuffer2 execbuf;
igt_spin_t *hang;
+ uint64_t ahnd;
fd = reopen_device(parent_fd);
+ ahnd = get_reloc_ahnd(fd, 0);
memset(obj, 0, sizeof(obj));
obj[0].flags = EXEC_OBJECT_WRITE;
@@ -502,7 +511,7 @@ static void test_inflight(int fd, unsigned int wait)
igt_debug("Starting %s on engine '%s'\n", __func__, e->name);
igt_require(i915_reset_control(fd, false));
- hang = spin_sync(fd, intel_ctx_0(fd), eb_ring(e));
+ hang = spin_sync(fd, ahnd, intel_ctx_0(fd), eb_ring(e));
obj[0].handle = hang->handle;
memset(&execbuf, 0, sizeof(execbuf));
@@ -524,6 +533,7 @@ static void test_inflight(int fd, unsigned int wait)
close(fence[n]);
}
igt_spin_free(fd, hang);
+ put_ahnd(ahnd);
igt_assert(i915_reset_control(fd, true));
trigger_reset(fd);
@@ -541,6 +551,7 @@ static void test_inflight_suspend(int fd)
int fence[64]; /* mostly conservative estimate of ring size */
igt_spin_t *hang;
int max;
+ uint64_t ahnd;
/* Do a suspend first so that we don't skip inside the test */
igt_system_suspend_autoresume(SUSPEND_STATE_MEM, SUSPEND_TEST_DEVICES);
@@ -553,13 +564,14 @@ static void test_inflight_suspend(int fd)
fd = reopen_device(fd);
igt_require(gem_has_exec_fence(fd));
igt_require(i915_reset_control(fd, false));
+ ahnd = get_reloc_ahnd(fd, 0);
memset(obj, 0, sizeof(obj));
obj[0].flags = EXEC_OBJECT_WRITE;
obj[1].handle = gem_create(fd, 4096);
gem_write(fd, obj[1].handle, 0, &bbe, sizeof(bbe));
- hang = spin_sync(fd, intel_ctx_0(fd), 0);
+ hang = spin_sync(fd, ahnd, intel_ctx_0(fd), 0);
obj[0].handle = hang->handle;
memset(&execbuf, 0, sizeof(execbuf));
@@ -584,6 +596,7 @@ static void test_inflight_suspend(int fd)
close(fence[n]);
}
igt_spin_free(fd, hang);
+ put_ahnd(ahnd);
igt_assert(i915_reset_control(fd, true));
trigger_reset(fd);
@@ -624,6 +637,7 @@ static void test_inflight_contexts(int fd, unsigned int wait)
igt_spin_t *hang;
const intel_ctx_t *ctx[64];
int fence[64];
+ uint64_t ahnd;
fd = reopen_device(parent_fd);
@@ -640,7 +654,8 @@ static void test_inflight_contexts(int fd, unsigned int wait)
obj[1].handle = gem_create(fd, 4096);
gem_write(fd, obj[1].handle, 0, &bbe, sizeof(bbe));
- hang = spin_sync(fd, intel_ctx_0(fd), eb_ring(e));
+ ahnd = get_reloc_ahnd(fd, 0);
+ hang = spin_sync(fd, ahnd, intel_ctx_0(fd), eb_ring(e));
obj[0].handle = hang->handle;
memset(&execbuf, 0, sizeof(execbuf));
@@ -667,6 +682,7 @@ static void test_inflight_contexts(int fd, unsigned int wait)
}
igt_spin_free(fd, hang);
gem_close(fd, obj[1].handle);
+ put_ahnd(ahnd);
igt_assert(i915_reset_control(fd, true));
trigger_reset(fd);
@@ -685,6 +701,7 @@ static void test_inflight_external(int fd)
struct drm_i915_gem_exec_object2 obj;
igt_spin_t *hang;
uint32_t fence;
+ uint64_t ahnd;
IGT_CORK_FENCE(cork);
fd = reopen_device(fd);
@@ -694,7 +711,8 @@ static void test_inflight_external(int fd)
fence = igt_cork_plug(&cork, fd);
igt_require(i915_reset_control(fd, false));
- hang = __spin_poll(fd, intel_ctx_0(fd), 0);
+ ahnd = get_reloc_ahnd(fd, 0);
+ hang = __spin_poll(fd, ahnd, intel_ctx_0(fd), 0);
memset(&obj, 0, sizeof(obj));
obj.handle = gem_create(fd, 4096);
@@ -725,6 +743,7 @@ static void test_inflight_external(int fd)
close(fence);
igt_spin_free(fd, hang);
+ put_ahnd(ahnd);
igt_assert(i915_reset_control(fd, true));
trigger_reset(fd);
close(fd);
@@ -738,11 +757,13 @@ static void test_inflight_internal(int fd, unsigned int wait)
int fences[I915_EXEC_RING_MASK + 1];
unsigned nfence = 0;
igt_spin_t *hang;
+ uint64_t ahnd;
fd = reopen_device(fd);
igt_require(gem_has_exec_fence(fd));
igt_require(i915_reset_control(fd, false));
- hang = spin_sync(fd, intel_ctx_0(fd), 0);
+ ahnd = get_reloc_ahnd(fd, 0);
+ hang = spin_sync(fd, ahnd, intel_ctx_0(fd), 0);
memset(obj, 0, sizeof(obj));
obj[0].handle = hang->handle;
@@ -771,13 +792,14 @@ static void test_inflight_internal(int fd, unsigned int wait)
close(fences[nfence]);
}
igt_spin_free(fd, hang);
+ put_ahnd(ahnd);
igt_assert(i915_reset_control(fd, true));
trigger_reset(fd);
close(fd);
}
-static void reset_stress(int fd, const intel_ctx_t *ctx0,
+static void reset_stress(int fd, uint64_t ahnd, const intel_ctx_t *ctx0,
const char *name, unsigned int engine,
unsigned int flags)
{
@@ -815,7 +837,7 @@ static void reset_stress(int fd, const intel_ctx_t *ctx0,
* Start executing a spin batch with some queued batches
* against a different context after it.
*/
- hang = spin_sync(fd, ctx0, engine);
+ hang = spin_sync(fd, ahnd, ctx0, engine);
execbuf.rsvd1 = ctx->id;
for (i = 0; i < max; i++)
@@ -863,11 +885,13 @@ static void reset_stress(int fd, const intel_ctx_t *ctx0,
static void test_reset_stress(int fd, unsigned int flags)
{
const intel_ctx_t *ctx0 = context_create_safe(fd);
+ uint64_t ahnd = get_reloc_ahnd(fd, ctx0->id);
for_each_ring(e, fd)
- reset_stress(fd, ctx0, e->name, eb_ring(e), flags);
+ reset_stress(fd, ahnd, ctx0, e->name, eb_ring(e), flags);
intel_ctx_destroy(fd, ctx0);
+ put_ahnd(ahnd);
}
/*
@@ -928,13 +952,15 @@ static void test_kms(int i915, igt_display_t *dpy)
test_inflight(i915, 0);
if (gem_has_contexts(i915)) {
const intel_ctx_t *ctx = context_create_safe(i915);
+ uint64_t ahnd = get_reloc_ahnd(i915, ctx->id);
- reset_stress(i915, ctx,
+ reset_stress(i915, ahnd, ctx,
"default", I915_EXEC_DEFAULT, 0);
- reset_stress(i915, ctx,
+ reset_stress(i915, ahnd, ctx,
"default", I915_EXEC_DEFAULT, TEST_WEDGE);
intel_ctx_destroy(i915, ctx);
+ put_ahnd(ahnd);
}
*shared = 1;
--
2.26.0
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
next prev parent reply other threads:[~2021-07-26 20:01 UTC|newest]
Thread overview: 102+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-26 19:59 [igt-dev] [PATCH i-g-t v3 00/52] Add allocator support in IGT Zbigniew Kempczyński
2021-07-26 19:59 ` [igt-dev] [PATCH i-g-t v3 01/52] lib/igt_dummyload: Add support of using allocator in igt spinner Zbigniew Kempczyński
2021-08-03 23:07 ` Dixit, Ashutosh
2021-08-04 6:19 ` Zbigniew Kempczyński
2021-07-26 19:59 ` [igt-dev] [PATCH i-g-t v3 02/52] lib/intel_allocator: Add few helper functions for common use Zbigniew Kempczyński
2021-08-03 21:01 ` Dixit, Ashutosh
2021-08-04 0:18 ` Dixit, Ashutosh
2021-08-04 6:13 ` Zbigniew Kempczyński
2021-08-05 18:53 ` Dixit, Ashutosh
2021-08-06 1:15 ` Dixit, Ashutosh
2021-08-06 5:51 ` Zbigniew Kempczyński
2021-08-06 5:35 ` Zbigniew Kempczyński
2021-08-06 5:52 ` Dixit, Ashutosh
2021-07-26 19:59 ` [igt-dev] [PATCH i-g-t v3 03/52] lib/igt_gt: Add passing ahnd as an argument to igt_hang Zbigniew Kempczyński
2021-08-03 23:15 ` Dixit, Ashutosh
2021-07-26 19:59 ` [igt-dev] [PATCH i-g-t v3 04/52] lib/intel_batchbuffer: Ensure relocation code will be called Zbigniew Kempczyński
2021-08-03 23:34 ` Dixit, Ashutosh
2021-07-26 19:59 ` [igt-dev] [PATCH i-g-t v3 05/52] lib/intel_batchbuffer: Add allocator support in blitter fast copy Zbigniew Kempczyński
2021-07-26 19:59 ` [igt-dev] [PATCH i-g-t v3 06/52] lib/intel_batchbuffer: Add allocator support in blitter src copy Zbigniew Kempczyński
2021-08-04 23:26 ` Dixit, Ashutosh
2021-08-04 23:44 ` Dixit, Ashutosh
2021-08-05 8:50 ` Zbigniew Kempczyński
2021-08-05 7:28 ` Zbigniew Kempczyński
2021-08-05 19:47 ` Dixit, Ashutosh
2021-08-06 6:17 ` Zbigniew Kempczyński
2021-07-26 19:59 ` [igt-dev] [PATCH i-g-t v3 07/52] lib/intel_batchbuffer: Try to avoid relocations in blitting Zbigniew Kempczyński
2021-08-04 23:42 ` Dixit, Ashutosh
2021-08-05 7:34 ` Zbigniew Kempczyński
2021-07-26 19:59 ` [igt-dev] [PATCH i-g-t v3 08/52] lib/huc_copy: Extend huc copy prototype to pass allocator handle Zbigniew Kempczyński
2021-08-05 0:31 ` Dixit, Ashutosh
2021-08-05 7:44 ` Zbigniew Kempczyński
2021-07-26 19:59 ` [igt-dev] [PATCH i-g-t v3 09/52] tests/gem_bad_reloc: Skip on gens where relocations are not supported Zbigniew Kempczyński
2021-08-05 0:33 ` Dixit, Ashutosh
2021-08-05 7:46 ` Zbigniew Kempczyński
2021-07-26 19:59 ` [igt-dev] [PATCH i-g-t v3 10/52] tests/gem_busy: Adopt to use allocator Zbigniew Kempczyński
2021-08-05 2:07 ` Dixit, Ashutosh
2021-08-05 8:02 ` Zbigniew Kempczyński
2021-08-05 21:14 ` Dixit, Ashutosh
2021-08-06 6:56 ` Zbigniew Kempczyński
2021-08-05 8:14 ` Zbigniew Kempczyński
2021-07-26 19:59 ` [igt-dev] [PATCH i-g-t v3 11/52] tests/gem_create: " Zbigniew Kempczyński
2021-08-05 2:14 ` Dixit, Ashutosh
2021-07-26 19:59 ` [igt-dev] [PATCH i-g-t v3 12/52] tests/gem_ctx_engines: " Zbigniew Kempczyński
2021-08-05 2:40 ` Dixit, Ashutosh
2021-07-26 19:59 ` [igt-dev] [PATCH i-g-t v3 13/52] tests/gem_ctx_exec: " Zbigniew Kempczyński
2021-08-05 3:06 ` Dixit, Ashutosh
2021-08-05 8:46 ` Zbigniew Kempczyński
2021-07-26 19:59 ` [igt-dev] [PATCH i-g-t v3 14/52] tests/gem_ctx_freq: " Zbigniew Kempczyński
2021-08-05 6:07 ` Dixit, Ashutosh
2021-07-26 19:59 ` [igt-dev] [PATCH i-g-t v3 15/52] tests/gem_ctx_isolation: " Zbigniew Kempczyński
2021-07-26 19:59 ` [igt-dev] [PATCH i-g-t v3 16/52] tests/gem_ctx_param: " Zbigniew Kempczyński
2021-08-05 7:18 ` Dixit, Ashutosh
2021-08-05 10:19 ` Zbigniew Kempczyński
2021-07-26 19:59 ` Zbigniew Kempczyński [this message]
2021-08-05 21:44 ` [igt-dev] [PATCH i-g-t v3 17/52] tests/gem_eio: " Dixit, Ashutosh
2021-08-06 7:16 ` Zbigniew Kempczyński
2021-07-26 19:59 ` [igt-dev] [PATCH i-g-t v3 18/52] tests/gem_exec_async: " Zbigniew Kempczyński
2021-08-06 1:43 ` Dixit, Ashutosh
2021-08-06 7:33 ` Zbigniew Kempczyński
2021-07-26 19:59 ` [igt-dev] [PATCH i-g-t v3 19/52] tests/gem_exec_big: Require relocation support Zbigniew Kempczyński
2021-07-26 19:59 ` [igt-dev] [PATCH i-g-t v3 20/52] tests/gem_exec_capture: Support gens without relocations Zbigniew Kempczyński
2021-07-26 19:59 ` [igt-dev] [PATCH i-g-t v3 21/52] tests/gem_exec_gttfill: Require relocation support Zbigniew Kempczyński
2021-07-26 19:59 ` [igt-dev] [PATCH i-g-t v3 22/52] tests/gem_exec_store: Support gens without relocations Zbigniew Kempczyński
2021-07-26 19:59 ` [igt-dev] [PATCH i-g-t v3 23/52] tests/gem_exec_suspend: Adopt to use allocator Zbigniew Kempczyński
2021-08-06 2:15 ` Dixit, Ashutosh
2021-07-26 19:59 ` [igt-dev] [PATCH i-g-t v3 24/52] tests/gem_exec_parallel: Adopt to use alloctor Zbigniew Kempczyński
2021-08-06 4:39 ` Dixit, Ashutosh
2021-07-26 19:59 ` [igt-dev] [PATCH i-g-t v3 25/52] tests/gem_exec_params: Support gens without relocations Zbigniew Kempczyński
2021-07-26 20:00 ` [igt-dev] [PATCH i-g-t v3 26/52] tests/gem_mmap: Add allocator support Zbigniew Kempczyński
2021-07-26 20:00 ` [igt-dev] [PATCH i-g-t v3 27/52] tests/gem_mmap_gtt: " Zbigniew Kempczyński
2021-07-26 20:00 ` [igt-dev] [PATCH i-g-t v3 28/52] tests/gem_mmap_offset: " Zbigniew Kempczyński
2021-07-26 20:00 ` [igt-dev] [PATCH i-g-t v3 29/52] tests/gem_mmap_wc: Adopt to use allocator Zbigniew Kempczyński
2021-08-06 4:51 ` Dixit, Ashutosh
2021-07-26 20:00 ` [igt-dev] [PATCH i-g-t v3 30/52] tests/gem_request_retire: Add allocator support Zbigniew Kempczyński
2021-07-26 20:00 ` [igt-dev] [PATCH i-g-t v3 31/52] tests/gem_ringfill: Adopt to use allocator Zbigniew Kempczyński
2021-08-06 5:04 ` Dixit, Ashutosh
2021-07-26 20:00 ` [igt-dev] [PATCH i-g-t v3 32/52] tests/gem_softpin: Exercise eviction with softpinning Zbigniew Kempczyński
2021-07-26 20:00 ` [igt-dev] [PATCH i-g-t v3 33/52] tests/gem_spin_batch: Adopt to use allocator Zbigniew Kempczyński
2021-07-26 20:00 ` [igt-dev] [PATCH i-g-t v3 34/52] tests/gem_tiled_fence_blits: " Zbigniew Kempczyński
2021-07-26 20:00 ` [igt-dev] [PATCH i-g-t v3 35/52] tests/gem_unfence_active_buffers: " Zbigniew Kempczyński
2021-08-06 5:44 ` Dixit, Ashutosh
2021-07-26 20:00 ` [igt-dev] [PATCH i-g-t v3 36/52] tests/gem_unref_active_buffers: " Zbigniew Kempczyński
2021-08-06 5:46 ` Dixit, Ashutosh
2021-07-26 20:00 ` [igt-dev] [PATCH i-g-t v3 37/52] tests/gem_wait: " Zbigniew Kempczyński
2021-08-06 5:48 ` Dixit, Ashutosh
2021-07-26 20:00 ` [igt-dev] [PATCH i-g-t v3 38/52] tests/gem_watchdog: Adopt to use no-reloc Zbigniew Kempczyński
2021-07-26 20:00 ` [igt-dev] [PATCH i-g-t v3 39/52] tests/gem_workarounds: Adopt to use allocator Zbigniew Kempczyński
2021-07-26 20:00 ` [igt-dev] [PATCH i-g-t v3 40/52] tests/i915_hangman: " Zbigniew Kempczyński
2021-07-26 20:00 ` [igt-dev] [PATCH i-g-t v3 41/52] tests/i915_module_load: " Zbigniew Kempczyński
2021-07-26 20:00 ` [igt-dev] [PATCH i-g-t v3 42/52] tests/i915_pm_rc6_residency: " Zbigniew Kempczyński
2021-07-26 20:00 ` [igt-dev] [PATCH i-g-t v3 43/52] tests/i915_pm_rpm: Adopt to use no-reloc Zbigniew Kempczyński
2021-07-26 20:00 ` [igt-dev] [PATCH i-g-t v3 44/52] tests/i915_pm_rps: Alter " Zbigniew Kempczyński
2021-07-26 20:00 ` [igt-dev] [PATCH i-g-t v3 45/52] tests/kms_busy: Adopt to use allocator Zbigniew Kempczyński
2021-07-26 20:00 ` [igt-dev] [PATCH i-g-t v3 46/52] tests/kms_cursor_legacy: " Zbigniew Kempczyński
2021-07-26 20:00 ` [igt-dev] [PATCH i-g-t v3 47/52] tests/kms_flip: " Zbigniew Kempczyński
2021-07-26 20:00 ` [igt-dev] [PATCH i-g-t v3 48/52] tests/kms_vblank: " Zbigniew Kempczyński
2021-07-26 20:00 ` [igt-dev] [PATCH i-g-t v3 49/52] tests/perf_pmu: " Zbigniew Kempczyński
2021-07-26 20:00 ` [igt-dev] [PATCH i-g-t v3 50/52] tests/sysfs_heartbeat_interval: " Zbigniew Kempczyński
2021-07-26 20:00 ` [igt-dev] [PATCH i-g-t v3 51/52] tests/sysfs_preempt_timeout: " Zbigniew Kempczyński
2021-07-26 20:00 ` [igt-dev] [PATCH i-g-t v3 52/52] tests/sysfs_timeslice_duration: " Zbigniew Kempczyński
2021-07-26 21:33 ` [igt-dev] ✓ Fi.CI.BAT: success for Add allocator support in IGT (rev3) Patchwork
2021-07-27 2:14 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210726200026.4815-18-zbigniew.kempczynski@intel.com \
--to=zbigniew.kempczynski@intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=petri.latvala@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox