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
This commit is contained in:
@@ -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);
|
||||
|
Reference in New Issue
Block a user