drm/amdgpu: add pipeline sync for compute job
authorChunming Zhou <[email protected]>
Wed, 27 Apr 2016 10:07:41 +0000 (18:07 +0800)
committerAlex Deucher <[email protected]>
Wed, 11 May 2016 16:31:16 +0000 (12:31 -0400)
hardware ring is async processed, the job is executed in parallel.
In some case, this will result vm fault, like jobs with different vmids.

This works around a CPC hw issue which will eventually be fixed in fw.

Signed-off-by: Chunming Zhou <[email protected]>
Reviewed-by: Alex Deucher <[email protected]>
Reviewed-by: Christian König <[email protected]>
Reviewed-by: Monk Liu <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c

index 692d0d02b644aeac6f5bc78ae4f2a438da8db878..62ce7253e91736ec9fc9267a7e37925e56033d1d 100644 (file)
@@ -300,7 +300,8 @@ int amdgpu_vm_flush(struct amdgpu_ring *ring,
        int r;
 
        if (ring->funcs->emit_pipeline_sync && (
-           pd_addr != AMDGPU_VM_NO_FLUSH || gds_switch_needed))
+           pd_addr != AMDGPU_VM_NO_FLUSH || gds_switch_needed ||
+                   ring->type == AMDGPU_RING_TYPE_COMPUTE))
                amdgpu_ring_emit_pipeline_sync(ring);
 
        if (ring->funcs->emit_vm_flush &&