drm/virtio: drop virtio_gpu_fence_cleanup()
authorGerd Hoffmann <kraxel@redhat.com>
Wed, 19 Dec 2018 12:27:01 +0000 (13:27 +0100)
committerGerd Hoffmann <kraxel@redhat.com>
Tue, 8 Jan 2019 11:00:01 +0000 (12:00 +0100)
Just call drm_fence_put directly instead.
Also set vgfb->fence to NULL after dropping the reference.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Ezequiel Garcia <ezequiel@collabora.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20181219122708.4586-4-kraxel@redhat.com
drivers/gpu/drm/virtio/virtgpu_drv.h
drivers/gpu/drm/virtio/virtgpu_fence.c
drivers/gpu/drm/virtio/virtgpu_ioctl.c
drivers/gpu/drm/virtio/virtgpu_plane.c

index 63704915f8ce4e81730dcf8bb043a0de51e2735e..bfb31fc3d01d0c5b08c1abc71962173f0aad0103 100644 (file)
@@ -337,7 +337,6 @@ int virtio_gpu_mmap(struct file *filp, struct vm_area_struct *vma);
 /* virtio_gpu_fence.c */
 struct virtio_gpu_fence *virtio_gpu_fence_alloc(
        struct virtio_gpu_device *vgdev);
-void virtio_gpu_fence_cleanup(struct virtio_gpu_fence *fence);
 int virtio_gpu_fence_emit(struct virtio_gpu_device *vgdev,
                          struct virtio_gpu_ctrl_hdr *cmd_hdr,
                          struct virtio_gpu_fence *fence);
index 4d6826b27814ee3002eb119216c2cc569ea880c2..21bd4c4a32d141b3efef38cb5ec040857abd0fa9 100644 (file)
@@ -81,14 +81,6 @@ struct virtio_gpu_fence *virtio_gpu_fence_alloc(struct virtio_gpu_device *vgdev)
        return fence;
 }
 
-void virtio_gpu_fence_cleanup(struct virtio_gpu_fence *fence)
-{
-       if (!fence)
-               return;
-
-       dma_fence_put(&fence->f);
-}
-
 int virtio_gpu_fence_emit(struct virtio_gpu_device *vgdev,
                          struct virtio_gpu_ctrl_hdr *cmd_hdr,
                          struct virtio_gpu_fence *fence)
index 161b80fee492564346262d954a0bb8d9864aaae4..14ce8188c05237e3cadbd4def670817e81ddd4c2 100644 (file)
@@ -351,7 +351,7 @@ static int virtio_gpu_resource_create_ioctl(struct drm_device *dev, void *data,
                virtio_gpu_cmd_resource_create_3d(vgdev, qobj, &rc_3d);
                ret = virtio_gpu_object_attach(vgdev, qobj, fence);
                if (ret) {
-                       virtio_gpu_fence_cleanup(fence);
+                       dma_fence_put(&fence->f);
                        goto fail_backoff;
                }
                ttm_eu_fence_buffer_objects(&ticket, &validate_list, &fence->f);
index 548265b8e82d9af5d813f7f58789b02a5944858d..024c2aa0c929eab8ccdb9ef43b879447704b97b3 100644 (file)
@@ -169,8 +169,10 @@ static void virtio_gpu_cursor_cleanup_fb(struct drm_plane *plane,
                return;
 
        vgfb = to_virtio_gpu_framebuffer(plane->state->fb);
-       if (vgfb->fence)
-               virtio_gpu_fence_cleanup(vgfb->fence);
+       if (vgfb->fence) {
+               dma_fence_put(&vgfb->fence->f);
+               vgfb->fence = NULL;
+       }
 }
 
 static void virtio_gpu_cursor_plane_update(struct drm_plane *plane,