From 5ce86f88a0a9b24564a6349a70de5797b814b108 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Thu, 12 Apr 2012 15:47:00 +0100 Subject: [PATCH] Use mmap64() for performing the GTT mapping Although the address space for GTT mappings may only be 32-bits, we need to use the explicit 64-bit mmap interface so that on a 32-bit platform the offset we pass is not truncated to 31-bits. Fixes gem_mmap_offset_exhaustion on 32-bit platforms. Signed-off-by: Chris Wilson --- lib/drmtest.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/drmtest.c b/lib/drmtest.c index b198aa47..ebc396f0 100644 --- a/lib/drmtest.c +++ b/lib/drmtest.c @@ -303,7 +303,7 @@ void *gem_mmap(int fd, uint32_t handle, int size, int prot) if (drmIoctl(fd, DRM_IOCTL_I915_GEM_MMAP_GTT, &mmap_arg)) return NULL; - ptr = mmap(0, size, prot, MAP_SHARED, fd, mmap_arg.offset); + ptr = mmap64(0, size, prot, MAP_SHARED, fd, mmap_arg.offset); if (ptr == MAP_FAILED) ptr = NULL;