drm/radeon: set VM base addr using the PFP v2
authorChristian König <christian.koenig@amd.com>
Wed, 30 Jul 2014 15:18:12 +0000 (17:18 +0200)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 5 Aug 2014 12:53:42 +0000 (08:53 -0400)
Seems to make VM flushes more stable on SI and CIK.

v2: only use the PFP on the GFX ring on CIK

Signed-off-by: Christian König <christian.koenig@amd.com>
Cc: stable@vger.kernel.org
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/radeon/cik.c
drivers/gpu/drm/radeon/si.c

index e6576b4b849dcddec9438aa90368aefde4e3b508..60c276538ba961d16ca7a13b971c491b44f8101c 100644 (file)
@@ -5942,12 +5942,13 @@ static void cik_vm_decode_fault(struct radeon_device *rdev,
 void cik_vm_flush(struct radeon_device *rdev, int ridx, struct radeon_vm *vm)
 {
        struct radeon_ring *ring = &rdev->ring[ridx];
+       int usepfp = (ridx == RADEON_RING_TYPE_GFX_INDEX);
 
        if (vm == NULL)
                return;
 
        radeon_ring_write(ring, PACKET3(PACKET3_WRITE_DATA, 3));
-       radeon_ring_write(ring, (WRITE_DATA_ENGINE_SEL(0) |
+       radeon_ring_write(ring, (WRITE_DATA_ENGINE_SEL(usepfp) |
                                 WRITE_DATA_DST_SEL(0)));
        if (vm->id < 8) {
                radeon_ring_write(ring,
@@ -5997,7 +5998,7 @@ void cik_vm_flush(struct radeon_device *rdev, int ridx, struct radeon_vm *vm)
        radeon_ring_write(ring, 1 << vm->id);
 
        /* compute doesn't have PFP */
-       if (ridx == RADEON_RING_TYPE_GFX_INDEX) {
+       if (usepfp) {
                /* sync PFP to ME, otherwise we might get invalid PFP reads */
                radeon_ring_write(ring, PACKET3(PACKET3_PFP_SYNC_ME, 0));
                radeon_ring_write(ring, 0x0);
index 6741804e4af25b0376c1ed156624217b4d9c9780..806bed1758d6aad2066c12672e4fb78da756089b 100644 (file)
@@ -5013,7 +5013,7 @@ void si_vm_flush(struct radeon_device *rdev, int ridx, struct radeon_vm *vm)
 
        /* write new base address */
        radeon_ring_write(ring, PACKET3(PACKET3_WRITE_DATA, 3));
-       radeon_ring_write(ring, (WRITE_DATA_ENGINE_SEL(0) |
+       radeon_ring_write(ring, (WRITE_DATA_ENGINE_SEL(1) |
                                 WRITE_DATA_DST_SEL(0)));
 
        if (vm->id < 8) {