Skip to content

Commit

Permalink
drm/amdgpu: use drm_sched_job_add_resv_dependencies for moves
Browse files Browse the repository at this point in the history
Use the new common scheduler functions to figure out what to wait for.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Luben Tuikov <luben.tuikov@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20221014084641.128280-4-christian.koenig@amd.com
  • Loading branch information
Christian König committed Nov 3, 2022
1 parent 4d5230b commit 4f91790
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1966,17 +1966,11 @@ static int amdgpu_ttm_prepare_job(struct amdgpu_device *adev,
adev->gart.bo);
(*job)->vm_needs_flush = true;
}
if (resv) {
r = amdgpu_sync_resv(adev, &(*job)->sync, resv,
AMDGPU_SYNC_ALWAYS,
AMDGPU_FENCE_OWNER_UNDEFINED);
if (r) {
DRM_ERROR("sync failed (%d).\n", r);
amdgpu_job_free(*job);
return r;
}
}
return 0;
if (!resv)
return 0;

return drm_sched_job_add_resv_dependencies(&(*job)->base, resv,
DMA_RESV_USAGE_BOOKKEEP);
}

int amdgpu_copy_buffer(struct amdgpu_ring *ring, uint64_t src_offset,
Expand Down

0 comments on commit 4f91790

Please sign in to comment.