etnaviv: drm: Use mesa's os_m{un,}map

Signed-off-by: Guido Günther <guido.gunther@puri.sm>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
This commit is contained in:
Guido Günther 2019-05-31 14:35:06 +02:00
parent 2ebd444c10
commit e87d128b52
1 changed files with 5 additions and 3 deletions

View File

@ -24,6 +24,8 @@
* Christian Gmeiner <christian.gmeiner@gmail.com> * Christian Gmeiner <christian.gmeiner@gmail.com>
*/ */
#include "os/os_mman.h"
#include "etnaviv_priv.h" #include "etnaviv_priv.h"
#include "etnaviv_drmif.h" #include "etnaviv_drmif.h"
@ -42,7 +44,7 @@ static void set_name(struct etna_bo *bo, uint32_t name)
void bo_del(struct etna_bo *bo) void bo_del(struct etna_bo *bo)
{ {
if (bo->map) if (bo->map)
drm_munmap(bo->map, bo->size); os_munmap(bo->map, bo->size);
if (bo->name) if (bo->name)
drmHashDelete(bo->dev->name_table, bo->name); drmHashDelete(bo->dev->name_table, bo->name);
@ -314,8 +316,8 @@ void *etna_bo_map(struct etna_bo *bo)
get_buffer_info(bo); get_buffer_info(bo);
} }
bo->map = drm_mmap(0, bo->size, PROT_READ | PROT_WRITE, bo->map = os_mmap(0, bo->size, PROT_READ | PROT_WRITE,
MAP_SHARED, bo->dev->fd, bo->offset); MAP_SHARED, bo->dev->fd, bo->offset);
if (bo->map == MAP_FAILED) { if (bo->map == MAP_FAILED) {
ERROR_MSG("mmap failed: %s", strerror(errno)); ERROR_MSG("mmap failed: %s", strerror(errno));
bo->map = NULL; bo->map = NULL;