[PATCH i-g-t] tests/gem_userptr_blits: test zero user_size

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Check that the kernel rejects a zero user_size.

Signed-off-by: Matthew Auld <matthew.auld@xxxxxxxxx>
Cc: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>
---
 tests/gem_userptr_blits.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/tests/gem_userptr_blits.c b/tests/gem_userptr_blits.c
index 849054ad..7e3b6ef3 100644
--- a/tests/gem_userptr_blits.c
+++ b/tests/gem_userptr_blits.c
@@ -442,6 +442,14 @@ static int test_input_checking(int fd)
 	ret = drmIoctl(fd, LOCAL_IOCTL_I915_GEM_USERPTR, &userptr);
 	igt_assert_neq(ret, 0);
 
+	/* Zero user_size. */
+	memset(&userptr, 0, sizeof(userptr));
+	userptr.user_ptr = 0;
+	userptr.user_size = 0;
+	userptr.flags = 0;
+	ret = drmIoctl(fd, LOCAL_IOCTL_I915_GEM_USERPTR, &userptr);
+	igt_assert_neq(ret, 0);
+
 	return 0;
 }
 
-- 
2.17.0

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




[Index of Archives]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux