summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c
diff options
context:
space:
mode:
authorChristian König <christian.koenig@amd.com>2016-03-01 18:46:18 +0300
committerAlex Deucher <alexander.deucher@amd.com>2016-05-05 03:19:24 +0300
commit41d9eb2c5a2a21c9120e906d077e77562883510e (patch)
tree6adb5a48873d307ba2911cdd8e1b94419a00d9ba /drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c
parent832a902f9433b812f829e9f2257daf5d518cf0de (diff)
downloadlinux-41d9eb2c5a2a21c9120e906d077e77562883510e.tar.xz
drm/amdgpu: add a fence after the VM flush
This way we can track when the flush is done. Signed-off-by: Christian König <christian.koenig@amd.com> Acked-by: Alex Deucher <alexander.deucher@amd.com> 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_ib.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c
index 644336d76aca..83973d051080 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c
@@ -155,10 +155,14 @@ int amdgpu_ib_schedule(struct amdgpu_ring *ring, unsigned num_ibs,
if (vm) {
/* do context switch */
- amdgpu_vm_flush(ring, ib->vm_id, ib->vm_pd_addr,
- ib->gds_base, ib->gds_size,
- ib->gws_base, ib->gws_size,
- ib->oa_base, ib->oa_size);
+ r = amdgpu_vm_flush(ring, ib->vm_id, ib->vm_pd_addr,
+ ib->gds_base, ib->gds_size,
+ ib->gws_base, ib->gws_size,
+ ib->oa_base, ib->oa_size);
+ if (r) {
+ amdgpu_ring_undo(ring);
+ return r;
+ }
if (ring->funcs->emit_hdp_flush)
amdgpu_ring_emit_hdp_flush(ring);