diff mbox

drm/radeon/cayman: set VM max pfn at MC init

Message ID 1349713551-9063-1-git-send-email-alexdeucher@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Alex Deucher Oct. 8, 2012, 4:25 p.m. UTC
From: Alex Deucher <alexander.deucher@amd.com>

No need to emit them at VM flush as we no longer use
variable sized page tables now that we support 2 level
page tables.  This matches the behavior of SI (which
does not support variable sized page tables).

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/radeon/ni.c |    8 +-------
 1 files changed, 1 insertions(+), 7 deletions(-)

Comments

Christian König Oct. 9, 2012, 8:37 a.m. UTC | #1
On 08.10.2012 18:25, alexdeucher@gmail.com wrote:
> From: Alex Deucher <alexander.deucher@amd.com>
>
> No need to emit them at VM flush as we no longer use
> variable sized page tables now that we support 2 level
> page tables.  This matches the behavior of SI (which
> does not support variable sized page tables).
>
> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Yeah, wanted to do so also, but have somehow forgotten it.

Reviewed-by: Christian König <christian.koenig@amd.com>

> ---
>   drivers/gpu/drm/radeon/ni.c |    8 +-------
>   1 files changed, 1 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/ni.c b/drivers/gpu/drm/radeon/ni.c
> index cfb9276..cc0701a 100644
> --- a/drivers/gpu/drm/radeon/ni.c
> +++ b/drivers/gpu/drm/radeon/ni.c
> @@ -776,7 +776,7 @@ static int cayman_pcie_gart_enable(struct radeon_device *rdev)
>   	 */
>   	for (i = 1; i < 8; i++) {
>   		WREG32(VM_CONTEXT0_PAGE_TABLE_START_ADDR + (i << 2), 0);
> -		WREG32(VM_CONTEXT0_PAGE_TABLE_END_ADDR + (i << 2), 0);
> +		WREG32(VM_CONTEXT0_PAGE_TABLE_END_ADDR + (i << 2), rdev->vm_manager.max_pfn);
>   		WREG32(VM_CONTEXT0_PAGE_TABLE_BASE_ADDR + (i << 2),
>   			rdev->gart.table_addr >> 12);
>   	}
> @@ -1576,12 +1576,6 @@ void cayman_vm_flush(struct radeon_device *rdev, int ridx, struct radeon_vm *vm)
>   	if (vm == NULL)
>   		return;
>   
> -	radeon_ring_write(ring, PACKET0(VM_CONTEXT0_PAGE_TABLE_START_ADDR + (vm->id << 2), 0));
> -	radeon_ring_write(ring, 0);
> -
> -	radeon_ring_write(ring, PACKET0(VM_CONTEXT0_PAGE_TABLE_END_ADDR + (vm->id << 2), 0));
> -	radeon_ring_write(ring, rdev->vm_manager.max_pfn);
> -
>   	radeon_ring_write(ring, PACKET0(VM_CONTEXT0_PAGE_TABLE_BASE_ADDR + (vm->id << 2), 0));
>   	radeon_ring_write(ring, vm->pd_gpu_addr >> 12);
>
diff mbox

Patch

diff --git a/drivers/gpu/drm/radeon/ni.c b/drivers/gpu/drm/radeon/ni.c
index cfb9276..cc0701a 100644
--- a/drivers/gpu/drm/radeon/ni.c
+++ b/drivers/gpu/drm/radeon/ni.c
@@ -776,7 +776,7 @@  static int cayman_pcie_gart_enable(struct radeon_device *rdev)
 	 */
 	for (i = 1; i < 8; i++) {
 		WREG32(VM_CONTEXT0_PAGE_TABLE_START_ADDR + (i << 2), 0);
-		WREG32(VM_CONTEXT0_PAGE_TABLE_END_ADDR + (i << 2), 0);
+		WREG32(VM_CONTEXT0_PAGE_TABLE_END_ADDR + (i << 2), rdev->vm_manager.max_pfn);
 		WREG32(VM_CONTEXT0_PAGE_TABLE_BASE_ADDR + (i << 2),
 			rdev->gart.table_addr >> 12);
 	}
@@ -1576,12 +1576,6 @@  void cayman_vm_flush(struct radeon_device *rdev, int ridx, struct radeon_vm *vm)
 	if (vm == NULL)
 		return;
 
-	radeon_ring_write(ring, PACKET0(VM_CONTEXT0_PAGE_TABLE_START_ADDR + (vm->id << 2), 0));
-	radeon_ring_write(ring, 0);
-
-	radeon_ring_write(ring, PACKET0(VM_CONTEXT0_PAGE_TABLE_END_ADDR + (vm->id << 2), 0));
-	radeon_ring_write(ring, rdev->vm_manager.max_pfn);
-
 	radeon_ring_write(ring, PACKET0(VM_CONTEXT0_PAGE_TABLE_BASE_ADDR + (vm->id << 2), 0));
 	radeon_ring_write(ring, vm->pd_gpu_addr >> 12);