diff options
author | 2022-09-28 14:00:57 +0200 | |
---|---|---|
committer | 2022-11-03 12:45:19 +0100 | |
commit | 940ca22b7ea9db6857ba7c6adb961b84d8cc28ff (patch) | |
tree | f03d5ac59c0fc42773ea8495c95fd98fdc63f8aa /drivers/gpu/drm/amd/amdgpu/amdgpu_job.c | |
parent | drm/amdgpu: drop the fence argument from amdgpu_vmid_grab (diff) | |
download | linux-940ca22b7ea9db6857ba7c6adb961b84d8cc28ff.tar.gz linux-940ca22b7ea9db6857ba7c6adb961b84d8cc28ff.tar.bz2 linux-940ca22b7ea9db6857ba7c6adb961b84d8cc28ff.zip |
drm/amdgpu: drop amdgpu_sync from amdgpu_vmid_grab v2
Instead return the fence directly. Avoids memory allocation to store the
fence.
v2: cleanup coding style as well
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-6-christian.koenig@amd.com
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_job.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_job.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c index 5aa053acc0b4..384149a81978 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c @@ -239,12 +239,12 @@ int amdgpu_job_submit_direct(struct amdgpu_job *job, struct amdgpu_ring *ring, return 0; } -static struct dma_fence *amdgpu_job_dependency(struct drm_sched_job *sched_job, - struct drm_sched_entity *s_entity) +static struct dma_fence * +amdgpu_job_dependency(struct drm_sched_job *sched_job, + struct drm_sched_entity *s_entity) { struct amdgpu_ring *ring = to_amdgpu_ring(s_entity->rq->sched); struct amdgpu_job *job = to_amdgpu_job(sched_job); - struct amdgpu_vm *vm = job->vm; struct dma_fence *fence; int r; @@ -255,12 +255,10 @@ static struct dma_fence *amdgpu_job_dependency(struct drm_sched_job *sched_job, DRM_ERROR("Error adding fence (%d)\n", r); } - while (fence == NULL && vm && !job->vmid) { - r = amdgpu_vmid_grab(vm, ring, &job->sync, job); + while (!fence && job->vm && !job->vmid) { + r = amdgpu_vmid_grab(job->vm, ring, job, &fence); if (r) DRM_ERROR("Error getting VM ID (%d)\n", r); - - fence = amdgpu_sync_get_fence(&job->sync); } if (!fence && job->gang_submit) |