summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmil Velikov <emil.l.velikov@gmail.com>2014-09-07 19:42:08 +0100
committerEmil Velikov <emil.l.velikov@gmail.com>2014-09-28 17:09:34 +0100
commitc98c54f8434e2d38353bbf65b538bfcbf709409b (patch)
tree87365c377925aeea2477c7f11986035e506079a4
parentdadc9eff9fd606335a7b3d5d58065a2e8d629672 (diff)
downloadlibdrm-c98c54f8434e2d38353bbf65b538bfcbf709409b.tar.gz
libdrm-c98c54f8434e2d38353bbf65b538bfcbf709409b.tar.bz2
libdrm-c98c54f8434e2d38353bbf65b538bfcbf709409b.zip
nouveau: use drm_mmap/drm_munmap wrappers
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
-rw-r--r--nouveau/nouveau.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/nouveau/nouveau.c b/nouveau/nouveau.c
index 43f0d3c6..da49e179 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;