summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmil Velikov <emil.l.velikov@gmail.com>2014-09-07 19:43:53 +0100
committerEmil Velikov <emil.l.velikov@gmail.com>2014-09-28 17:09:34 +0100
commit6281cf1b4310ff0b7670677cb4113a89ebf0b619 (patch)
tree6fe6719a9d2406ed804af7ce340cf330aae1ff78
parentc98c54f8434e2d38353bbf65b538bfcbf709409b (diff)
radeon: 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--radeon/radeon_bo_gem.c7
-rw-r--r--radeon/radeon_cs_gem.c1
-rw-r--r--radeon/radeon_surface.c1
3 files changed, 3 insertions, 6 deletions
diff --git a/radeon/radeon_bo_gem.c b/radeon/radeon_bo_gem.c
index 251ec1b5..e78303a7 100644
--- a/radeon/radeon_bo_gem.c
+++ b/radeon/radeon_bo_gem.c
@@ -36,7 +36,6 @@
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
-#include <sys/mman.h>
#include <errno.h>
#include "libdrm.h"
#include "xf86drm.h"
@@ -135,7 +134,7 @@ static struct radeon_bo *bo_unref(struct radeon_bo_int *boi)
return (struct radeon_bo *)boi;
}
if (bo_gem->priv_ptr) {
- munmap(bo_gem->priv_ptr, boi->size);
+ drm_munmap(bo_gem->priv_ptr, boi->size);
}
/* Zero out args to make valgrind happy */
@@ -179,7 +178,7 @@ static int bo_map(struct radeon_bo_int *boi, int write)
boi, boi->handle, r);
return r;
}
- ptr = mmap(0, args.size, PROT_READ|PROT_WRITE, MAP_SHARED, boi->bom->fd, args.addr_ptr);
+ ptr = drm_mmap(0, args.size, PROT_READ|PROT_WRITE, MAP_SHARED, boi->bom->fd, args.addr_ptr);
if (ptr == MAP_FAILED)
return -errno;
bo_gem->priv_ptr = ptr;
@@ -198,7 +197,7 @@ static int bo_unmap(struct radeon_bo_int *boi)
if (--bo_gem->map_count > 0) {
return 0;
}
- //munmap(bo->ptr, bo->size);
+ //drm_munmap(bo->ptr, bo->size);
boi->ptr = NULL;
return 0;
}
diff --git a/radeon/radeon_cs_gem.c b/radeon/radeon_cs_gem.c
index 2020e1ae..705ee056 100644
--- a/radeon/radeon_cs_gem.c
+++ b/radeon/radeon_cs_gem.c
@@ -37,7 +37,6 @@
#include <stdlib.h>
#include <string.h>
#include <pthread.h>
-#include <sys/mman.h>
#include <sys/ioctl.h>
#include "radeon_cs.h"
#include "radeon_cs_int.h"
diff --git a/radeon/radeon_surface.c b/radeon/radeon_surface.c
index 40a544a0..0723425e 100644
--- a/radeon/radeon_surface.c
+++ b/radeon/radeon_surface.c
@@ -35,7 +35,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <sys/mman.h>
#include <sys/ioctl.h>
#include "drm.h"
#include "libdrm.h"