diff options
author | Jason Ekstrand <jason@jlekstrand.net> | 2021-04-06 14:59:02 -0500 |
---|---|---|
committer | Jason Ekstrand <jason@jlekstrand.net> | 2021-07-08 12:45:33 -0500 |
commit | 99a807bd48d053c82fa0cdd5aebbe538ea27da58 (patch) | |
tree | 9d02309d751b51802e92e084bbb6f0910ba4d03d /tests/i915/gem_exec_gttfill.c | |
parent | ee5c3a9e5ca3daf86675e6c43f73836959b84417 (diff) |
tests/i915/gem_exec_gttfill: Convert to intel_ctx_t (v2)
v2 (Zbigniew Kempczyński):
- Don't NULL-init ctx
- Add intel_ctx_destroy()
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
Acked-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Diffstat (limited to 'tests/i915/gem_exec_gttfill.c')
-rw-r--r-- | tests/i915/gem_exec_gttfill.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/tests/i915/gem_exec_gttfill.c b/tests/i915/gem_exec_gttfill.c index e711576f..b8283eb8 100644 --- a/tests/i915/gem_exec_gttfill.c +++ b/tests/i915/gem_exec_gttfill.c @@ -106,7 +106,7 @@ static void submit(int fd, int gen, gem_sync(fd, obj.handle); } -static void fillgtt(int fd, unsigned ring, int timeout) +static void fillgtt(int fd, const intel_ctx_t *ctx, unsigned ring, int timeout) { const unsigned int gen = intel_gen(intel_get_drm_devid(fd)); struct drm_i915_gem_execbuffer2 execbuf; @@ -126,7 +126,7 @@ static void fillgtt(int fd, unsigned ring, int timeout) if (ring == ALL_ENGINES) { struct intel_execution_engine2 *e; - __for_each_physical_engine(fd, e) { + for_each_ctx_engine(fd, ctx, e) { if (!gem_class_can_store_dword(fd, e->class)) continue; @@ -155,6 +155,7 @@ static void fillgtt(int fd, unsigned ring, int timeout) execbuf.buffer_count = 1; if (gen < 6) execbuf.flags |= I915_EXEC_SECURE; + execbuf.rsvd1 = ctx->id; batches = calloc(count, sizeof(*batches)); igt_assert(batches); @@ -209,32 +210,35 @@ static void fillgtt(int fd, unsigned ring, int timeout) igt_main { const struct intel_execution_engine2 *e; + const intel_ctx_t *ctx; int i915 = -1; igt_fixture { i915 = drm_open_driver(DRIVER_INTEL); igt_require_gem(i915); + ctx = intel_ctx_create_all_physical(i915); igt_fork_hang_detector(i915); } igt_subtest("basic") /* just enough to run a single pass */ - fillgtt(i915, ALL_ENGINES, 1); + fillgtt(i915, ctx, ALL_ENGINES, 1); igt_subtest_with_dynamic("engines") { - __for_each_physical_engine(i915, e) { + for_each_ctx_engine(i915, ctx, e) { if (!gem_class_can_store_dword(i915, e->class)) continue; igt_dynamic_f("%s", e->name) - fillgtt(i915, e->flags, 20); + fillgtt(i915, ctx, e->flags, 20); } } igt_subtest("all") - fillgtt(i915, ALL_ENGINES, 20); + fillgtt(i915, ctx, ALL_ENGINES, 20); igt_fixture { igt_stop_hang_detector(); + intel_ctx_destroy(i915, ctx); close(i915); } } |