summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/ttm/ttm_bo.c
diff options
context:
space:
mode:
authorDavid Herrmann <dh.herrmann@gmail.com>2013-07-24 23:10:03 +0400
committerDave Airlie <airlied@gmail.com>2013-07-25 14:47:08 +0400
commit51335df9f044ccfafb029f4d7fbeb11c4526340a (patch)
treeb2875ee2e4ab79a10c84bdff6a558b336be86838 /drivers/gpu/drm/ttm/ttm_bo.c
parent72525b3f333de54fa0c42ef87f27861e41478f1e (diff)
downloadlinux-51335df9f044ccfafb029f4d7fbeb11c4526340a.tar.xz
drm/vma: provide drm_vma_node_unmap() helper
Instead of unmapping the nodes in TTM and GEM users manually, we provide a generic wrapper which does the correct thing for all vma-nodes. v2: remove bdev->dev_mapping test in ttm_bo_unmap_virtual_unlocked() as ttm_mem_io_free_vm() does nothing in that case (io_reserved_vm is 0). v4: Fix docbook comments v5: use drm_vma_node_size() Cc: Dave Airlie <airlied@redhat.com> Cc: Maarten Lankhorst <maarten.lankhorst@canonical.com> Cc: Thomas Hellstrom <thellstrom@vmware.com> Signed-off-by: David Herrmann <dh.herrmann@gmail.com> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Dave Airlie <airlied@gmail.com>
Diffstat (limited to 'drivers/gpu/drm/ttm/ttm_bo.c')
-rw-r--r--drivers/gpu/drm/ttm/ttm_bo.c11
1 files changed, 1 insertions, 10 deletions
diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
index 3dc08b612292..050edfaf5b88 100644
--- a/drivers/gpu/drm/ttm/ttm_bo.c
+++ b/drivers/gpu/drm/ttm/ttm_bo.c
@@ -1488,17 +1488,8 @@ bool ttm_mem_reg_is_pci(struct ttm_bo_device *bdev, struct ttm_mem_reg *mem)
void ttm_bo_unmap_virtual_locked(struct ttm_buffer_object *bo)
{
struct ttm_bo_device *bdev = bo->bdev;
- loff_t offset, holelen;
- if (!bdev->dev_mapping)
- return;
-
- if (drm_vma_node_has_offset(&bo->vma_node)) {
- offset = (loff_t) drm_vma_node_offset_addr(&bo->vma_node);
- holelen = ((loff_t) bo->mem.num_pages) << PAGE_SHIFT;
-
- unmap_mapping_range(bdev->dev_mapping, offset, holelen, 1);
- }
+ drm_vma_node_unmap(&bo->vma_node, bdev->dev_mapping);
ttm_mem_io_free_vm(bo);
}