Blob Blame History Raw
From 8b6ec999b198b59ae61e86e70f5e9df73fe4754f Mon Sep 17 00:00:00 2001
From: Qi Liu <liuqi.16@bytedance.com>
Date: Tue, 21 Jul 2020 18:16:47 +0800
Subject: drm/virtio: fix missing dma_fence_put() in
 virtio_gpu_execbuffer_ioctl()
Git-commit: 8b6ec999b198b59ae61e86e70f5e9df73fe4754f
Patch-mainline: v5.9-rc2
References: bsc#1152489

We should put the reference count of the fence after calling
virtio_gpu_cmd_submit(). So add the missing dma_fence_put().

Fixes: 2cd7b6f08bc4 ("drm/virtio: add in/out fence support for explicit synchronization")
Co-developed-by: Xin He <hexin.op@bytedance.com>
Signed-off-by: Xin He <hexin.op@bytedance.com>
Signed-off-by: Qi Liu <liuqi.16@bytedance.com>
Reviewed-by: Muchun Song <songmuchun@bytedance.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20200721101647.42653-1-hexin.op@bytedance.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Acked-by: Thomas Zimmermann <tzimmermann@suse.de>
---
 drivers/gpu/drm/virtio/virtgpu_ioctl.c |    1 +
 1 file changed, 1 insertion(+)

--- a/drivers/gpu/drm/virtio/virtgpu_ioctl.c
+++ b/drivers/gpu/drm/virtio/virtgpu_ioctl.c
@@ -223,6 +223,7 @@ static int virtio_gpu_execbuffer_ioctl(s
 			      vfpriv->ctx_id, out_fence);
 
 	ttm_eu_fence_buffer_objects(&ticket, &validate_list, &out_fence->f);
+	dma_fence_put(&out_fence->f);
 
 	/* fence the command bo */
 	virtio_gpu_unref_list(&validate_list);