diff options
author | Alex Deucher <alexander.deucher@amd.com> | 2012-10-02 14:39:18 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2012-10-02 14:39:18 -0400 |
commit | 76c44f2c0d008b60ce3058c51d85fa36d98c3681 (patch) | |
tree | 5e1503ec2b316b78482a0a6db56b376d5cae8603 /drivers/gpu/drm/radeon/si.c | |
parent | 27810fb2d2edacf2961dbedfe9e9f8d2e5080ea5 (diff) |
drm/radeon: use WRITE_DATA packets for vm flush on SI
This is the preferred packet for writing data to memory
or registers on SI.
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/si.c')
-rw-r--r-- | drivers/gpu/drm/radeon/si.c | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/drivers/gpu/drm/radeon/si.c b/drivers/gpu/drm/radeon/si.c index 156c9941e6c..916d1cb274c 100644 --- a/drivers/gpu/drm/radeon/si.c +++ b/drivers/gpu/drm/radeon/si.c | |||
@@ -2797,21 +2797,35 @@ void si_vm_flush(struct radeon_device *rdev, struct radeon_ib *ib) | |||
2797 | if (vm == NULL) | 2797 | if (vm == NULL) |
2798 | return; | 2798 | return; |
2799 | 2799 | ||
2800 | /* write new base address */ | ||
2801 | radeon_ring_write(ring, PACKET3(PACKET3_WRITE_DATA, 3)); | ||
2802 | radeon_ring_write(ring, (WRITE_DATA_ENGINE_SEL(0) | | ||
2803 | WRITE_DATA_DST_SEL(0))); | ||
2804 | |||
2800 | if (vm->id < 8) { | 2805 | if (vm->id < 8) { |
2801 | radeon_ring_write(ring, PACKET0(VM_CONTEXT0_PAGE_TABLE_BASE_ADDR | 2806 | radeon_ring_write(ring, |
2802 | + (vm->id << 2), 0)); | 2807 | (VM_CONTEXT0_PAGE_TABLE_BASE_ADDR + (vm->id << 2)) >> 2); |
2803 | } else { | 2808 | } else { |
2804 | radeon_ring_write(ring, PACKET0(VM_CONTEXT8_PAGE_TABLE_BASE_ADDR | 2809 | radeon_ring_write(ring, |
2805 | + ((vm->id - 8) << 2), 0)); | 2810 | (VM_CONTEXT8_PAGE_TABLE_BASE_ADDR + ((vm->id - 8) << 2)) >> 2); |
2806 | } | 2811 | } |
2812 | radeon_ring_write(ring, 0); | ||
2807 | radeon_ring_write(ring, vm->pd_gpu_addr >> 12); | 2813 | radeon_ring_write(ring, vm->pd_gpu_addr >> 12); |
2808 | 2814 | ||
2809 | /* flush hdp cache */ | 2815 | /* flush hdp cache */ |
2810 | radeon_ring_write(ring, PACKET0(HDP_MEM_COHERENCY_FLUSH_CNTL, 0)); | 2816 | radeon_ring_write(ring, PACKET3(PACKET3_WRITE_DATA, 3)); |
2817 | radeon_ring_write(ring, (WRITE_DATA_ENGINE_SEL(0) | | ||
2818 | WRITE_DATA_DST_SEL(0))); | ||
2819 | radeon_ring_write(ring, HDP_MEM_COHERENCY_FLUSH_CNTL >> 2); | ||
2820 | radeon_ring_write(ring, 0); | ||
2811 | radeon_ring_write(ring, 0x1); | 2821 | radeon_ring_write(ring, 0x1); |
2812 | 2822 | ||
2813 | /* bits 0-7 are the VM contexts0-7 */ | 2823 | /* bits 0-15 are the VM contexts0-15 */ |
2814 | radeon_ring_write(ring, PACKET0(VM_INVALIDATE_REQUEST, 0)); | 2824 | radeon_ring_write(ring, PACKET3(PACKET3_WRITE_DATA, 3)); |
2825 | radeon_ring_write(ring, (WRITE_DATA_ENGINE_SEL(0) | | ||
2826 | WRITE_DATA_DST_SEL(0))); | ||
2827 | radeon_ring_write(ring, VM_INVALIDATE_REQUEST >> 2); | ||
2828 | radeon_ring_write(ring, 0); | ||
2815 | radeon_ring_write(ring, 1 << ib->vm->id); | 2829 | radeon_ring_write(ring, 1 << ib->vm->id); |
2816 | } | 2830 | } |
2817 | 2831 | ||