summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
diff options
context:
space:
mode:
authorChristian König <christian.koenig@amd.com>2015-07-06 22:06:40 +0200
committerAlex Deucher <alexander.deucher@amd.com>2015-08-17 16:50:13 -0400
commit91e1a5207edec9e4f888e44478a9a254186e0ba8 (patch)
treed03a1e06f744981034fb67eeb15b8d1644816278 /drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
parent0b492a4c92050862a9780b941d52c05923fcd669 (diff)
downloadlwn-91e1a5207edec9e4f888e44478a9a254186e0ba8.tar.gz
lwn-91e1a5207edec9e4f888e44478a9a254186e0ba8.zip
drm/amdgpu: deal with foreign fences in amdgpu_sync
This also requires some error handling from the callers of that function. Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com> Reviewed-by: Chunming Zhou <david1.zhou@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
index 1f040d85ac47..53e6a10fe9f9 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
@@ -482,6 +482,8 @@ static int amdgpu_bo_vm_update_pte(struct amdgpu_cs_parser *p,
if (p->bo_list) {
for (i = 0; i < p->bo_list->num_entries; i++) {
+ struct fence *f;
+
/* ignore duplicates */
bo = p->bo_list->array[i].robj;
if (!bo)
@@ -495,7 +497,10 @@ static int amdgpu_bo_vm_update_pte(struct amdgpu_cs_parser *p,
if (r)
return r;
- amdgpu_sync_fence(&p->ibs[0].sync, bo_va->last_pt_update);
+ f = &bo_va->last_pt_update->base;
+ r = amdgpu_sync_fence(adev, &p->ibs[0].sync, f);
+ if (r)
+ return r;
}
}
@@ -715,9 +720,12 @@ static int amdgpu_cs_dependencies(struct amdgpu_device *adev,
return r;
}
- amdgpu_sync_fence(&ib->sync, fence);
+ r = amdgpu_sync_fence(adev, &ib->sync, &fence->base);
amdgpu_fence_unref(&fence);
amdgpu_ctx_put(ctx);
+
+ if (r)
+ return r;
}
}