[PATCH 1/6 v2] libdrm: Use mmap64 instead of __mmap2

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Sean Paul <seanpaul@xxxxxxxxxxxx>

__mmap2 isn't supported on all platforms, mmap64 is the right way
to do this in android.

Also folds in a fix from Stéphane Marchesin <marcheu@xxxxxxxxxxxx>

Cc: Emil Velikov <emil.velikov@xxxxxxxxxxxxx>
Cc: Sean Paul <seanpaul@xxxxxxxxxxxx>
Cc: Alistair Strachan <astrachan@xxxxxxxxxx>
Cc: Marissa Wall <marissaw@xxxxxxxxxx>
Acked-by: Alex Deucher <alexander.deucher@xxxxxxx>
Reviewed-by: Emil Velikov <emil.velikov@xxxxxxxxxxxxx>
Signed-off-by: Sean Paul <seanpaul@xxxxxxxxxxxx>
[jstultz: Folded in Stéphane's fix]
Signed-off-by: John Stultz <john.stultz@xxxxxxxxxx>
---
 libdrm_macros.h | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/libdrm_macros.h b/libdrm_macros.h
index 95f0ef5..0dca827 100644
--- a/libdrm_macros.h
+++ b/libdrm_macros.h
@@ -48,8 +48,6 @@
 #if defined(ANDROID) && !defined(__LP64__)
 #include <errno.h> /* for EINVAL */
 
-extern void *__mmap2(void *, size_t, int, int, int, size_t);
-
 static inline void *drm_mmap(void *addr, size_t length, int prot, int flags,
                              int fd, loff_t offset)
 {
@@ -59,7 +57,7 @@ static inline void *drm_mmap(void *addr, size_t length, int prot, int flags,
       return MAP_FAILED;
    }
 
-   return __mmap2(addr, length, prot, flags, fd, (size_t) (offset >> 12));
+   return mmap64(addr, length, prot, flags, fd, offset);
 }
 
 #  define drm_munmap(addr, length) \
-- 
2.7.4

_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux