diff options
author | Alex Deucher <alexander.deucher@amd.com> | 2016-06-17 17:05:15 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2016-07-07 14:54:46 -0400 |
commit | 93dcc37d2cc9d29e4cc36fd1cc8a9ca4f7109b1d (patch) | |
tree | b338ce6d6ce70cdeec24777eb88090fdb5d25363 /drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | |
parent | 9de06de80e260777c14a0a53ac4326c2d2a5e1eb (diff) |
drm/amdgpu: disable compute pipeline sync workaround when using fixed fw
No need to stall the pipe when we are using firmware with the
fix.
Reviewed-by: Chunming Zhou <david1.zhou@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c index adb87789cc34..8f04857fbe1b 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | |||
@@ -311,6 +311,32 @@ error: | |||
311 | return r; | 311 | return r; |
312 | } | 312 | } |
313 | 313 | ||
314 | static bool amdgpu_vm_ring_has_compute_vm_bug(struct amdgpu_ring *ring) | ||
315 | { | ||
316 | struct amdgpu_device *adev = ring->adev; | ||
317 | const struct amdgpu_ip_block_version *ip_block; | ||
318 | |||
319 | if (ring->type != AMDGPU_RING_TYPE_COMPUTE) | ||
320 | /* only compute rings */ | ||
321 | return false; | ||
322 | |||
323 | ip_block = amdgpu_get_ip_block(adev, AMD_IP_BLOCK_TYPE_GFX); | ||
324 | if (!ip_block) | ||
325 | return false; | ||
326 | |||
327 | if (ip_block->major <= 7) { | ||
328 | /* gfx7 has no workaround */ | ||
329 | return true; | ||
330 | } else if (ip_block->major == 8) { | ||
331 | if (adev->gfx.mec_fw_version >= 673) | ||
332 | /* gfx8 is fixed in MEC firmware 673 */ | ||
333 | return false; | ||
334 | else | ||
335 | return true; | ||
336 | } | ||
337 | return false; | ||
338 | } | ||
339 | |||
314 | /** | 340 | /** |
315 | * amdgpu_vm_flush - hardware flush the vm | 341 | * amdgpu_vm_flush - hardware flush the vm |
316 | * | 342 | * |
@@ -339,7 +365,7 @@ int amdgpu_vm_flush(struct amdgpu_ring *ring, | |||
339 | 365 | ||
340 | if (ring->funcs->emit_pipeline_sync && ( | 366 | if (ring->funcs->emit_pipeline_sync && ( |
341 | pd_addr != AMDGPU_VM_NO_FLUSH || gds_switch_needed || | 367 | pd_addr != AMDGPU_VM_NO_FLUSH || gds_switch_needed || |
342 | ring->type == AMDGPU_RING_TYPE_COMPUTE)) | 368 | amdgpu_vm_ring_has_compute_vm_bug(ring))) |
343 | amdgpu_ring_emit_pipeline_sync(ring); | 369 | amdgpu_ring_emit_pipeline_sync(ring); |
344 | 370 | ||
345 | if (ring->funcs->emit_vm_flush && | 371 | if (ring->funcs->emit_vm_flush && |