aboutsummaryrefslogtreecommitdiffstats
path: root/libkms
diff options
context:
space:
mode:
authorEmil Velikov2014-09-07 13:41:37 -0500
committerEmil Velikov2014-09-28 11:09:34 -0500
commitdadc9eff9fd606335a7b3d5d58065a2e8d629672 (patch)
tree2ef0dab8242a8d61336d4c643b9df8a65167f128 /libkms
parentfaf51d5694e3f0ec12c7fa1fd2f87fc96a300fe3 (diff)
downloadexternal-libdrm-dadc9eff9fd606335a7b3d5d58065a2e8d629672.tar.gz
external-libdrm-dadc9eff9fd606335a7b3d5d58065a2e8d629672.tar.xz
external-libdrm-dadc9eff9fd606335a7b3d5d58065a2e8d629672.zip
libkms: use drm_mmap/drm_munmap wrappers
... for all by exynos. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
Diffstat (limited to 'libkms')
-rw-r--r--libkms/dumb.c8
-rw-r--r--libkms/intel.c6
-rw-r--r--libkms/nouveau.c6
-rw-r--r--libkms/radeon.c8
-rw-r--r--libkms/vmwgfx.c6
5 files changed, 16 insertions, 18 deletions
diff --git a/libkms/dumb.c b/libkms/dumb.c
index 57025430..f9c16e11 100644
--- a/libkms/dumb.c
+++ b/libkms/dumb.c
@@ -36,11 +36,9 @@
36#include <string.h> 36#include <string.h>
37#include "internal.h" 37#include "internal.h"
38 38
39#include <sys/mman.h>
40#include <sys/ioctl.h> 39#include <sys/ioctl.h>
41#include "xf86drm.h" 40#include "xf86drm.h"
42 41#include "libdrm.h"
43#include "i915_drm.h"
44 42
45struct dumb_bo 43struct dumb_bo
46{ 44{
@@ -149,7 +147,7 @@ dumb_bo_map(struct kms_bo *_bo, void **out)
149 if (ret) 147 if (ret)
150 return ret; 148 return ret;
151 149
152 map = mmap(0, bo->base.size, PROT_READ | PROT_WRITE, MAP_SHARED, bo->base.kms->fd, arg.offset); 150 map = drm_mmap(0, bo->base.size, PROT_READ | PROT_WRITE, MAP_SHARED, bo->base.kms->fd, arg.offset);
153 if (map == MAP_FAILED) 151 if (map == MAP_FAILED)
154 return -errno; 152 return -errno;
155 153
@@ -177,7 +175,7 @@ dumb_bo_destroy(struct kms_bo *_bo)
177 175
178 if (bo->base.ptr) { 176 if (bo->base.ptr) {
179 /* XXX Sanity check map_count */ 177 /* XXX Sanity check map_count */
180 munmap(bo->base.ptr, bo->base.size); 178 drm_munmap(bo->base.ptr, bo->base.size);
181 bo->base.ptr = NULL; 179 bo->base.ptr = NULL;
182 } 180 }
183 181
diff --git a/libkms/intel.c b/libkms/intel.c
index b006ea48..51a7fd2e 100644
--- a/libkms/intel.c
+++ b/libkms/intel.c
@@ -36,9 +36,9 @@
36#include <string.h> 36#include <string.h>
37#include "internal.h" 37#include "internal.h"
38 38
39#include <sys/mman.h>
40#include <sys/ioctl.h> 39#include <sys/ioctl.h>
41#include "xf86drm.h" 40#include "xf86drm.h"
41#include "libdrm.h"
42 42
43#include "i915_drm.h" 43#include "i915_drm.h"
44 44
@@ -173,7 +173,7 @@ intel_bo_map(struct kms_bo *_bo, void **out)
173 if (ret) 173 if (ret)
174 return ret; 174 return ret;
175 175
176 map = mmap(0, bo->base.size, PROT_READ | PROT_WRITE, MAP_SHARED, bo->base.kms->fd, arg.offset); 176 map = drm_mmap(0, bo->base.size, PROT_READ | PROT_WRITE, MAP_SHARED, bo->base.kms->fd, arg.offset);
177 if (map == MAP_FAILED) 177 if (map == MAP_FAILED)
178 return -errno; 178 return -errno;
179 179
@@ -201,7 +201,7 @@ intel_bo_destroy(struct kms_bo *_bo)
201 201
202 if (bo->base.ptr) { 202 if (bo->base.ptr) {
203 /* XXX Sanity check map_count */ 203 /* XXX Sanity check map_count */
204 munmap(bo->base.ptr, bo->base.size); 204 drm_munmap(bo->base.ptr, bo->base.size);
205 bo->base.ptr = NULL; 205 bo->base.ptr = NULL;
206 } 206 }
207 207
diff --git a/libkms/nouveau.c b/libkms/nouveau.c
index 15c012e0..228903ff 100644
--- a/libkms/nouveau.c
+++ b/libkms/nouveau.c
@@ -36,9 +36,9 @@
36#include <string.h> 36#include <string.h>
37#include "internal.h" 37#include "internal.h"
38 38
39#include <sys/mman.h>
40#include <sys/ioctl.h> 39#include <sys/ioctl.h>
41#include "xf86drm.h" 40#include "xf86drm.h"
41#include "libdrm.h"
42 42
43#include "nouveau_drm.h" 43#include "nouveau_drm.h"
44 44
@@ -155,7 +155,7 @@ nouveau_bo_map(struct kms_bo *_bo, void **out)
155 return 0; 155 return 0;
156 } 156 }
157 157
158 map = mmap(0, bo->base.size, PROT_READ | PROT_WRITE, MAP_SHARED, bo->base.kms->fd, bo->map_handle); 158 map = drm_mmap(0, bo->base.size, PROT_READ | PROT_WRITE, MAP_SHARED, bo->base.kms->fd, bo->map_handle);
159 if (map == MAP_FAILED) 159 if (map == MAP_FAILED)
160 return -errno; 160 return -errno;
161 161
@@ -183,7 +183,7 @@ nouveau_bo_destroy(struct kms_bo *_bo)
183 183
184 if (bo->base.ptr) { 184 if (bo->base.ptr) {
185 /* XXX Sanity check map_count */ 185 /* XXX Sanity check map_count */
186 munmap(bo->base.ptr, bo->base.size); 186 drm_munmap(bo->base.ptr, bo->base.size);
187 bo->base.ptr = NULL; 187 bo->base.ptr = NULL;
188 } 188 }
189 189
diff --git a/libkms/radeon.c b/libkms/radeon.c
index 938321bb..9383a0ae 100644
--- a/libkms/radeon.c
+++ b/libkms/radeon.c
@@ -36,9 +36,9 @@
36#include <string.h> 36#include <string.h>
37#include "internal.h" 37#include "internal.h"
38 38
39#include <sys/mman.h>
40#include <sys/ioctl.h> 39#include <sys/ioctl.h>
41#include "xf86drm.h" 40#include "xf86drm.h"
41#include "libdrm.h"
42 42
43#include "radeon_drm.h" 43#include "radeon_drm.h"
44 44
@@ -172,7 +172,7 @@ radeon_bo_map(struct kms_bo *_bo, void **out)
172 if (ret) 172 if (ret)
173 return -errno; 173 return -errno;
174 174
175 map = mmap(0, arg.size, PROT_READ | PROT_WRITE, MAP_SHARED, 175 map = drm_mmap(0, arg.size, PROT_READ | PROT_WRITE, MAP_SHARED,
176 bo->base.kms->fd, arg.addr_ptr); 176 bo->base.kms->fd, arg.addr_ptr);
177 if (map == MAP_FAILED) 177 if (map == MAP_FAILED)
178 return -errno; 178 return -errno;
@@ -189,7 +189,7 @@ radeon_bo_unmap(struct kms_bo *_bo)
189{ 189{
190 struct radeon_bo *bo = (struct radeon_bo *)_bo; 190 struct radeon_bo *bo = (struct radeon_bo *)_bo;
191 if (--bo->map_count == 0) { 191 if (--bo->map_count == 0) {
192 munmap(bo->base.ptr, bo->base.size); 192 drm_munmap(bo->base.ptr, bo->base.size);
193 bo->base.ptr = NULL; 193 bo->base.ptr = NULL;
194 } 194 }
195 return 0; 195 return 0;
@@ -204,7 +204,7 @@ radeon_bo_destroy(struct kms_bo *_bo)
204 204
205 if (bo->base.ptr) { 205 if (bo->base.ptr) {
206 /* XXX Sanity check map_count */ 206 /* XXX Sanity check map_count */
207 munmap(bo->base.ptr, bo->base.size); 207 drm_munmap(bo->base.ptr, bo->base.size);
208 bo->base.ptr = NULL; 208 bo->base.ptr = NULL;
209 } 209 }
210 210
diff --git a/libkms/vmwgfx.c b/libkms/vmwgfx.c
index 08163a16..bc04133f 100644
--- a/libkms/vmwgfx.c
+++ b/libkms/vmwgfx.c
@@ -35,8 +35,8 @@
35#include <string.h> 35#include <string.h>
36#include "internal.h" 36#include "internal.h"
37 37
38#include <sys/mman.h>
39#include "xf86drm.h" 38#include "xf86drm.h"
39#include "libdrm.h"
40#include "vmwgfx_drm.h" 40#include "vmwgfx_drm.h"
41 41
42struct vmwgfx_bo 42struct vmwgfx_bo
@@ -146,7 +146,7 @@ vmwgfx_bo_map(struct kms_bo *_bo, void **out)
146 return 0; 146 return 0;
147 } 147 }
148 148
149 map = mmap(NULL, bo->base.size, PROT_READ | PROT_WRITE, MAP_SHARED, bo->base.kms->fd, bo->map_handle); 149 map = drm_mmap(NULL, bo->base.size, PROT_READ | PROT_WRITE, MAP_SHARED, bo->base.kms->fd, bo->map_handle);
150 if (map == MAP_FAILED) 150 if (map == MAP_FAILED)
151 return -errno; 151 return -errno;
152 152
@@ -173,7 +173,7 @@ vmwgfx_bo_destroy(struct kms_bo *_bo)
173 173
174 if (bo->base.ptr) { 174 if (bo->base.ptr) {
175 /* XXX Sanity check map_count */ 175 /* XXX Sanity check map_count */
176 munmap(bo->base.ptr, bo->base.size); 176 drm_munmap(bo->base.ptr, bo->base.size);
177 bo->base.ptr = NULL; 177 bo->base.ptr = NULL;
178 } 178 }
179 179