public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t 1/5] lib/i915: Assert mmap size alignment
@ 2019-02-28 14:18 Tvrtko Ursulin
  2019-02-28 14:18 ` [Intel-gfx] [PATCH i-g-t 2/5] gem_wsim: Round mmap to page size Tvrtko Ursulin
                   ` (5 more replies)
  0 siblings, 6 replies; 16+ messages in thread
From: Tvrtko Ursulin @ 2019-02-28 14:18 UTC (permalink / raw)
  To: igt-dev; +Cc: Intel-gfx, Tvrtko Ursulin

From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

mmap(2) mandates size is page aligned so check this in our wrappers.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
---
 lib/i915/gem_mman.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lib/i915/gem_mman.c b/lib/i915/gem_mman.c
index 3cf9a6bbdb31..084dbb3b3678 100644
--- a/lib/i915/gem_mman.c
+++ b/lib/i915/gem_mman.c
@@ -57,6 +57,8 @@ void *__gem_mmap__gtt(int fd, uint32_t handle, uint64_t size, unsigned prot)
 	struct drm_i915_gem_mmap_gtt mmap_arg;
 	void *ptr;
 
+	igt_assert(!(size & 4095));
+
 	memset(&mmap_arg, 0, sizeof(mmap_arg));
 	mmap_arg.handle = handle;
 	if (igt_ioctl(fd, DRM_IOCTL_I915_GEM_MMAP_GTT, &mmap_arg))
@@ -162,6 +164,8 @@ static void
 {
 	struct drm_i915_gem_mmap arg;
 
+	igt_assert(!(size & 4095));
+
 	memset(&arg, 0, sizeof(arg));
 	arg.handle = handle;
 	arg.offset = offset;
-- 
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] 16+ messages in thread

end of thread, other threads:[~2019-02-28 15:17 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-02-28 14:18 [igt-dev] [PATCH i-g-t 1/5] lib/i915: Assert mmap size alignment Tvrtko Ursulin
2019-02-28 14:18 ` [Intel-gfx] [PATCH i-g-t 2/5] gem_wsim: Round mmap to page size Tvrtko Ursulin
2019-02-28 14:25   ` Chris Wilson
2019-02-28 14:41     ` [igt-dev] " Tvrtko Ursulin
2019-02-28 14:44       ` Chris Wilson
2019-02-28 14:18 ` [igt-dev] [PATCH i-g-t 3/5] gem_wsim: Remove some unused struct members Tvrtko Ursulin
2019-02-28 14:30   ` Chris Wilson
2019-02-28 14:18 ` [igt-dev] [PATCH i-g-t 4/5] autoconf: Silence void pointer arithmetic warnings Tvrtko Ursulin
2019-02-28 14:31   ` Chris Wilson
2019-02-28 14:42     ` Tvrtko Ursulin
2019-02-28 14:18 ` [Intel-gfx] [PATCH i-g-t 5/5] tests/i915/pm_rc6_residency: Fix linking Tvrtko Ursulin
2019-02-28 14:33   ` [igt-dev] " Chris Wilson
2019-02-28 14:48     ` Tvrtko Ursulin
2019-02-28 14:24 ` [igt-dev] [PATCH i-g-t 1/5] lib/i915: Assert mmap size alignment Chris Wilson
2019-02-28 14:38   ` Tvrtko Ursulin
2019-02-28 15:17 ` [igt-dev] ✗ Fi.CI.BAT: failure for series starting with [i-g-t,1/5] " Patchwork

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