public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Ramalingam C <ramalingam.c@intel.com>
To: igt-dev <igt-dev@lists.freedesktop.org>
Subject: [igt-dev] [PATCH i-g-t 2/5] tests/i915/gem_create: Modify the page nonaligned tests
Date: Mon, 27 Jan 2020 22:32:02 +0530	[thread overview]
Message-ID: <20200127170205.7195-2-ramalingam.c@intel.com> (raw)
In-Reply-To: <20200127170205.7195-1-ramalingam.c@intel.com>

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.

v2:
  added check for padded mem at "create-valid-nonaligned" [chris]

Signed-off-by: Ramalingam C <ramalingam.c@intel.com>
cc: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: 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

  reply	other threads:[~2020-01-27 17:02 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-27 17:02 [igt-dev] [PATCH i-g-t 1/5] tests/dumb_buffer: Remove page nonaligned buffer tests Ramalingam C
2020-01-27 17:02 ` Ramalingam C [this message]
2020-01-27 17:02 ` [igt-dev] [PATCH i-g-t 3/5] tests/dumb_buffer: Try to compute the largest possible dumb buffer Ramalingam C
2020-01-27 17:02 ` [igt-dev] [PATCH i-g-t 4/5] tests/dumb_duffer: extending for lmem coverage Ramalingam C
2020-01-27 17:13   ` Chris Wilson
2020-01-27 17:02 ` [igt-dev] [PATCH i-g-t 5/5] lib/i915/intel_memory_region: wrappers for memory regions ops Ramalingam C
2020-01-27 19:41 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/5] tests/dumb_buffer: Remove page nonaligned buffer tests Patchwork
2020-01-28 13:57 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200127170205.7195-2-ramalingam.c@intel.com \
    --to=ramalingam.c@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox