public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t] tests/i915/gem_create: Modify the page nonaligned tests
@ 2020-01-27 11:04 Ramalingam C
  2020-01-27 11:23 ` Chris Wilson
  2020-01-27 14:48 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
  0 siblings, 2 replies; 3+ messages in thread
From: Ramalingam C @ 2020-01-27 11:04 UTC (permalink / raw)
  To: igt-dev

Considering that kernel returns the real memory size(page aligned)
allocated, "create-invalid-nonaligned" test is not needed anymore.
Hence removing them.

At "create-valid-nonaligned" test we are asserting the returned mem size
from kernel to be minimum page aligned and checking the write into padded
memory.

Signed-off-by: Ramalingam C <ramalingam.c@intel.com>
cc: Chris Wilson <chris@chris-wilson.co.uk>
---
 tests/i915/gem_create.c | 30 +++---------------------------
 1 file changed, 3 insertions(+), 27 deletions(-)

diff --git a/tests/i915/gem_create.c b/tests/i915/gem_create.c
index 8fc128dae6e2..0a0c4d5804a2 100644
--- a/tests/i915/gem_create.c
+++ b/tests/i915/gem_create.c
@@ -120,9 +120,8 @@ static void invalid_size_test(int fd)
 }
 
 /*
- * Creating an object with non-aligned size and trying to access it with an
- * offset, which is greater than the requested size but smaller than the
- * object's last page boundary. pwrite here must be successful.
+ * Creating an object with non-aligned size request and assert the buffer is
+ * page aligned. And test the write into the padded extra memory.
  */
 static void valid_nonaligned_size(int fd)
 {
@@ -132,33 +131,13 @@ static void valid_nonaligned_size(int fd)
 	char buf[PAGE_SIZE];
 
 	igt_assert_eq(create_ioctl(fd, &create), 0);
+	igt_assert(create.size >= PAGE_SIZE);
 
 	gem_write(fd, create.handle, PAGE_SIZE / 2, buf, PAGE_SIZE / 2);
 
 	gem_close(fd, create.handle);
 }
 
-/*
- * Creating an object with non-aligned size and trying to access it with an
- * offset, which is greater than the requested size and larger than the
- * object's last page boundary. pwrite here must fail.
- */
-static void invalid_nonaligned_size(int fd)
-{
-	struct drm_i915_gem_create create = {
-		.size = PAGE_SIZE / 2,
-	};
-	char buf[PAGE_SIZE];
-
-	igt_assert_eq(create_ioctl(fd, &create), 0);
-
-	/* This should fail. Hence cannot use gem_write. */
-	igt_assert(__gem_write(fd, create.handle,
-			       PAGE_SIZE / 2, buf, PAGE_SIZE));
-
-	gem_close(fd, create.handle);
-}
-
 static uint64_t atomic_compare_swap_u64(_Atomic(uint64_t) *ptr,
 					uint64_t oldval, uint64_t newval)
 {
@@ -307,9 +286,6 @@ igt_main
 	igt_subtest("create-valid-nonaligned")
 		valid_nonaligned_size(fd);
 
-	igt_subtest("create-invalid-nonaligned")
-		invalid_nonaligned_size(fd);
-
 	igt_subtest("create-size-update")
 		size_update(fd);
 
-- 
2.20.1

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

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

end of thread, other threads:[~2020-01-27 14:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-01-27 11:04 [igt-dev] [PATCH i-g-t] tests/i915/gem_create: Modify the page nonaligned tests Ramalingam C
2020-01-27 11:23 ` Chris Wilson
2020-01-27 14:48 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork

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