Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [Patch V3] [i-g-t] tests/i915: test pass for no caching case
@ 2021-05-20  9:40 viswax.krishna.raveendra.talabattula
  2021-05-20 10:14 ` [igt-dev] ✓ Fi.CI.BAT: success for tests/i915: test pass for no caching case (rev2) Patchwork
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: viswax.krishna.raveendra.talabattula @ 2021-05-20  9:40 UTC (permalink / raw)
  To: igt-dev, tejaskumarx.surendrakumar.upadhyay, Mahesh.Meena

From: Viswa Krishna Raveendra Talabattula <viswax.krishna.raveendra.talabattula@intel.com>

The userptr memory does not support I915_CACHING_NONE(no caching) level
as per the below commit related to i915 in the kernel

commit 02b64a4a0cb14e414b0be3b7261edc4fabfc0e2c
Author: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Date:   Tue Mar 23 16:50:02 2021 +0100

	drm/i915: Reject more ioctls for userptr, v2.

So lets make test pass for return value of -ENXIO and 0
Print warning of "deprecated return code 0" for older kernels

Signed-off-by: Viswa Krishna Raveendra Talabattula <viswax.krishna.raveendra.talabattula@intel.com>
---
 tests/i915/gem_userptr_blits.c | 30 +++++++++++++++++++++++++-----
 1 file changed, 25 insertions(+), 5 deletions(-)

diff --git a/tests/i915/gem_userptr_blits.c b/tests/i915/gem_userptr_blits.c
index aad5f141..a90bcbfa 100644
--- a/tests/i915/gem_userptr_blits.c
+++ b/tests/i915/gem_userptr_blits.c
@@ -2032,15 +2032,35 @@ static void test_set_caching(int i915)
 
 	for (int idx = 0; idx < ARRAY_SIZE(levels); idx++) {
 		gem_userptr(i915, page, 4096, 0, 0, &handle);
-		igt_assert_eq(__gem_set_caching(i915, handle, levels[idx]), 0);
+		if (levels[idx] == I915_CACHING_CACHED)
+			igt_assert_eq(__gem_set_caching(i915, handle, levels[idx]), 0);
+		else
+			if (__gem_set_caching(i915, handle, levels[idx]) == 0)
+				igt_warn("Deprecated return code 0 from __gem_set_caching\n");
+			else
+				igt_assert_eq(__gem_set_caching(i915, handle, levels[idx]), -ENXIO);
 		gem_close(i915, handle);
 	}
 
 	gem_userptr(i915, page, 4096, 0, 0, &handle);
-	for (int idx = 0; idx < ARRAY_SIZE(levels); idx++)
-		igt_assert_eq(__gem_set_caching(i915, handle, levels[idx]), 0);
-	for (int idx = 0; idx < ARRAY_SIZE(levels); idx++)
-		igt_assert_eq(__gem_set_caching(i915, handle, levels[idx]), 0);
+	for (int idx = 0; idx < ARRAY_SIZE(levels); idx++) {
+		if (levels[idx] == I915_CACHING_CACHED)
+			igt_assert_eq(__gem_set_caching(i915, handle, levels[idx]), 0);
+		else
+			if (__gem_set_caching(i915, handle, levels[idx]) == 0)
+				igt_warn("Deprecated return code 0 from __gem_set_caching\n");
+			else
+				igt_assert_eq(__gem_set_caching(i915, handle, levels[idx]), -ENXIO);
+	}
+	for (int idx = 0; idx < ARRAY_SIZE(levels); idx++) {
+		if (levels[idx] == I915_CACHING_CACHED)
+			igt_assert_eq(__gem_set_caching(i915, handle, levels[idx]), 0);
+		else
+			if (__gem_set_caching(i915, handle, levels[idx]) == 0)
+				igt_warn("Deprecated return code 0 from __gem_set_caching\n");
+			else
+				igt_assert_eq(__gem_set_caching(i915, handle, levels[idx]), -ENXIO);
+	}
 	gem_close(i915, handle);
 
 	munmap(page, 4096);
-- 
2.30.0

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-05-21 15:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-05-20  9:40 [igt-dev] [Patch V3] [i-g-t] tests/i915: test pass for no caching case viswax.krishna.raveendra.talabattula
2021-05-20 10:14 ` [igt-dev] ✓ Fi.CI.BAT: success for tests/i915: test pass for no caching case (rev2) Patchwork
2021-05-20 23:01 ` [igt-dev] [Patch V3] [i-g-t] tests/i915: test pass for no caching case Dixit, Ashutosh
2021-05-21 15:39 ` [igt-dev] ✓ Fi.CI.IGT: success for tests/i915: test pass for no caching case (rev2) Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox