drm/amdgpu: Drop unused fence argument from amdgpu_vmid_grab_used
Subsystems (2)
PATCH 1/3 drm/amdgpu: Drop unused fence argument from amdgpu_vmid_grab_used
From: Tvrtko Ursulin <[email protected]>
Fence argument is unused so lets drop it.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_ids.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ids.c +2 -4
@@ -342,15 +342,13 @@ static int amdgpu_vmid_grab_reserved(struct amdgpu_vm *vm,* @ring: ring we want to submit job to * @job: job who wants to use the VMID * @id: resulting VMID -* @fence: fence to wait for if no id could be grabbed * * Try to reuse a VMID for this submission. */ static int amdgpu_vmid_grab_used (struct amdgpu_vm *vm,struct amdgpu_ring *ring,struct amdgpu_job *job, -struct amdgpu_vmid **id, -struct dma_fence **fence) +struct amdgpu_vmid **id) {struct amdgpu_device *adev = ring->adev;unsigned vmhub = ring->vm_hub;
@@ -429,7 +427,7 @@ int amdgpu_vmid_grab(struct amdgpu_vm *vm, struct amdgpu_ring *ring,if (r || !id) goto error; }else { - r =amdgpu_vmid_grab_used (vm, ring, job, &id, fence); + r =amdgpu_vmid_grab_used (vm, ring, job, &id);if (r) goto error;
Signature · 1 line
2.46.0
PATCH 2/3 drm/amdgpu: Drop impossible condition from amdgpu_job_prepare_job
From: Tvrtko Ursulin <[email protected]>
Fence has been initialised to NULL so no need to test it.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_job.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_job.c +1 -1
@@ -353,7 +353,7 @@ amdgpu_job_prepare_job(struct drm_sched_job *sched_job,if (r) goto error; -if (!fence && job->gang_submit) +if (job->gang_submit) fence =amdgpu_device_switch_gang (ring->adev, job->gang_submit);while (!fence && job->vm && !job->vmid) {
Signature · 1 line
2.46.0
PATCH 3/3 drm/amdgpu: Remove the while loop from amdgpu_job_prepare_job
In reply to Tvrtko UrsulinFrom: Tvrtko Ursulin <[email protected]>
While loop makes it sound like amdgpu_vmid_grab() potentially needs to be called multiple times to produce a fence, while in reality all code paths either return an error, assign a valid job->vmid or assign a vmid which will be valid once the returned fence signals.
Therefore we can remove the loop to make it clear the call does not need to be repeated.
---
I stared for a good while, going back and forth, and couldn't see that the while loop is needed. But maybe I missed something?
--- drivers/gpu/drm/amd/amdgpu/amdgpu_job.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_job.c +1 -1
@@ -356,7 +356,7 @@ amdgpu_job_prepare_job(struct drm_sched_job *sched_job,if (job->gang_submit) fence =amdgpu_device_switch_gang (ring->adev, job->gang_submit); -while (!fence && job->vm && !job->vmid) { +if (!fence && job->vm && !job->vmid) { r =amdgpu_vmid_grab (job->vm, ring, job, &fence);if (r) {dev_err (ring->adev->dev,"Error getting VM ID (%d)\n" , r);
Signature · 1 line
2.46.0
Re: [PATCH 3/3] drm/amdgpu: Remove the while loop from amdgpu_job_prepare_job
Am 24.09.24 um 11:51 schrieb Tvrtko Ursulin:
Quoted 7 lines
From: Tvrtko Ursulin <[email protected]>
While loop makes it sound like
amdgpu_vmid_grab()potentially needs to be called multiple times to produce a fence, while in reality all code paths either return an error, assign a validjob->vmidor assign a vmid which will be valid once the returned fence signals.
Quoted 5 lines
Therefore we can remove the loop to make it clear the call does not need to be repeated.
Signed-off-by Tvrtko Ursulin <[email protected]>Cc Christian König <[email protected]>
Oh yeah that's a leftover from when we still had the dependency handling inside all this.
Quoted 20 lines
---
I stared for a good while, going back and forth, and couldn't see that the while loop is needed. But maybe I missed something?--- drivers/gpu/drm/amd/amdgpu/amdgpu_job.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/amd/amdgpu/amdgpu_job.c +1
-1@@ -356,7 +356,7 @@ amdgpu_job_prepare_job(struct drm_sched_job *sched_job,if (job->gang_submit) fence =amdgpu_device_switch_gang (ring->adev, job->gang_submit); -while (!fence && job->vm && !job->vmid) { +if (!fence && job->vm && !job->vmid) { r =amdgpu_vmid_grab (job->vm, ring, job, &fence);if (r) {dev_err (ring->adev->dev,"Error getting VM ID (%d)\n" , r);
Re: [PATCH 3/3] drm/amdgpu: Remove the while loop from amdgpu_job_prepare_job
Quoted 11 lines · Christian König
Am 24.09.24 um 11:51 schrieb Tvrtko Ursulin:
Quoted 10 lines
From: Tvrtko Ursulin <[email protected]>
While loop makes it sound like
amdgpu_vmid_grab()potentially needs to be called multiple times to produce a fence, while in reality all code paths either return an error, assign a validjob->vmidor assign a vmid which will be valid once the returned fence signals.Therefore we can remove the loop to make it clear the call does not need to be repeated.
Quoted 6 lines
Quoted 2 lines
Signed-off-by Tvrtko Ursulin <[email protected]>Cc Christian König <[email protected]>Oh yeah that's a leftover from when we still had the dependency handling inside all this.
Thanks - CC Alex if you could merge the trivial series please?
Regards,
Tvrtko
Quoted 21 lines
Quoted 20 lines
---
I stared for a good while, going back and forth, and couldn't see that the while loop is needed. But maybe I missed something?
---
drivers/gpu/drm/amd/amdgpu/amdgpu_job.c| 2 +-1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/amd/amdgpu/amdgpu_job.c +1
-1@@ -356,7 +356,7 @@ amdgpu_job_prepare_job(struct drm_sched_job *sched_job, if (job->gang_submit) fence = amdgpu_device_switch_gang(ring->adev, job->gang_submit); - while (!fence && job->vm && !job->vmid) { + if (!fence && job->vm && !job->vmid) { r = amdgpu_vmid_grab(job->vm, ring, job, &fence); if (r) { dev_err(ring->adev->dev, "Error getting VM ID (%d)\n", r);
Alex Deucher
AppliedRe: [PATCH 3/3] drm/amdgpu: Remove the while loop from amdgpu_job_prepare_job
Applied. Thanks!
Alex
Quoted 53 lines · Tvrtko Ursulin
Quoted 11 lines · Christian König
Am 24.09.24 um 11:51 schrieb Tvrtko Ursulin:
Quoted 10 lines
From: Tvrtko Ursulin <[email protected]>
While loop makes it sound like
amdgpu_vmid_grab()potentially needs to be called multiple times to produce a fence, while in reality all code paths either return an error, assign a validjob->vmidor assign a vmid which will be valid once the returned fence signals.Therefore we can remove the loop to make it clear the call does not need to be repeated.
Quoted 8 lines
Quoted 2 lines
Signed-off-by Tvrtko Ursulin <[email protected]>Cc Christian König <[email protected]>Oh yeah that's a leftover from when we still had the dependency handling inside all this.
series.
Thanks - CC Alex if you could merge the trivial series please?
Regards,
Tvrtko
Quoted 24 lines
Quoted 23 lines
---
I stared for a good while, going back and forth, and couldn't see that the
while loop is needed. But maybe I missed something?--- drivers/gpu/drm/amd/amdgpu/amdgpu_job.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/amd/amdgpu/amdgpu_job.c +1
-1@@ -356,7 +356,7 @@ amdgpu_job_prepare_job(struct drm_sched_job *sched_job, if (job->gang_submit) fence = amdgpu_device_switch_gang(ring->adev, job->gang_submit); -while (!fence && job->vm && !job->vmid) { +if (!fence && job->vm && !job->vmid) { r =amdgpu_vmid_grab (job->vm, ring, job, &fence);if (r) {dev_err(ring->adev->dev, "Error getting VM ID (%d)\n", r);
Re: [PATCH 3/3] drm/amdgpu: Remove the while loop from amdgpu_job_prepare_job
Quoted 1 line · Alex Deucher
Applied. Thanks!
Thanks Alex!
Could you perhaps also merge https://lore.kernel.org/amd-gfx/[email protected]/ via your tree? If it still applies that is.
Regards,
Tvrtko
Quoted 54 lines · Tvrtko Ursulin
Quoted 53 lines · Christian König
Quoted 11 lines
Am 24.09.24 um 11:51 schrieb Tvrtko Ursulin:
Quoted 10 lines
From: Tvrtko Ursulin <[email protected]>
While loop makes it sound like
amdgpu_vmid_grab()potentially needs to be called multiple times to produce a fence, while in reality all code paths either return an error, assign a validjob->vmidor assign a vmid which will be valid once the returned fence signals.Therefore we can remove the loop to make it clear the call does not need to be repeated.
Quoted 8 lines
Quoted 2 lines
Signed-off-by Tvrtko Ursulin <[email protected]>Cc Christian König <[email protected]>Oh yeah that's a leftover from when we still had the dependency handling inside all this.
series.
Thanks - CC Alex if you could merge the trivial series please?
Regards,
Tvrtko
Quoted 24 lines
Quoted 23 lines
---
I stared for a good while, going back and forth, and couldn't see that the
while loop is needed. But maybe I missed something?--- drivers/gpu/drm/amd/amdgpu/amdgpu_job.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/amd/amdgpu/amdgpu_job.c +1
-1@@ -356,7 +356,7 @@ amdgpu_job_prepare_job(struct drm_sched_job *sched_job, if (job->gang_submit) fence = amdgpu_device_switch_gang(ring->adev, job->gang_submit); -while (!fence && job->vm && !job->vmid) { +if (!fence && job->vm && !job->vmid) { r =amdgpu_vmid_grab (job->vm, ring, job, &fence);if (r) {dev_err(ring->adev->dev, "Error getting VM ID (%d)\n", r);
Re: [PATCH 3/3] drm/amdgpu: Remove the while loop from amdgpu_job_prepare_job
Quoted 10 lines · Tvrtko Ursulin
Quoted 1 line · Alex Deucher
Applied. Thanks!
Thanks Alex!
Could you perhaps also merge
https://lore.kernel.org/amd-gfx/[email protected]/
via your tree? If it still applies that is.
Just picked it up. Thanks!
Alex
Quoted 59 lines
Regards,
Tvrtko
Quoted 54 lines · Tvrtko Ursulin
Quoted 53 lines · Christian König
Quoted 11 lines
Am 24.09.24 um 11:51 schrieb Tvrtko Ursulin:
Quoted 10 lines
From: Tvrtko Ursulin <[email protected]>
While loop makes it sound like
amdgpu_vmid_grab()potentially needs to be called multiple times to produce a fence, while in reality all code paths either return an error, assign a validjob->vmidor assign a vmid which will be valid once the returned fence signals.Therefore we can remove the loop to make it clear the call does not need to be repeated.
Quoted 8 lines
Quoted 2 lines
Signed-off-by Tvrtko Ursulin <[email protected]>Cc Christian König <[email protected]>Oh yeah that's a leftover from when we still had the dependency handling inside all this.
series.
Thanks - CC Alex if you could merge the trivial series please?
Regards,
Tvrtko
Quoted 24 lines
Quoted 23 lines
---
I stared for a good while, going back and forth, and couldn't see that the
while loop is needed. But maybe I missed something?--- drivers/gpu/drm/amd/amdgpu/amdgpu_job.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/amd/amdgpu/amdgpu_job.c +1
-1@@ -356,7 +356,7 @@ amdgpu_job_prepare_job(struct drm_sched_job *sched_job, if (job->gang_submit) fence = amdgpu_device_switch_gang(ring->adev, job->gang_submit); -while (!fence && job->vm && !job->vmid) { +if (!fence && job->vm && !job->vmid) { r =amdgpu_vmid_grab (job->vm, ring, job, &fence);if (r) {dev_err(ring->adev->dev, "Error getting VM ID (%d)\n", r);
Re: [PATCH 3/3] drm/amdgpu: Remove the while loop from amdgpu_job_prepare_job
Quoted 6 lines · Alex Deucher
Quoted 5 lines · Tvrtko Ursulin
Quoted 1 line · Alex Deucher
Applied. Thanks!
Quoted 7 lines
Quoted 5 lines
Thanks Alex!
Could you perhaps also merge
https://lore.kernel.org/amd-gfx/[email protected]/
via your tree? If it still applies that is.Just picked it up. Thanks!
Did you get only 1/2? 2/2 needs more work/review you think or?
Regards,
Tvrtko
Quoted 61 lines
Alex
Quoted 59 lines
Regards,
Tvrtko
Quoted 54 lines · Tvrtko Ursulin
Quoted 53 lines · Christian König
Quoted 11 lines
Am 24.09.24 um 11:51 schrieb Tvrtko Ursulin:
Quoted 10 lines
From: Tvrtko Ursulin <[email protected]>
While loop makes it sound like
amdgpu_vmid_grab()potentially needs to be called multiple times to produce a fence, while in reality all code paths either return an error, assign a validjob->vmidor assign a vmid which will be valid once the returned fence signals.Therefore we can remove the loop to make it clear the call does not need to be repeated.
Quoted 8 lines
Quoted 2 lines
Signed-off-by Tvrtko Ursulin <[email protected]>Cc Christian König <[email protected]>Oh yeah that's a leftover from when we still had the dependency handling inside all this.
series.
Thanks - CC Alex if you could merge the trivial series please?
Regards,
Tvrtko
Quoted 24 lines
Quoted 23 lines
---
I stared for a good while, going back and forth, and couldn't see that the
while loop is needed. But maybe I missed something?--- drivers/gpu/drm/amd/amdgpu/amdgpu_job.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/amd/amdgpu/amdgpu_job.c +1
-1@@ -356,7 +356,7 @@ amdgpu_job_prepare_job(struct drm_sched_job *sched_job, if (job->gang_submit) fence = amdgpu_device_switch_gang(ring->adev, job->gang_submit); -while (!fence && job->vm && !job->vmid) { +if (!fence && job->vm && !job->vmid) { r =amdgpu_vmid_grab (job->vm, ring, job, &fence);if (r) {dev_err(ring->adev->dev, "Error getting VM ID (%d)\n", r);
Re: [PATCH 3/3] drm/amdgpu: Remove the while loop from amdgpu_job_prepare_job
Quoted 11 lines · Tvrtko Ursulin
Quoted 8 lines · Alex Deucher
Quoted 7 lines · Tvrtko Ursulin
Quoted 1 line · Alex Deucher
Applied. Thanks!
Thanks Alex!
Quoted 7 lines
Quoted 5 lines
Quoted 3 lines
Could you perhaps also merge
https://lore.kernel.org/amd-gfx/[email protected]/
via your tree? If it still applies that is.Just picked it up. Thanks!
Did you get only 1/2? 2/2 needs more work/review you think or?
I picked up both. The second patch was still in the CI pipeline when I pushed out an updated branch yesterday. I'll push an updated tree today.
Alex
Quoted 66 lines
Regards,
Tvrtko
Quoted 61 lines
Alex
Quoted 59 lines
Regards,
Tvrtko
Quoted 54 lines · Tvrtko Ursulin
Quoted 53 lines · Christian König
Quoted 11 lines
Am 24.09.24 um 11:51 schrieb Tvrtko Ursulin:
Quoted 10 lines
From: Tvrtko Ursulin <[email protected]>
While loop makes it sound like
amdgpu_vmid_grab()potentially needs to be called multiple times to produce a fence, while in reality all code paths either return an error, assign a validjob->vmidor assign a vmid which will be valid once the returned fence signals.Therefore we can remove the loop to make it clear the call does not need to be repeated.
Quoted 8 lines
Quoted 2 lines
Signed-off-by Tvrtko Ursulin <[email protected]>Cc Christian König <[email protected]>Oh yeah that's a leftover from when we still had the dependency handling inside all this.
series.
Thanks - CC Alex if you could merge the trivial series please?
Regards,
Tvrtko
Quoted 24 lines
Quoted 23 lines
---
I stared for a good while, going back and forth, and couldn't see that the
while loop is needed. But maybe I missed something?--- drivers/gpu/drm/amd/amdgpu/amdgpu_job.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/amd/amdgpu/amdgpu_job.c +1
-1@@ -356,7 +356,7 @@ amdgpu_job_prepare_job(struct drm_sched_job *sched_job, if (job->gang_submit) fence = amdgpu_device_switch_gang(ring->adev, job->gang_submit); -while (!fence && job->vm && !job->vmid) { +if (!fence && job->vm && !job->vmid) { r =amdgpu_vmid_grab (job->vm, ring, job, &fence);if (r) {dev_err(ring->adev->dev, "Error getting VM ID (%d)\n", r);