[igt-dev] [Patch V2] [i-g-t] tests/i915: test pass for no caching case

viswax.krishna.raveendra.talabattula at intel.com viswax.krishna.raveendra.talabattula at intel.com
Thu May 20 04:27:25 UTC 2021


From: Viswa Krishna Raveendra Talabattula <viswax.krishna.raveendra.talabattula at 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

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

So lets make test pass for both cases and return warning for 0 return
code

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

diff --git a/tests/i915/gem_userptr_blits.c b/tests/i915/gem_userptr_blits.c
index aad5f141..2ac5713b 100644
--- a/tests/i915/gem_userptr_blits.c
+++ b/tests/i915/gem_userptr_blits.c
@@ -2032,15 +2032,24 @@ 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 (__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);
+		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++)
-		igt_assert_eq(__gem_set_caching(i915, handle, levels[idx]), 0);
+		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



More information about the igt-dev mailing list