drm/ttm: remove ttm_bo_default_io_mem_pfn
authorTan Xiaojun <tanxiaojun@huawei.com>
Mon, 25 Dec 2017 03:43:34 +0000 (11:43 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 10 Jan 2018 20:44:51 +0000 (15:44 -0500)
No one will use this function except ttm_bo_io_mem_pfn() now, so move
the calculation of ttm_bo_default_io_mem_pfn() into ttm_bo_io_mem_pfn()
and do some cleanup.

Signed-off-by: Tan Xiaojun <tanxiaojun@huawei.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/ttm/ttm_bo_vm.c
include/drm/ttm/ttm_bo_api.h

index 8e68e70b02b9588b892c2c6d83466e15134e0b26..08a3c324242e6fe705dc989e9888ac3b4fa23137 100644 (file)
@@ -100,7 +100,8 @@ static unsigned long ttm_bo_io_mem_pfn(struct ttm_buffer_object *bo,
        if (bdev->driver->io_mem_pfn)
                return bdev->driver->io_mem_pfn(bo, page_offset);
 
-       return ttm_bo_default_io_mem_pfn(bo, page_offset);
+       return ((bo->mem.bus.base + bo->mem.bus.offset) >> PAGE_SHIFT)
+               + page_offset;
 }
 
 static int ttm_bo_vm_fault(struct vm_fault *vmf)
@@ -420,14 +421,6 @@ static struct ttm_buffer_object *ttm_bo_vm_lookup(struct ttm_bo_device *bdev,
        return bo;
 }
 
-unsigned long ttm_bo_default_io_mem_pfn(struct ttm_buffer_object *bo,
-                                       unsigned long page_offset)
-{
-       return ((bo->mem.bus.base + bo->mem.bus.offset) >> PAGE_SHIFT)
-               + page_offset;
-}
-EXPORT_SYMBOL(ttm_bo_default_io_mem_pfn);
-
 int ttm_bo_mmap(struct file *filp, struct vm_area_struct *vma,
                struct ttm_bo_device *bdev)
 {
index f1c74c22248b2266f81d1057e910e18adfb14b39..2cd025c2abe727930ce39bcc2f461bd35aeba3e7 100644 (file)
@@ -704,17 +704,6 @@ void ttm_bo_kunmap(struct ttm_bo_kmap_obj *map);
  */
 int ttm_fbdev_mmap(struct vm_area_struct *vma, struct ttm_buffer_object *bo);
 
-/**
- * ttm_bo_default_iomem_pfn - get a pfn for a page offset
- *
- * @bo: the BO we need to look up the pfn for
- * @page_offset: offset inside the BO to look up.
- *
- * Calculate the PFN for iomem based mappings during page fault
- */
-unsigned long ttm_bo_default_io_mem_pfn(struct ttm_buffer_object *bo,
-                                       unsigned long page_offset);
-
 /**
  * ttm_bo_mmap - mmap out of the ttm device address space.
  *