All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] drm/amdgpu: fix another missing fence reference in the CS code
@ 2023-01-05 11:17 Christian König
  2023-01-05 11:17 ` [PATCH 2/2] drm/amdgpu: fix missing dma_fence_put in error path Christian König
  0 siblings, 1 reply; 7+ messages in thread
From: Christian König @ 2023-01-05 11:17 UTC (permalink / raw)
  To: amd-gfx

drm_sched_job_add_dependency() consumes the references of the gang
members. Only triggered by mesh shaders.

Signed-off-by: Christian König <christian.koenig@amd.com>
Fixes: 1728baa7e4e6 ("drm/amdgpu: use scheduler dependencies for CS")
Tested-by: Mike Lothian <mike@fireburn.co.uk>
Tested-by: Bert Karwatzki <spasswolf@web.de>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
index 8516c814bc9b..47763ac0d14a 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
@@ -1254,9 +1254,12 @@ static int amdgpu_cs_submit(struct amdgpu_cs_parser *p,
 			continue;
 
 		fence = &p->jobs[i]->base.s_fence->scheduled;
+		dma_fence_get(fence);
 		r = drm_sched_job_add_dependency(&leader->base, fence);
-		if (r)
+		if (r) {
+			dma_fence_put(fence);
 			goto error_cleanup;
+		}
 	}
 
 	if (p->gang_size > 1) {
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2023-01-05 19:26 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-05 11:17 [PATCH 1/2] drm/amdgpu: fix another missing fence reference in the CS code Christian König
2023-01-05 11:17 ` [PATCH 2/2] drm/amdgpu: fix missing dma_fence_put in error path Christian König
2023-01-05 14:35   ` Alex Deucher
2023-01-05 16:12   ` Luben Tuikov
2023-01-05 16:50   ` Alex Deucher
2023-01-05 19:11     ` Christian König
2023-01-05 19:26       ` Alex Deucher

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.