diff options
author | Ch Sai Gowtham <sai.gowtham.ch@intel.com> | 2021-07-20 15:28:23 +0530 |
---|---|---|
committer | Zbigniew Kempczyński <zbigniew.kempczynski@intel.com> | 2021-08-10 21:02:50 +0200 |
commit | 4d99547eafcdbb635892e162eb6638c2f28338e4 (patch) | |
tree | 6a21ae8322de42be76f0cc46bc7caa20844c5dcb /tests/i915/gem_mmap_gtt.c | |
parent | 32f370dbaf5bf26e2802bf7c1728cb1aacb72a92 (diff) |
tests/gem_mmap_gtt: Add allocator support
When relocations are not available tests must assign addresses to objects
by themselves instead of relying on the driver. We use allocator for
that purpose.
Signed-off-by: Ch Sai Gowtham <sai.gowtham.ch@intel.com>
Cc: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
Cc: Petri Latvala <petri.latvala@intel.com>
Cc: Ashutosh Dixit <ashutosh.dixit@intel.com>
Reviewed-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
Diffstat (limited to 'tests/i915/gem_mmap_gtt.c')
-rw-r--r-- | tests/i915/gem_mmap_gtt.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/tests/i915/gem_mmap_gtt.c b/tests/i915/gem_mmap_gtt.c index 60282699..92bbb5d2 100644 --- a/tests/i915/gem_mmap_gtt.c +++ b/tests/i915/gem_mmap_gtt.c @@ -335,10 +335,12 @@ test_pf_nonblock(int i915) { igt_spin_t *spin; uint32_t *ptr; + uint64_t ahnd; igt_require(mmap_gtt_version(i915) >= 3); - spin = igt_spin_new(i915); + ahnd = get_reloc_ahnd(i915, 0); + spin = igt_spin_new(i915, .ahnd = ahnd); igt_set_timeout(1, "initial pagefaulting did not complete within 1s"); @@ -349,6 +351,7 @@ test_pf_nonblock(int i915) igt_reset_timeout(); igt_spin_free(i915, spin); + put_ahnd(ahnd); } static void @@ -741,11 +744,13 @@ test_hang_busy(int i915) igt_spin_t *spin; igt_hang_t hang; uint32_t handle; + uint64_t ahnd; hang = igt_allow_hang(i915, ctx->id, 0); igt_require(igt_params_set(i915, "reset", "1")); /* global */ - spin = igt_spin_new(i915, .ctx = ctx, + ahnd = get_reloc_ahnd(i915, ctx->id); + spin = igt_spin_new(i915, .ctx = ctx, .ahnd = ahnd, .flags = IGT_SPIN_POLL_RUN | IGT_SPIN_FENCE_OUT | IGT_SPIN_NO_PREEMPTION); @@ -788,6 +793,7 @@ test_hang_busy(int i915) munmap(ptr, 4096); igt_spin_free(i915, spin); + put_ahnd(ahnd); igt_disallow_hang(i915, hang); intel_ctx_destroy(i915, ctx); } @@ -800,11 +806,13 @@ test_hang_user(int i915) igt_spin_t *spin; igt_hang_t hang; uint32_t handle; + uint64_t ahnd; hang = igt_allow_hang(i915, ctx->id, 0); igt_require(igt_params_set(i915, "reset", "1")); /* global */ - spin = igt_spin_new(i915, .ctx = ctx, + ahnd = get_reloc_ahnd(i915, ctx->id); + spin = igt_spin_new(i915, .ctx = ctx, .ahnd = ahnd, .flags = IGT_SPIN_POLL_RUN | IGT_SPIN_FENCE_OUT | IGT_SPIN_NO_PREEMPTION); @@ -843,6 +851,7 @@ test_hang_user(int i915) munmap(ptr, 4096); igt_spin_free(i915, spin); + put_ahnd(ahnd); igt_disallow_hang(i915, hang); intel_ctx_destroy(i915, ctx); } |