diff options
author | Jason Ekstrand <jason@jlekstrand.net> | 2021-04-20 01:05:09 -0500 |
---|---|---|
committer | Jason Ekstrand <jason@jlekstrand.net> | 2021-07-08 12:45:33 -0500 |
commit | 67dd484b5a0f5c813c894e31487df7f1fdd5839b (patch) | |
tree | 575e05b3dd28b0f134cfabae5ec234ce4f8af7cb /tests/i915/gem_vm_create.c | |
parent | 045c6bca1473982da8dae01583796f9506b0d9bb (diff) |
tests/i915/gem_vm_create: Use intel_ctx_t in the execbuf test
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
Acked-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Diffstat (limited to 'tests/i915/gem_vm_create.c')
-rw-r--r-- | tests/i915/gem_vm_create.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/tests/i915/gem_vm_create.c b/tests/i915/gem_vm_create.c index 4b77920b..3005d347 100644 --- a/tests/i915/gem_vm_create.c +++ b/tests/i915/gem_vm_create.c @@ -220,9 +220,8 @@ static void execbuf(int i915) .buffers_ptr = to_user_pointer(&batch), .buffer_count = 1, }; - struct drm_i915_gem_context_param arg = { - .param = I915_CONTEXT_PARAM_VM, - }; + intel_ctx_cfg_t cfg = {}; + const intel_ctx_t *ctx; /* First verify that we try to use "softpinning" by default */ batch.offset = 48 << 20; @@ -230,20 +229,24 @@ static void execbuf(int i915) igt_assert_eq_u64(batch.offset, 48 << 20); gem_sync(i915, batch.handle); - arg.value = gem_vm_create(i915); - gem_context_set_param(i915, &arg); + cfg.vm = gem_vm_create(i915); + ctx = intel_ctx_create(i915, &cfg); + eb.rsvd1 = ctx->id; gem_execbuf(i915, &eb); igt_assert_eq_u64(batch.offset, 48 << 20); - gem_vm_destroy(i915, arg.value); + gem_vm_destroy(i915, cfg.vm); + intel_ctx_destroy(i915, ctx); gem_sync(i915, batch.handle); /* be idle! */ - arg.value = gem_vm_create(i915); - gem_context_set_param(i915, &arg); + cfg.vm = gem_vm_create(i915); + ctx = intel_ctx_create(i915, &cfg); batch.offset = 0; + eb.rsvd1 = ctx->id; gem_execbuf(i915, &eb); igt_assert_eq_u64(batch.offset, 0); - gem_vm_destroy(i915, arg.value); + gem_vm_destroy(i915, cfg.vm); + intel_ctx_destroy(i915, ctx); gem_sync(i915, batch.handle); gem_close(i915, batch.handle); |