Commit f7d015b9 authored by Christian König's avatar Christian König Committed by Alex Deucher

drm/amdgpu: cleanup logic in amdgpu_vm_flush

Remove some of the extra checks where they don't hurt us.
Reviewed-by: default avatarJunwei Zhang <Jerry.Zhang@amd.com>
Signed-off-by: default avatarChristian König <christian.koenig@amd.com>
Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent c0e51931
...@@ -597,26 +597,26 @@ int amdgpu_vm_flush(struct amdgpu_ring *ring, struct amdgpu_job *job) ...@@ -597,26 +597,26 @@ int amdgpu_vm_flush(struct amdgpu_ring *ring, struct amdgpu_job *job)
id->gws_size != job->gws_size || id->gws_size != job->gws_size ||
id->oa_base != job->oa_base || id->oa_base != job->oa_base ||
id->oa_size != job->oa_size); id->oa_size != job->oa_size);
bool vm_flush_needed = job->vm_needs_flush ||
amdgpu_vm_ring_has_compute_vm_bug(ring);
unsigned patch_offset = 0; unsigned patch_offset = 0;
int r; int r;
if (!job->vm_needs_flush && !gds_switch_needed && if (amdgpu_vm_had_gpu_reset(adev, id)) {
!amdgpu_vm_had_gpu_reset(adev, id) && gds_switch_needed = true;
!amdgpu_vm_ring_has_compute_vm_bug(ring)) vm_flush_needed = true;
return 0; }
if (!vm_flush_needed && !gds_switch_needed)
return 0;
if (ring->funcs->init_cond_exec) if (ring->funcs->init_cond_exec)
patch_offset = amdgpu_ring_init_cond_exec(ring); patch_offset = amdgpu_ring_init_cond_exec(ring);
if (ring->funcs->emit_pipeline_sync && if (ring->funcs->emit_pipeline_sync)
(job->vm_needs_flush || gds_switch_needed ||
amdgpu_vm_ring_has_compute_vm_bug(ring)))
amdgpu_ring_emit_pipeline_sync(ring); amdgpu_ring_emit_pipeline_sync(ring);
if (ring->funcs->emit_vm_flush && if (ring->funcs->emit_vm_flush && vm_flush_needed) {
(job->vm_needs_flush || amdgpu_vm_had_gpu_reset(adev, id))) {
u64 pd_addr = amdgpu_vm_adjust_mc_addr(adev, job->vm_pd_addr); u64 pd_addr = amdgpu_vm_adjust_mc_addr(adev, job->vm_pd_addr);
struct dma_fence *fence; struct dma_fence *fence;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment