This function won't be useable for hostmem objects.
@@ -526,7 +526,8 @@ static void virtio_gpu_cmd_unref_cb(struct virtio_gpu_device *vgdev, bo = vbuf->resp_cb_data; vbuf->resp_cb_data = NULL;
- virtio_gpu_cleanup_object(bo);
- if (bo && virtio_gpu_is_shmem(bo))
virtio_gpu_cleanup_object(bo);
Its not that simple, the virtio_gpu_resource_id_put() call in virtio_gpu_cleanup_object() is needed for all objects. We also must free all objects.
I'd suggest to move the virtio_gpu_is_shmem() check to virtio_gpu_cleanup_object().
cheers, Gerd