drm/amdgpu: fix no sync_wait in copy_buffer
when eviction is happening, if don't handle dependency, then the fence could be dead off. Signed-off-by: Chunming Zhou <david1.zhou@amd.com> Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com> Reviewed-by: Christian K?nig <christian.koenig@amd.com>
This commit is contained in:
parent
3c62338c26
commit
9066b0c318
1 changed files with 7 additions and 1 deletions
|
@ -1014,13 +1014,19 @@ int amdgpu_copy_buffer(struct amdgpu_ring *ring,
|
||||||
/* for fence and sync */
|
/* for fence and sync */
|
||||||
num_dw += 64 + AMDGPU_NUM_SYNCS * 8;
|
num_dw += 64 + AMDGPU_NUM_SYNCS * 8;
|
||||||
|
|
||||||
|
r = amdgpu_sync_wait(&sync);
|
||||||
|
if (r) {
|
||||||
|
DRM_ERROR("sync wait failed (%d).\n", r);
|
||||||
|
amdgpu_sync_free(adev, &sync, NULL);
|
||||||
|
return r;
|
||||||
|
}
|
||||||
|
|
||||||
r = amdgpu_ring_lock(ring, num_dw);
|
r = amdgpu_ring_lock(ring, num_dw);
|
||||||
if (r) {
|
if (r) {
|
||||||
DRM_ERROR("ring lock failed (%d).\n", r);
|
DRM_ERROR("ring lock failed (%d).\n", r);
|
||||||
amdgpu_sync_free(adev, &sync, NULL);
|
amdgpu_sync_free(adev, &sync, NULL);
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
amdgpu_sync_rings(&sync, ring);
|
amdgpu_sync_rings(&sync, ring);
|
||||||
|
|
||||||
for (i = 0; i < num_loops; i++) {
|
for (i = 0; i < num_loops; i++) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue