Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Antonio Argenziano <antonio.argenziano@intel.com>
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH i-g-t] tests/gem_eio: Fix usage of gem_quiescent_gpu
Date: Thu, 14 Dec 2017 14:01:31 -0800	[thread overview]
Message-ID: <20171214220131.11884-1-antonio.argenziano@intel.com> (raw)

After change "lib: Ask the kernel to quiesce the GPU" was merged,
gem_quiescent_gpu() would not submit noop batches to all engines
therefore the test should submit the workload and use the library
function to wait for the workload to complete.

Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Antonio Argenziano <antonio.argenziano@intel.com>
---
 tests/gem_eio.c | 30 +++++++++++++++++++++++++++++-
 1 file changed, 29 insertions(+), 1 deletion(-)

diff --git a/tests/gem_eio.c b/tests/gem_eio.c
index 2ac9f0a9..868f2236 100644
--- a/tests/gem_eio.c
+++ b/tests/gem_eio.c
@@ -60,13 +60,41 @@ static bool i915_reset_control(bool enable)
 	return ret;
 }
 
+static void noop(int fd, unsigned flags)
+{
+	const uint32_t bbe = MI_BATCH_BUFFER_END;
+	struct drm_i915_gem_execbuffer2 eb;
+	struct drm_i915_gem_exec_object2 exec;
+
+	memset(&exec, 0, sizeof(exec));
+	exec.handle = gem_create(fd, 4096);
+	igt_assert((int)exec.handle > 0);
+	gem_write(fd, exec.handle, 0, &bbe, sizeof(bbe));
+
+	memset(&eb, 0, sizeof(eb));
+	eb.buffers_ptr = to_user_pointer(&exec);
+	eb.buffer_count = 1;
+	eb.flags = flags;
+
+	gem_execbuf(fd, &eb);
+}
+
+static void	noop_all_engines(int fd)
+{
+	unsigned engine;
+	for_each_engine(fd, engine)
+		noop(fd, engine);
+
+	gem_quiescent_gpu(fd);
+}
+
 static void trigger_reset(int fd)
 {
 	igt_force_gpu_reset(fd);
 
 	/* And just check the gpu is indeed running again */
 	igt_debug("Checking that the GPU recovered\n");
-	gem_quiescent_gpu(fd);
+	noop_all_engines(fd);
 }
 
 static void wedge_gpu(int fd)
-- 
2.14.2

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

             reply	other threads:[~2017-12-14 22:01 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-14 22:01 Antonio Argenziano [this message]
2017-12-14 22:45 ` [PATCH i-g-t] tests/gem_eio: Fix usage of gem_quiescent_gpu Chris Wilson
2017-12-14 23:00 ` ✓ Fi.CI.BAT: success for " Patchwork
2017-12-15  0:23 ` ✗ Fi.CI.IGT: failure " Patchwork

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=20171214220131.11884-1-antonio.argenziano@intel.com \
    --to=antonio.argenziano@intel.com \
    --cc=intel-gfx@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