aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/radeon/radeon_gart.c
diff options
context:
space:
mode:
authorChristian König <deathsimple@vodafone.de>2012-08-11 05:54:05 -0400
committerAlex Deucher <alexander.deucher@amd.com>2012-09-20 13:10:39 -0400
commit089a786e2cf5d07d495b3cb1ac0b959c6dd10d49 (patch)
treea60b26f96dae4c3c52accb4e9ae7826d1fc5b701 /drivers/gpu/drm/radeon/radeon_gart.c
parentddf03f5cdd98c6ea486f3007a5542241634c9093 (diff)
drm/radeon: Move looping over the PTEs into chip code
Makes it easier to move it into the rings. Signed-off-by: Christian König <deathsimple@vodafone.de> Reviewed-by: Jerome Glisse <jglisse@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/radeon_gart.c')
-rw-r--r--drivers/gpu/drm/radeon/radeon_gart.c24
1 files changed, 10 insertions, 14 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_gart.c b/drivers/gpu/drm/radeon/radeon_gart.c
index da1b2dbe455..0f9a40f84d7 100644
--- a/drivers/gpu/drm/radeon/radeon_gart.c
+++ b/drivers/gpu/drm/radeon/radeon_gart.c
@@ -450,7 +450,7 @@ int radeon_vm_manager_init(struct radeon_device *rdev)
450 r = radeon_asic_vm_init(rdev); 450 r = radeon_asic_vm_init(rdev);
451 if (r) 451 if (r)
452 return r; 452 return r;
453 453
454 rdev->vm_manager.enabled = true; 454 rdev->vm_manager.enabled = true;
455 455
456 r = radeon_sa_bo_manager_start(rdev, &rdev->vm_manager.sa_manager); 456 r = radeon_sa_bo_manager_start(rdev, &rdev->vm_manager.sa_manager);
@@ -773,9 +773,9 @@ int radeon_vm_bo_add(struct radeon_device *rdev,
773 * to (cayman+). 773 * to (cayman+).
774 * Returns the physical address of the page. 774 * Returns the physical address of the page.
775 */ 775 */
776static u64 radeon_vm_get_addr(struct radeon_device *rdev, 776u64 radeon_vm_get_addr(struct radeon_device *rdev,
777 struct ttm_mem_reg *mem, 777 struct ttm_mem_reg *mem,
778 unsigned pfn) 778 unsigned pfn)
779{ 779{
780 u64 addr = 0; 780 u64 addr = 0;
781 781
@@ -819,9 +819,8 @@ int radeon_vm_bo_update_pte(struct radeon_device *rdev,
819 struct ttm_mem_reg *mem) 819 struct ttm_mem_reg *mem)
820{ 820{
821 struct radeon_bo_va *bo_va; 821 struct radeon_bo_va *bo_va;
822 unsigned ngpu_pages, i; 822 unsigned ngpu_pages;
823 uint64_t addr = 0, pfn; 823 uint64_t pfn;
824 uint32_t flags;
825 824
826 /* nothing to do if vm isn't bound */ 825 /* nothing to do if vm isn't bound */
827 if (vm->sa_bo == NULL) 826 if (vm->sa_bo == NULL)
@@ -848,14 +847,11 @@ int radeon_vm_bo_update_pte(struct radeon_device *rdev,
848 bo_va->flags |= RADEON_VM_PAGE_SYSTEM; 847 bo_va->flags |= RADEON_VM_PAGE_SYSTEM;
849 } 848 }
850 } 849 }
851 pfn = bo_va->soffset / RADEON_GPU_PAGE_SIZE; 850 if (!bo_va->valid) {
852 flags = radeon_asic_vm_page_flags(rdev, bo_va->vm, bo_va->flags); 851 mem = NULL;
853 for (i = 0, addr = 0; i < ngpu_pages; i++) {
854 if (mem && bo_va->valid) {
855 addr = radeon_vm_get_addr(rdev, mem, i);
856 }
857 radeon_asic_vm_set_page(rdev, bo_va->vm, i + pfn, addr, flags);
858 } 852 }
853 pfn = bo_va->soffset / RADEON_GPU_PAGE_SIZE;
854 radeon_asic_vm_set_page(rdev, bo_va->vm, pfn, mem, ngpu_pages, bo_va->flags);
859 radeon_fence_unref(&vm->last_flush); 855 radeon_fence_unref(&vm->last_flush);
860 return 0; 856 return 0;
861} 857}