diff mbox

drm/vc4: Release fence after signalling

Message ID 1512236444-301-1-git-send-email-stschake@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Stefan Schake Dec. 2, 2017, 5:40 p.m. UTC
We were never releasing the initial fence reference that is obtained
through dma_fence_init.

Link: https://github.com/anholt/linux/issues/122
Fixes: cdec4d361323 ("drm/vc4: Expose dma-buf fences for V3D rendering.")
Signed-off-by: Stefan Schake <stschake@gmail.com>
---
 drivers/gpu/drm/vc4/vc4_gem.c | 4 +++-
 drivers/gpu/drm/vc4/vc4_irq.c | 1 +
 2 files changed, 4 insertions(+), 1 deletion(-)

Comments

Chris Wilson Dec. 2, 2017, 6:12 p.m. UTC | #1
Quoting Stefan Schake (2017-12-02 17:40:39)
> We were never releasing the initial fence reference that is obtained
> through dma_fence_init.
> 
> Link: https://github.com/anholt/linux/issues/122
> Fixes: cdec4d361323 ("drm/vc4: Expose dma-buf fences for V3D rendering.")
> Signed-off-by: Stefan Schake <stschake@gmail.com>

Maarten wrote an identical patch,
20171130150253.17200-1-maarten.lankhorst@linux.intel.com, if you could
coordinate between yourselves to deliver a reviewed patch to Eric that
would be great.
-Chris
Eric Anholt Dec. 8, 2017, 9:07 p.m. UTC | #2
Stefan Schake <stschake@gmail.com> writes:

> We were never releasing the initial fence reference that is obtained
> through dma_fence_init.
>
> Link: https://github.com/anholt/linux/issues/122
> Fixes: cdec4d361323 ("drm/vc4: Expose dma-buf fences for V3D rendering.")
> Signed-off-by: Stefan Schake <stschake@gmail.com>

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.
diff mbox

Patch

diff --git a/drivers/gpu/drm/vc4/vc4_gem.c b/drivers/gpu/drm/vc4/vc4_gem.c
index 6c32c89..6385409 100644
--- a/drivers/gpu/drm/vc4/vc4_gem.c
+++ b/drivers/gpu/drm/vc4/vc4_gem.c
@@ -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++) {
diff --git a/drivers/gpu/drm/vc4/vc4_irq.c b/drivers/gpu/drm/vc4/vc4_irq.c
index 61b2e53..26eddbb 100644
--- a/drivers/gpu/drm/vc4/vc4_irq.c
+++ b/drivers/gpu/drm/vc4/vc4_irq.c
@@ -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);