diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2020-02-07 10:46:36 +0300 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2020-02-10 14:54:33 +0300 |
commit | 1ed5f698adad450b314a36aa48ff9593bdfcd968 (patch) | |
tree | e47715d779669dcced12f21d5c4918e11edb269f /drivers/gpu/drm/virtio/virtgpu_drv.h | |
parent | 8235eab0122a051b05e3dac128a64b66c0273dac (diff) | |
download | linux-1ed5f698adad450b314a36aa48ff9593bdfcd968.tar.xz |
drm/virtio: resource teardown tweaks
Add new virtio_gpu_cleanup_object() helper function for object cleanup.
Wire up callback function for resource unref, do cleanup from callback
when we know the host stopped using the resource.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20200207074638.26386-3-kraxel@redhat.com
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Diffstat (limited to 'drivers/gpu/drm/virtio/virtgpu_drv.h')
-rw-r--r-- | drivers/gpu/drm/virtio/virtgpu_drv.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/gpu/drm/virtio/virtgpu_drv.h b/drivers/gpu/drm/virtio/virtgpu_drv.h index d278c8c50f39..c3a33ba32571 100644 --- a/drivers/gpu/drm/virtio/virtgpu_drv.h +++ b/drivers/gpu/drm/virtio/virtgpu_drv.h @@ -114,6 +114,7 @@ struct virtio_gpu_vbuffer { char *resp_buf; int resp_size; virtio_gpu_resp_cb resp_cb; + void *resp_cb_data; struct virtio_gpu_object_array *objs; struct list_head list; @@ -263,7 +264,7 @@ void virtio_gpu_cmd_create_resource(struct virtio_gpu_device *vgdev, struct virtio_gpu_object_array *objs, struct virtio_gpu_fence *fence); void virtio_gpu_cmd_unref_resource(struct virtio_gpu_device *vgdev, - uint32_t resource_id); + struct virtio_gpu_object *bo); void virtio_gpu_cmd_transfer_to_host_2d(struct virtio_gpu_device *vgdev, uint64_t offset, uint32_t width, uint32_t height, @@ -356,6 +357,7 @@ void virtio_gpu_fence_event_process(struct virtio_gpu_device *vdev, u64 last_seq); /* virtio_gpu_object */ +void virtio_gpu_cleanup_object(struct virtio_gpu_object *bo); struct drm_gem_object *virtio_gpu_create_object(struct drm_device *dev, size_t size); int virtio_gpu_object_create(struct virtio_gpu_device *vgdev, |