Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Alan Previn <alan.previn.teres.alexis@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: Alan Previn <alan.previn.teres.alexis@intel.com>
Subject: [igt-dev] [PATCH] tests/i915/pxp: test_pxp_stale_buf_optout_execution requires arb session
Date: Tue,  7 Feb 2023 22:24:59 -0800	[thread overview]
Message-ID: <20230208062459.1113975-1-alan.previn.teres.alexis@intel.com> (raw)

Subtest 'test_pxp_stale_buf_optout_execution' when run on its own,
could be executing without the PXP Arb session being alive. This
would result in the termination trigger to fail (when writing to
the pxp termination debugfs).

Create a background protected context to start the Arb session so
the simulated termination will succeed.

Signed-off-by: Alan Previn <alan.previn.teres.alexis@intel.com>
---
 tests/i915/gem_pxp.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/tests/i915/gem_pxp.c b/tests/i915/gem_pxp.c
index 8c141ddd..5fbfe6b2 100644
--- a/tests/i915/gem_pxp.c
+++ b/tests/i915/gem_pxp.c
@@ -933,6 +933,25 @@ static void test_pxp_stale_buf_optout_execution(int i915)
 {
 	int ret;
 	struct simple_exec_assets data = {0};
+	struct simple_exec_assets data2 = {0};
+
+	/*
+	 * NOTE: this subtest creates a non-protected context
+	 * for submissions that uses a protected buffer. The UAPI
+	 * requirement dictates that gem_exec_buf will not fail
+	 * if a teardown occurs since the context was not protected,
+	 * despite the buffer being protected. However, the teardown
+	 * is simulated using the pxp termination debugfs which will
+	 * fail if PXP arb session is not active. Coincidentially
+	 * this will likely not happen when running all the subtests
+	 * together but if we execute this specific subtest on its own
+	 * and if the system has no display enabled, it will likely
+	 * not have active ARB session and thus the termination debugfs
+	 * will fail and cause an assertion. That said, we need to
+	 * create a background protected context (uninvolved with
+	 * the intent of the subtest) to ensure ARB session is alive.
+	 */
+	prepare_exec_assets(i915, &data2, true, true);
 
 	/*
 	 * Use a normal context for testing opt-out behavior
@@ -948,6 +967,7 @@ static void test_pxp_stale_buf_optout_execution(int i915)
 	igt_assert_f((ret == 0), "Opt-out-execution with stale pxp buffer didn't succeed\n");
 
 	free_exec_assets(i915, &data);
+	free_exec_assets(i915, &data2);
 }
 
 static void test_pxp_pwrcycle_staleasset_execution(int i915, struct powermgt_data *pm)
-- 
2.39.0

             reply	other threads:[~2023-02-08  6:25 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-08  6:24 Alan Previn [this message]
2023-02-08 17:47 ` [igt-dev] ✓ Fi.CI.BAT: success for tests/i915/pxp: test_pxp_stale_buf_optout_execution requires arb session Patchwork
2023-02-08 19:01 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2023-02-13 23:30 ` [igt-dev] [PATCH] " Ceraolo Spurio, Daniele
2023-02-14 16:45   ` Teres Alexis, Alan Previn

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=20230208062459.1113975-1-alan.previn.teres.alexis@intel.com \
    --to=alan.previn.teres.alexis@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    /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