diff options
author | Christian König <christian.koenig@amd.com> | 2016-03-01 17:51:53 +0300 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2016-03-08 19:01:50 +0300 |
commit | d564a06e1c9c285bab1c1579c18c811aa1271884 (patch) | |
tree | 049470cb0c185c934e831b2f5b3ade387827e5ee /drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | |
parent | b8c7b39ec1db98199df5bee33ca145ed9c2c62e7 (diff) | |
download | linux-d564a06e1c9c285bab1c1579c18c811aa1271884.tar.xz |
drm/amdgpu: if a GDS switch is needed emit a pipeline sync as well
Otherwise we might change the GDS settings while they are still in use.
Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Chunming Zhou <david1.zhou@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c index 9a9abbab9b7c..a0896c761108 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c @@ -254,22 +254,24 @@ void amdgpu_vm_flush(struct amdgpu_ring *ring, { struct amdgpu_device *adev = ring->adev; struct amdgpu_vm_manager_id *mgr_id = &adev->vm_manager.ids[vm_id]; + bool gds_switch_needed = ring->funcs->emit_gds_switch && ( + mgr_id->gds_base != gds_base || + mgr_id->gds_size != gds_size || + mgr_id->gws_base != gws_base || + mgr_id->gws_size != gws_size || + mgr_id->oa_base != oa_base || + mgr_id->oa_size != oa_size); + + if (ring->funcs->emit_pipeline_sync && ( + pd_addr != AMDGPU_VM_NO_FLUSH || gds_switch_needed)) + amdgpu_ring_emit_pipeline_sync(ring); if (pd_addr != AMDGPU_VM_NO_FLUSH) { trace_amdgpu_vm_flush(pd_addr, ring->idx, vm_id); - if (ring->funcs->emit_pipeline_sync) - amdgpu_ring_emit_pipeline_sync(ring); amdgpu_ring_emit_vm_flush(ring, vm_id, pd_addr); } - if (ring->funcs->emit_gds_switch && ( - mgr_id->gds_base != gds_base || - mgr_id->gds_size != gds_size || - mgr_id->gws_base != gws_base || - mgr_id->gws_size != gws_size || - mgr_id->oa_base != oa_base || - mgr_id->oa_size != oa_size)) { - + if (gds_switch_needed) { mgr_id->gds_base = gds_base; mgr_id->gds_size = gds_size; mgr_id->gws_base = gws_base; |