aboutsummaryrefslogtreecommitdiffstats
path: root/radeon
diff options
context:
space:
mode:
authorEmil Velikov2014-09-07 13:43:53 -0500
committerEmil Velikov2014-09-28 11:09:34 -0500
commit6281cf1b4310ff0b7670677cb4113a89ebf0b619 (patch)
tree6fe6719a9d2406ed804af7ce340cf330aae1ff78 /radeon
parentc98c54f8434e2d38353bbf65b538bfcbf709409b (diff)
downloadexternal-libdrm-6281cf1b4310ff0b7670677cb4113a89ebf0b619.tar.gz
external-libdrm-6281cf1b4310ff0b7670677cb4113a89ebf0b619.tar.xz
external-libdrm-6281cf1b4310ff0b7670677cb4113a89ebf0b619.zip
radeon: use drm_mmap/drm_munmap wrappers
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
Diffstat (limited to 'radeon')
-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 @@
36#include <stdint.h> 36#include <stdint.h>
37#include <stdlib.h> 37#include <stdlib.h>
38#include <string.h> 38#include <string.h>
39#include <sys/mman.h>
40#include <errno.h> 39#include <errno.h>
41#include "libdrm.h" 40#include "libdrm.h"
42#include "xf86drm.h" 41#include "xf86drm.h"
@@ -135,7 +134,7 @@ static struct radeon_bo *bo_unref(struct radeon_bo_int *boi)
135 return (struct radeon_bo *)boi; 134 return (struct radeon_bo *)boi;
136 } 135 }
137 if (bo_gem->priv_ptr) { 136 if (bo_gem->priv_ptr) {
138 munmap(bo_gem->priv_ptr, boi->size); 137 drm_munmap(bo_gem->priv_ptr, boi->size);
139 } 138 }
140 139
141 /* Zero out args to make valgrind happy */ 140 /* Zero out args to make valgrind happy */
@@ -179,7 +178,7 @@ static int bo_map(struct radeon_bo_int *boi, int write)
179 boi, boi->handle, r); 178 boi, boi->handle, r);
180 return r; 179 return r;
181 } 180 }
182 ptr = mmap(0, args.size, PROT_READ|PROT_WRITE, MAP_SHARED, boi->bom->fd, args.addr_ptr); 181 ptr = drm_mmap(0, args.size, PROT_READ|PROT_WRITE, MAP_SHARED, boi->bom->fd, args.addr_ptr);
183 if (ptr == MAP_FAILED) 182 if (ptr == MAP_FAILED)
184 return -errno; 183 return -errno;
185 bo_gem->priv_ptr = ptr; 184 bo_gem->priv_ptr = ptr;
@@ -198,7 +197,7 @@ static int bo_unmap(struct radeon_bo_int *boi)
198 if (--bo_gem->map_count > 0) { 197 if (--bo_gem->map_count > 0) {
199 return 0; 198 return 0;
200 } 199 }
201 //munmap(bo->ptr, bo->size); 200 //drm_munmap(bo->ptr, bo->size);
202 boi->ptr = NULL; 201 boi->ptr = NULL;
203 return 0; 202 return 0;
204} 203}
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 @@
37#include <stdlib.h> 37#include <stdlib.h>
38#include <string.h> 38#include <string.h>
39#include <pthread.h> 39#include <pthread.h>
40#include <sys/mman.h>
41#include <sys/ioctl.h> 40#include <sys/ioctl.h>
42#include "radeon_cs.h" 41#include "radeon_cs.h"
43#include "radeon_cs_int.h" 42#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 @@
35#include <stdio.h> 35#include <stdio.h>
36#include <stdlib.h> 36#include <stdlib.h>
37#include <string.h> 37#include <string.h>
38#include <sys/mman.h>
39#include <sys/ioctl.h> 38#include <sys/ioctl.h>
40#include "drm.h" 39#include "drm.h"
41#include "libdrm.h" 40#include "libdrm.h"