mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git/
synced 2026-04-18 06:33:43 -04:00
drm/virtio: add worker for object release
Move object release into a separate worker. Releasing objects requires sending commands to the host. Doing that in the dequeue worker will cause deadlocks in case the command queue gets filled up, because the dequeue worker is also the one which will free up slots in the command queue. Reported-by: Chia-I Wu <olvaffe@gmail.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Chia-I Wu <olvaffe@gmail.com> Tested-by: Chia-I Wu <olvaffe@gmail.com> Link: http://patchwork.freedesktop.org/patch/msgid/20190830060116.10476-1-kraxel@redhat.com
This commit is contained in:
@@ -78,6 +78,7 @@ struct virtio_gpu_object {
|
||||
|
||||
struct virtio_gpu_object_array {
|
||||
struct ww_acquire_ctx ticket;
|
||||
struct list_head next;
|
||||
u32 nents, total;
|
||||
struct drm_gem_object *objs[];
|
||||
};
|
||||
@@ -197,6 +198,10 @@ struct virtio_gpu_device {
|
||||
|
||||
struct work_struct config_changed_work;
|
||||
|
||||
struct work_struct obj_free_work;
|
||||
spinlock_t obj_free_lock;
|
||||
struct list_head obj_free_list;
|
||||
|
||||
struct virtio_gpu_drv_capset *capsets;
|
||||
uint32_t num_capsets;
|
||||
struct list_head cap_cache;
|
||||
@@ -246,6 +251,9 @@ void virtio_gpu_array_unlock_resv(struct virtio_gpu_object_array *objs);
|
||||
void virtio_gpu_array_add_fence(struct virtio_gpu_object_array *objs,
|
||||
struct dma_fence *fence);
|
||||
void virtio_gpu_array_put_free(struct virtio_gpu_object_array *objs);
|
||||
void virtio_gpu_array_put_free_delayed(struct virtio_gpu_device *vgdev,
|
||||
struct virtio_gpu_object_array *objs);
|
||||
void virtio_gpu_array_put_free_work(struct work_struct *work);
|
||||
|
||||
/* virtio vg */
|
||||
int virtio_gpu_alloc_vbufs(struct virtio_gpu_device *vgdev);
|
||||
|
||||
Reference in New Issue
Block a user