diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2020-02-02 20:16:32 +0300 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2020-02-05 02:57:26 +0300 |
commit | 8e4ff9b569572880b65d58976bb701a40ef1d9c4 (patch) | |
tree | 914eda35fd9a24e7709856db81cadfea08c1d7d2 /drivers/gpu/drm/drm_vm.c | |
parent | ea36ec8623f56791c6ff6738d0509b7920f85220 (diff) | |
download | linux-8e4ff9b569572880b65d58976bb701a40ef1d9c4.tar.xz |
drm: Remove the dma_alloc_coherent wrapper for internal usage
Internally for "consistent" maps, we create a temporary struct
drm_dma_handle in order to use our own dma_alloc_coherent wrapper then
destroy the temporary wrap. Simplify our logic by removing the temporary
wrapper!
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200202171635.4039044-2-chris@chris-wilson.co.uk
Diffstat (limited to 'drivers/gpu/drm/drm_vm.c')
-rw-r--r-- | drivers/gpu/drm/drm_vm.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/gpu/drm/drm_vm.c b/drivers/gpu/drm/drm_vm.c index 52e87e4869a5..64619fe90046 100644 --- a/drivers/gpu/drm/drm_vm.c +++ b/drivers/gpu/drm/drm_vm.c @@ -269,8 +269,6 @@ static void drm_vm_shm_close(struct vm_area_struct *vma) } if (!found_maps) { - drm_dma_handle_t dmah; - switch (map->type) { case _DRM_REGISTERS: case _DRM_FRAME_BUFFER: @@ -284,10 +282,10 @@ static void drm_vm_shm_close(struct vm_area_struct *vma) case _DRM_SCATTER_GATHER: break; case _DRM_CONSISTENT: - dmah.vaddr = map->handle; - dmah.busaddr = map->offset; - dmah.size = map->size; - __drm_legacy_pci_free(dev, &dmah); + dma_free_coherent(&dev->pdev->dev, + map->size, + map->handle, + map->offset); break; } kfree(map); |