drm/amdgpu: hdp flush&inval should always do
authorMonk Liu <Monk.Liu@amd.com>
Wed, 4 May 2016 08:27:41 +0000 (16:27 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 11 May 2016 16:31:17 +0000 (12:31 -0400)
This fixes Tonga vm-fault issue when running disaster
(a multiple context GL heavy tests),
We should always flush & invalidate hdp no matter vm
used or not.

Signed-off-by: Monk Liu <Monk.Liu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Chunming Zhou <David1.Zhou@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c

index 0ed6430363613818651af19fe8f646ec5e5837ed..89f33d5e8731d1cecff8190b02b63744004f869f 100644 (file)
@@ -163,11 +163,11 @@ int amdgpu_ib_schedule(struct amdgpu_ring *ring, unsigned num_ibs,
                        amdgpu_ring_undo(ring);
                        return r;
                }
-
-               if (ring->funcs->emit_hdp_flush)
-                       amdgpu_ring_emit_hdp_flush(ring);
        }
 
+       if (ring->funcs->emit_hdp_flush)
+               amdgpu_ring_emit_hdp_flush(ring);
+
        /* always set cond_exec_polling to CONTINUE */
        *ring->cond_exe_cpu_addr = 1;
 
@@ -178,10 +178,8 @@ int amdgpu_ib_schedule(struct amdgpu_ring *ring, unsigned num_ibs,
                ring->current_ctx = ctx;
        }
 
-       if (vm) {
-               if (ring->funcs->emit_hdp_invalidate)
-                       amdgpu_ring_emit_hdp_invalidate(ring);
-       }
+       if (ring->funcs->emit_hdp_invalidate)
+               amdgpu_ring_emit_hdp_invalidate(ring);
 
        r = amdgpu_fence_emit(ring, &hwf);
        if (r) {