diff mbox

[15/18] nouveau: use drm_mmap/drm_munmap wrappers

Message ID 1410125413-19465-16-git-send-email-emil.l.velikov@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Emil Velikov Sept. 7, 2014, 9:30 p.m. UTC
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
---
 nouveau/nouveau.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
diff mbox

Patch

diff --git a/nouveau/nouveau.c b/nouveau/nouveau.c
index 43f0d3c..da49e17 100644
--- a/nouveau/nouveau.c
+++ b/nouveau/nouveau.c
@@ -33,11 +33,11 @@ 
 #include <stdbool.h>
 #include <assert.h>
 #include <errno.h>
-#include <sys/mman.h>
 #include <fcntl.h>
 
 #include <xf86drm.h>
 #include <xf86atomic.h>
+#include "libdrm.h"
 #include "libdrm_lists.h"
 #include "nouveau_drm.h"
 
@@ -381,7 +381,7 @@  nouveau_bo_del(struct nouveau_bo *bo)
 		drmIoctl(bo->device->fd, DRM_IOCTL_GEM_CLOSE, &req);
 	}
 	if (bo->map)
-		munmap(bo->map, bo->size);
+		drm_munmap(bo->map, bo->size);
 	free(nvbo);
 }
 
@@ -607,7 +607,7 @@  nouveau_bo_map(struct nouveau_bo *bo, uint32_t access,
 {
 	struct nouveau_bo_priv *nvbo = nouveau_bo(bo);
 	if (bo->map == NULL) {
-		bo->map = mmap(0, bo->size, PROT_READ | PROT_WRITE,
+		bo->map = drm_mmap(0, bo->size, PROT_READ | PROT_WRITE,
 			       MAP_SHARED, bo->device->fd, nvbo->map_handle);
 		if (bo->map == MAP_FAILED) {
 			bo->map = NULL;