summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Hellström <thomas.hellstrom@linux.intel.com>2021-09-06 16:18:58 +0200
committerMatthew Auld <matthew.auld@intel.com>2021-09-08 09:27:21 +0100
commit3a6585c472dff11ece952b745244f05e4c93ede5 (patch)
treed3d684110c4f9cedb99c5de051bbcf50039e5bed
parent831085fb82f5b34e17f398a0af8eaa8c509e0fad (diff)
test/gem_exec_suspend: Enable the test for discrete GPUs
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>
-rw-r--r--tests/i915/gem_exec_suspend.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/tests/i915/gem_exec_suspend.c b/tests/i915/gem_exec_suspend.c
index dbe0c8a71..887bb7357 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;