Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Thomas Hellström" <thomas.hellstrom@linux.intel.com>
To: igt-dev@lists.freedesktop.org
Cc: maarten.lankhorst@linux.intel.com, matthew.auld@intel.com,
	"Thomas Hellström" <thomas.hellstrom@linux.intel.com>,
	"Petri Latvala" <petri.latvala@intel.com>
Subject: [igt-dev] [PATCH v2] test/gem_exec_suspend: Enable the test for discrete GPUs
Date: Mon,  6 Sep 2021 16:18:58 +0200	[thread overview]
Message-ID: <20210906141858.371710-1-thomas.hellstrom@linux.intel.com> (raw)

Discrete GPUs don't support gem_set_caching() and uses a single,
kernel provided caching mode, FIXED. Adjust the test accordingly.

This makes the test run on DG1.

v2:
- Use igt_require() do determine which of the caching mode subtests to
  run. (Petri Latvala)
- Pass the ctx parameter to igt_spin_new(), as it appears to be needed for
  the hang-SX subtests to run on DG1.

Cc: Petri Latvala <petri.latvala@intel.com>
Reviewed-by: Matthew Auld <matthew.auld@intel.com>
Signed-off-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>

Z# Untracked files:
---
 tests/i915/gem_exec_suspend.c | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

diff --git a/tests/i915/gem_exec_suspend.c b/tests/i915/gem_exec_suspend.c
index dbe0c8a7..887bb735 100644
--- a/tests/i915/gem_exec_suspend.c
+++ b/tests/i915/gem_exec_suspend.c
@@ -114,7 +114,8 @@ static void run_test(int fd, const intel_ctx_t *ctx,
 
 	memset(obj, 0, sizeof(obj));
 	obj[0].handle = gem_create(fd, 4096);
-	gem_set_caching(fd, obj[0].handle, !!(flags & CACHED));
+	if (!gem_has_lmem(fd))
+		gem_set_caching(fd, obj[0].handle, !!(flags & CACHED));
 	obj[0].flags |= EXEC_OBJECT_WRITE;
 	obj[1].handle = gem_create(fd, 4096);
 	gem_write(fd, obj[1].handle, 0, &bbe, sizeof(bbe));
@@ -178,7 +179,8 @@ static void run_test(int fd, const intel_ctx_t *ctx,
 	}
 
 	if (flags & HANG)
-		spin = igt_spin_new(fd, .ahnd = ahnd, .engine = engine);
+		spin = igt_spin_new(fd, .ahnd = ahnd, .engine = engine,
+			.ctx = ctx);
 
 	switch (mode(flags)) {
 	case NOSLEEP:
@@ -318,7 +320,18 @@ igt_main
 		run_test(fd, ctx, ALL_ENGINES, HIBERNATE);
 
 	for (m = modes; m->suffix; m++) {
+		igt_subtest_with_dynamic_f("fixed%s", m->suffix) {
+			igt_require(gem_has_lmem(fd));
+			for_each_ctx_engine(fd, ctx, e) {
+				if (!gem_class_can_store_dword(fd, e->class))
+					continue;
+				igt_dynamic_f("%s", e->name)
+					run_test(fd, ctx, e->flags, m->mode);
+			}
+		}
+
 		igt_subtest_with_dynamic_f("uncached%s", m->suffix) {
+			igt_require(!gem_has_lmem(fd));
 			for_each_ctx_engine(fd, ctx, e) {
 				if (!gem_class_can_store_dword(fd, e->class))
 					continue;
@@ -328,6 +341,7 @@ igt_main
 		}
 
 		igt_subtest_with_dynamic_f("cached%s", m->suffix) {
+			igt_require(!gem_has_lmem(fd));
 			for_each_ctx_engine(fd, ctx, e) {
 				if (!gem_class_can_store_dword(fd, e->class))
 					continue;
-- 
2.31.1

             reply	other threads:[~2021-09-06 14:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-06 14:18 Thomas Hellström [this message]
2021-09-06 15:07 ` [igt-dev] ✓ Fi.CI.BAT: success for test/gem_exec_suspend: Enable the test for discrete GPUs (rev2) Patchwork
2021-09-06 16:10 ` [igt-dev] ✓ Fi.CI.IGT: " 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=20210906141858.371710-1-thomas.hellstrom@linux.intel.com \
    --to=thomas.hellstrom@linux.intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=matthew.auld@intel.com \
    --cc=petri.latvala@intel.com \
    /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