public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t] tests/i915/gem_mmap: test for non pagealingned mmaps
@ 2019-04-08 15:50 Ramalingam C
  2019-04-08 15:52 ` Chris Wilson
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Ramalingam C @ 2019-04-08 15:50 UTC (permalink / raw)
  To: igt-dev, tvrtko.ursulin

Kernel supports the non page aligned mmaps. Hence this new subtest
helps to maintain the sanity of such support.

Signed-off-by: Ramalingam C <ramalingam.c@intel.com>
---
 tests/i915/gem_mmap.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/tests/i915/gem_mmap.c b/tests/i915/gem_mmap.c
index 1f5348d9133b..f66d8b896268 100644
--- a/tests/i915/gem_mmap.c
+++ b/tests/i915/gem_mmap.c
@@ -228,6 +228,21 @@ igt_main
 		}
 	}
 
+	igt_subtest("page_nonaligned") {
+		struct drm_i915_gem_mmap arg = {
+			.handle = gem_create(fd, PAGE_SIZE),
+			.size = PAGE_SIZE - 5,
+			.flags = I915_MMAP_WC,
+		};
+
+		igt_debug("Trying to mmap page nonaligned size : %'"PRIu64"\n",
+			  (unsigned long)arg.size);
+		igt_assert_eq(mmap_ioctl(fd, &arg), 0);
+
+		gem_close(fd, arg.handle);
+		munmap(from_user_pointer(arg.addr_ptr), PAGE_SIZE - 5);
+	}
+
 	igt_subtest("basic") {
 		struct drm_i915_gem_mmap arg = {
 			.handle = gem_create(fd, OBJECT_SIZE),
-- 
2.19.1

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

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

end of thread, other threads:[~2019-04-08 20:11 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-04-08 15:50 [igt-dev] [PATCH i-g-t] tests/i915/gem_mmap: test for non pagealingned mmaps Ramalingam C
2019-04-08 15:52 ` Chris Wilson
2019-04-08 16:01   ` C, Ramalingam
2019-04-08 16:01 ` Tvrtko Ursulin
2019-04-08 16:10   ` Chris Wilson
2019-04-08 16:18     ` Tvrtko Ursulin
2019-04-08 17:17 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2019-04-08 20:11 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork

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