diff options
author | Christian König <christian.koenig@amd.com> | 2017-04-03 14:28:26 +0200 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2017-04-04 23:34:15 -0400 |
commit | f7d015b90dd48c94ab43380a735acf2b3c2c62bf (patch) | |
tree | 51163ee908524d6b915bff2edc1d7db3ab22ee8e /drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | |
parent | c0e51931a1cf35be9f146b44e2b9e7ac575fa411 (diff) | |
download | linux-f7d015b90dd48c94ab43380a735acf2b3c2c62bf.tar.gz linux-f7d015b90dd48c94ab43380a735acf2b3c2c62bf.tar.bz2 linux-f7d015b90dd48c94ab43380a735acf2b3c2c62bf.zip |
drm/amdgpu: cleanup logic in amdgpu_vm_flush
Remove some of the extra checks where they don't hurt us.
Reviewed-by: Junwei Zhang <Jerry.Zhang@amd.com>
Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@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 | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c index 99889fb486a0..9225493c8366 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c @@ -597,26 +597,26 @@ int amdgpu_vm_flush(struct amdgpu_ring *ring, struct amdgpu_job *job) id->gws_size != job->gws_size || id->oa_base != job->oa_base || 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; int r; - if (!job->vm_needs_flush && !gds_switch_needed && - !amdgpu_vm_had_gpu_reset(adev, id) && - !amdgpu_vm_ring_has_compute_vm_bug(ring)) - return 0; + if (amdgpu_vm_had_gpu_reset(adev, id)) { + gds_switch_needed = true; + vm_flush_needed = true; + } + if (!vm_flush_needed && !gds_switch_needed) + return 0; if (ring->funcs->init_cond_exec) patch_offset = amdgpu_ring_init_cond_exec(ring); - if (ring->funcs->emit_pipeline_sync && - (job->vm_needs_flush || gds_switch_needed || - amdgpu_vm_ring_has_compute_vm_bug(ring))) + if (ring->funcs->emit_pipeline_sync) amdgpu_ring_emit_pipeline_sync(ring); - if (ring->funcs->emit_vm_flush && - (job->vm_needs_flush || amdgpu_vm_had_gpu_reset(adev, id))) { - + if (ring->funcs->emit_vm_flush && vm_flush_needed) { u64 pd_addr = amdgpu_vm_adjust_mc_addr(adev, job->vm_pd_addr); struct dma_fence *fence; |