Skip to contentSkip to conversation

drm/vc4: Release fence after signalling

PATCH In review Stefan Schake 3 participants 3 messages Dec 2, 2017 – Dec 8, 2017

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/vc4: Release fence after signalling

We were never releasing the initial fence reference that is obtained through dma_fence_init.

Fixes cdec4d361323 ("drm/vc4: Expose dma-buf fences for V3D rendering.")
---
 drivers/gpu/drm/vc4/vc4_gem.c | 4 +++-
 drivers/gpu/drm/vc4/vc4_irq.c | 1 +
 2 files changed, 4 insertions(+), 1 deletion(-)
drivers/gpu/drm/vc4/vc4_gem.c +3 -1
index 6c32c89..6385409 100644
@@ -888,8 +888,10 @@ struct vc4_hang_state {
 	/* If we got force-completed because of GPU reset rather than
 	 * through our IRQ handler, signal the fence now.
 	 */
-	if (exec->fence)
+	if (exec->fence) {
 		dma_fence_signal(exec->fence);
+		dma_fence_put(exec->fence);
+	}
 
 	if (exec->bo) {
 		for (i = 0; i < exec->bo_count; i++) {
drivers/gpu/drm/vc4/vc4_irq.c +1 -0
index 61b2e53..26eddbb 100644
@@ -139,6 +139,7 @@
 	list_move_tail(&exec->head, &vc4->job_done_list);
 	if (exec->fence) {
 		dma_fence_signal_locked(exec->fence);
+		dma_fence_put(exec->fence);
 		exec->fence = NULL;
 	}
 	vc4_submit_next_render_job(dev);
Signature · 6 lines
1.9.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#1 lore raw

Quoting Stefan Schake (2017-12-02 17:40:39)

Quoted 6 lines

We were never releasing the initial fence reference that is obtained through dma_fence_init.

Fixes cdec4d361323 ("drm/vc4: Expose dma-buf fences for V3D rendering.")

Maarten wrote an identical patch, [email protected], if you could coordinate between yourselves to deliver a reviewed patch to Eric that would be great.
-Chris
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#2 lore raw
In reply to Stefan Schake
Quoted 6 lines · Stefan Schake

We were never releasing the initial fence reference that is obtained through dma_fence_init.

Fixes cdec4d361323 ("drm/vc4: Expose dma-buf fences for V3D rendering.")

Your commit message was more detailed and had the fixes and link tags, so I took yours over Maarten's. Thanks, it's reviewed and applied to -fixes.

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel