diff options
Diffstat (limited to 'src/etnaviv/drm/etnaviv_bo.c')
-rw-r--r-- | src/etnaviv/drm/etnaviv_bo.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/etnaviv/drm/etnaviv_bo.c b/src/etnaviv/drm/etnaviv_bo.c index ccf5da7c8c7..0ec64b780f5 100644 --- a/src/etnaviv/drm/etnaviv_bo.c +++ b/src/etnaviv/drm/etnaviv_bo.c @@ -46,6 +46,9 @@ void _etna_bo_del(struct etna_bo *bo) { VG_BO_FREE(bo); + if (bo->va) + util_vma_heap_free(&bo->dev->address_space, bo->va, bo->size); + if (bo->map) os_munmap(bo->map, bo->size); @@ -106,6 +109,9 @@ static struct etna_bo *bo_from_handle(struct etna_device *dev, /* add ourselves to the handle table: */ _mesa_hash_table_insert(dev->handle_table, &bo->handle, bo); + if (dev->use_softpin) + bo->va = util_vma_heap_alloc(&dev->address_space, bo->size, 4096); + return bo; } @@ -319,6 +325,11 @@ uint32_t etna_bo_size(struct etna_bo *bo) return bo->size; } +uint32_t etna_bo_gpu_va(struct etna_bo *bo) +{ + return bo->va; +} + void *etna_bo_map(struct etna_bo *bo) { if (!bo->map) { |