Commit cb66c6da authored by Gerd Hoffmann's avatar Gerd Hoffmann

drm/virtio: drop virtio_gpu_fence_cleanup()

Just call drm_fence_put directly instead.
Also set vgfb->fence to NULL after dropping the reference.
Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
Reviewed-by: default avatarEzequiel Garcia <ezequiel@collabora.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20181219122708.4586-4-kraxel@redhat.com
parent 6a01d277
...@@ -337,7 +337,6 @@ int virtio_gpu_mmap(struct file *filp, struct vm_area_struct *vma); ...@@ -337,7 +337,6 @@ int virtio_gpu_mmap(struct file *filp, struct vm_area_struct *vma);
/* virtio_gpu_fence.c */ /* virtio_gpu_fence.c */
struct virtio_gpu_fence *virtio_gpu_fence_alloc( struct virtio_gpu_fence *virtio_gpu_fence_alloc(
struct virtio_gpu_device *vgdev); 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, int virtio_gpu_fence_emit(struct virtio_gpu_device *vgdev,
struct virtio_gpu_ctrl_hdr *cmd_hdr, struct virtio_gpu_ctrl_hdr *cmd_hdr,
struct virtio_gpu_fence *fence); struct virtio_gpu_fence *fence);
......
...@@ -81,14 +81,6 @@ struct virtio_gpu_fence *virtio_gpu_fence_alloc(struct virtio_gpu_device *vgdev) ...@@ -81,14 +81,6 @@ struct virtio_gpu_fence *virtio_gpu_fence_alloc(struct virtio_gpu_device *vgdev)
return fence; 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, int virtio_gpu_fence_emit(struct virtio_gpu_device *vgdev,
struct virtio_gpu_ctrl_hdr *cmd_hdr, struct virtio_gpu_ctrl_hdr *cmd_hdr,
struct virtio_gpu_fence *fence) struct virtio_gpu_fence *fence)
......
...@@ -351,7 +351,7 @@ static int virtio_gpu_resource_create_ioctl(struct drm_device *dev, void *data, ...@@ -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); virtio_gpu_cmd_resource_create_3d(vgdev, qobj, &rc_3d);
ret = virtio_gpu_object_attach(vgdev, qobj, fence); ret = virtio_gpu_object_attach(vgdev, qobj, fence);
if (ret) { if (ret) {
virtio_gpu_fence_cleanup(fence); dma_fence_put(&fence->f);
goto fail_backoff; goto fail_backoff;
} }
ttm_eu_fence_buffer_objects(&ticket, &validate_list, &fence->f); ttm_eu_fence_buffer_objects(&ticket, &validate_list, &fence->f);
......
...@@ -169,8 +169,10 @@ static void virtio_gpu_cursor_cleanup_fb(struct drm_plane *plane, ...@@ -169,8 +169,10 @@ static void virtio_gpu_cursor_cleanup_fb(struct drm_plane *plane,
return; return;
vgfb = to_virtio_gpu_framebuffer(plane->state->fb); vgfb = to_virtio_gpu_framebuffer(plane->state->fb);
if (vgfb->fence) if (vgfb->fence) {
virtio_gpu_fence_cleanup(vgfb->fence); dma_fence_put(&vgfb->fence->f);
vgfb->fence = NULL;
}
} }
static void virtio_gpu_cursor_plane_update(struct drm_plane *plane, static void virtio_gpu_cursor_plane_update(struct drm_plane *plane,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment