From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg1-x52c.google.com (mail-pg1-x52c.google.com [IPv6:2607:f8b0:4864:20::52c]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8B7D089F99 for ; Mon, 14 Jun 2021 16:39:40 +0000 (UTC) Received: by mail-pg1-x52c.google.com with SMTP id q15so9075461pgg.12 for ; Mon, 14 Jun 2021 09:39:40 -0700 (PDT) From: Jason Ekstrand Date: Mon, 14 Jun 2021 11:38:56 -0500 Message-Id: <20210614163902.366168-22-jason@jlekstrand.net> In-Reply-To: <20210614163704.365989-1-jason@jlekstrand.net> References: <20210614163704.365989-1-jason@jlekstrand.net> MIME-Version: 1.0 Subject: [igt-dev] [PATCH i-g-t 71/77] tests/i915/gem_ctx_param: Stop setting VMs on old contexts List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: igt-dev-bounces@lists.freedesktop.org Sender: "igt-dev" To: igt-dev@lists.freedesktop.org List-ID: We can still test all the same basic functionality, we just have to re-create the context more often. Signed-off-by: Jason Ekstrand --- tests/i915/gem_ctx_param.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/i915/gem_ctx_param.c b/tests/i915/gem_ctx_param.c index c1b46a16c..54bf0cc96 100644 --- a/tests/i915/gem_ctx_param.c +++ b/tests/i915/gem_ctx_param.c @@ -162,6 +162,7 @@ static void test_vm(int i915) struct drm_i915_gem_context_param arg = { .param = I915_CONTEXT_PARAM_VM, }; + int err; uint32_t parent, child; igt_spin_t *spin; @@ -174,8 +175,11 @@ static void test_vm(int i915) * in the next context that shared the VM. */ + arg.ctx_id = gem_context_create(i915); arg.value = -1ull; - igt_require(__gem_context_set_param(i915, &arg) == -ENOENT); + err = __gem_context_set_param(i915, &arg); + gem_context_destroy(i915, arg.ctx_id); + igt_require(err == -ENOENT); parent = gem_context_create(i915); child = gem_context_create(i915); @@ -199,6 +203,7 @@ static void test_vm(int i915) batch.offset = 0; gem_execbuf(i915, &eb); igt_assert_eq_u64(batch.offset, 0); + gem_context_destroy(i915, child); eb.rsvd1 = parent; gem_execbuf(i915, &eb); @@ -206,14 +211,9 @@ static void test_vm(int i915) arg.ctx_id = parent; gem_context_get_param(i915, &arg); - gem_context_set_param(i915, &arg); - - /* Still the same VM, so expect the old VMA again */ - batch.offset = 0; - gem_execbuf(i915, &eb); - igt_assert_eq_u64(batch.offset, nonzero_offset); /* Note: changing an active ctx->vm may be verboten */ + child = gem_context_create(i915); arg.ctx_id = child; if (__gem_context_set_param(i915, &arg) != -EBUSY) { eb.rsvd1 = child; -- 2.31.1 _______________________________________________ igt-dev mailing list igt-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/igt-dev