Commit c5093cdd authored by Christian König's avatar Christian König

drm/amdgpu: drop the fence argument from amdgpu_vmid_grab

This is always the job anyway.
Signed-off-by: default avatarChristian König <christian.koenig@amd.com>
Reviewed-by: default avatarLuben Tuikov <luben.tuikov@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20221014084641.128280-5-christian.koenig@amd.com
parent 4f91790b
...@@ -244,7 +244,6 @@ static int amdgpu_vmid_grab_idle(struct amdgpu_vm *vm, ...@@ -244,7 +244,6 @@ static int amdgpu_vmid_grab_idle(struct amdgpu_vm *vm,
* @vm: vm to allocate id for * @vm: vm to allocate id for
* @ring: ring we want to submit job to * @ring: ring we want to submit job to
* @sync: sync object where we add dependencies * @sync: sync object where we add dependencies
* @fence: fence protecting ID from reuse
* @job: job who wants to use the VMID * @job: job who wants to use the VMID
* @id: resulting VMID * @id: resulting VMID
* *
...@@ -253,7 +252,6 @@ static int amdgpu_vmid_grab_idle(struct amdgpu_vm *vm, ...@@ -253,7 +252,6 @@ static int amdgpu_vmid_grab_idle(struct amdgpu_vm *vm,
static int amdgpu_vmid_grab_reserved(struct amdgpu_vm *vm, static int amdgpu_vmid_grab_reserved(struct amdgpu_vm *vm,
struct amdgpu_ring *ring, struct amdgpu_ring *ring,
struct amdgpu_sync *sync, struct amdgpu_sync *sync,
struct dma_fence *fence,
struct amdgpu_job *job, struct amdgpu_job *job,
struct amdgpu_vmid **id) struct amdgpu_vmid **id)
{ {
...@@ -290,7 +288,7 @@ static int amdgpu_vmid_grab_reserved(struct amdgpu_vm *vm, ...@@ -290,7 +288,7 @@ static int amdgpu_vmid_grab_reserved(struct amdgpu_vm *vm,
/* Good we can use this VMID. Remember this submission as /* Good we can use this VMID. Remember this submission as
* user of the VMID. * user of the VMID.
*/ */
r = amdgpu_sync_fence(&(*id)->active, fence); r = amdgpu_sync_fence(&(*id)->active, &job->base.s_fence->finished);
if (r) if (r)
return r; return r;
...@@ -305,7 +303,6 @@ static int amdgpu_vmid_grab_reserved(struct amdgpu_vm *vm, ...@@ -305,7 +303,6 @@ static int amdgpu_vmid_grab_reserved(struct amdgpu_vm *vm,
* @vm: vm to allocate id for * @vm: vm to allocate id for
* @ring: ring we want to submit job to * @ring: ring we want to submit job to
* @sync: sync object where we add dependencies * @sync: sync object where we add dependencies
* @fence: fence protecting ID from reuse
* @job: job who wants to use the VMID * @job: job who wants to use the VMID
* @id: resulting VMID * @id: resulting VMID
* *
...@@ -314,7 +311,6 @@ static int amdgpu_vmid_grab_reserved(struct amdgpu_vm *vm, ...@@ -314,7 +311,6 @@ static int amdgpu_vmid_grab_reserved(struct amdgpu_vm *vm,
static int amdgpu_vmid_grab_used(struct amdgpu_vm *vm, static int amdgpu_vmid_grab_used(struct amdgpu_vm *vm,
struct amdgpu_ring *ring, struct amdgpu_ring *ring,
struct amdgpu_sync *sync, struct amdgpu_sync *sync,
struct dma_fence *fence,
struct amdgpu_job *job, struct amdgpu_job *job,
struct amdgpu_vmid **id) struct amdgpu_vmid **id)
{ {
...@@ -352,7 +348,8 @@ static int amdgpu_vmid_grab_used(struct amdgpu_vm *vm, ...@@ -352,7 +348,8 @@ static int amdgpu_vmid_grab_used(struct amdgpu_vm *vm,
/* Good, we can use this VMID. Remember this submission as /* Good, we can use this VMID. Remember this submission as
* user of the VMID. * user of the VMID.
*/ */
r = amdgpu_sync_fence(&(*id)->active, fence); r = amdgpu_sync_fence(&(*id)->active,
&job->base.s_fence->finished);
if (r) if (r)
return r; return r;
...@@ -371,14 +368,12 @@ static int amdgpu_vmid_grab_used(struct amdgpu_vm *vm, ...@@ -371,14 +368,12 @@ static int amdgpu_vmid_grab_used(struct amdgpu_vm *vm,
* @vm: vm to allocate id for * @vm: vm to allocate id for
* @ring: ring we want to submit job to * @ring: ring we want to submit job to
* @sync: sync object where we add dependencies * @sync: sync object where we add dependencies
* @fence: fence protecting ID from reuse
* @job: job who wants to use the VMID * @job: job who wants to use the VMID
* *
* Allocate an id for the vm, adding fences to the sync obj as necessary. * Allocate an id for the vm, adding fences to the sync obj as necessary.
*/ */
int amdgpu_vmid_grab(struct amdgpu_vm *vm, struct amdgpu_ring *ring, int amdgpu_vmid_grab(struct amdgpu_vm *vm, struct amdgpu_ring *ring,
struct amdgpu_sync *sync, struct dma_fence *fence, struct amdgpu_sync *sync, struct amdgpu_job *job)
struct amdgpu_job *job)
{ {
struct amdgpu_device *adev = ring->adev; struct amdgpu_device *adev = ring->adev;
unsigned vmhub = ring->funcs->vmhub; unsigned vmhub = ring->funcs->vmhub;
...@@ -393,11 +388,11 @@ int amdgpu_vmid_grab(struct amdgpu_vm *vm, struct amdgpu_ring *ring, ...@@ -393,11 +388,11 @@ int amdgpu_vmid_grab(struct amdgpu_vm *vm, struct amdgpu_ring *ring,
goto error; goto error;
if (vm->reserved_vmid[vmhub]) { if (vm->reserved_vmid[vmhub]) {
r = amdgpu_vmid_grab_reserved(vm, ring, sync, fence, job, &id); r = amdgpu_vmid_grab_reserved(vm, ring, sync, job, &id);
if (r || !id) if (r || !id)
goto error; goto error;
} else { } else {
r = amdgpu_vmid_grab_used(vm, ring, sync, fence, job, &id); r = amdgpu_vmid_grab_used(vm, ring, sync, job, &id);
if (r) if (r)
goto error; goto error;
...@@ -406,7 +401,8 @@ int amdgpu_vmid_grab(struct amdgpu_vm *vm, struct amdgpu_ring *ring, ...@@ -406,7 +401,8 @@ int amdgpu_vmid_grab(struct amdgpu_vm *vm, struct amdgpu_ring *ring,
id = idle; id = idle;
/* Remember this submission as user of the VMID */ /* Remember this submission as user of the VMID */
r = amdgpu_sync_fence(&id->active, fence); r = amdgpu_sync_fence(&id->active,
&job->base.s_fence->finished);
if (r) if (r)
goto error; goto error;
......
...@@ -84,8 +84,7 @@ void amdgpu_vmid_free_reserved(struct amdgpu_device *adev, ...@@ -84,8 +84,7 @@ void amdgpu_vmid_free_reserved(struct amdgpu_device *adev,
struct amdgpu_vm *vm, struct amdgpu_vm *vm,
unsigned vmhub); unsigned vmhub);
int amdgpu_vmid_grab(struct amdgpu_vm *vm, struct amdgpu_ring *ring, int amdgpu_vmid_grab(struct amdgpu_vm *vm, struct amdgpu_ring *ring,
struct amdgpu_sync *sync, struct dma_fence *fence, struct amdgpu_sync *sync, struct amdgpu_job *job);
struct amdgpu_job *job);
void amdgpu_vmid_reset(struct amdgpu_device *adev, unsigned vmhub, void amdgpu_vmid_reset(struct amdgpu_device *adev, unsigned vmhub,
unsigned vmid); unsigned vmid);
void amdgpu_vmid_reset_all(struct amdgpu_device *adev); void amdgpu_vmid_reset_all(struct amdgpu_device *adev);
......
...@@ -256,9 +256,7 @@ static struct dma_fence *amdgpu_job_dependency(struct drm_sched_job *sched_job, ...@@ -256,9 +256,7 @@ static struct dma_fence *amdgpu_job_dependency(struct drm_sched_job *sched_job,
} }
while (fence == NULL && vm && !job->vmid) { while (fence == NULL && vm && !job->vmid) {
r = amdgpu_vmid_grab(vm, ring, &job->sync, r = amdgpu_vmid_grab(vm, ring, &job->sync, job);
&job->base.s_fence->finished,
job);
if (r) if (r)
DRM_ERROR("Error getting VM ID (%d)\n", r); DRM_ERROR("Error getting VM ID (%d)\n", r);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment