diff options
author | Robert Foss <robert.foss@collabora.com> | 2018-11-12 17:51:54 +0100 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2018-11-14 14:21:01 +0100 |
commit | 9fdd90c0f42440b7f1e4a3f7262d222eee4b4cdf (patch) | |
tree | 3790a9c569e93d98f8603742d85bf23ae5958dd5 /drivers/gpu/drm/virtio/virtgpu_vq.c | |
parent | drm/virtio: Use IDAs more efficiently (diff) | |
download | linux-dev-9fdd90c0f42440b7f1e4a3f7262d222eee4b4cdf.tar.xz linux-dev-9fdd90c0f42440b7f1e4a3f7262d222eee4b4cdf.zip |
drm/virtio: add virtio_gpu_alloc_fence()
Refactor fence creation, add fences to relevant GPU
operations and add cursor helper functions.
This removes the potential for allocation failures from the
cmd_submit and atomic_commit paths.
Now a fence will be allocated first and only after that
will we proceed with the rest of the execution.
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.com>
Signed-off-by: Robert Foss <robert.foss@collabora.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20181112165157.32765-2-robert.foss@collabora.com
Suggested-by: Rob Herring <robh@kernel.org>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/virtio/virtgpu_vq.c')
-rw-r--r-- | drivers/gpu/drm/virtio/virtgpu_vq.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/virtio/virtgpu_vq.c b/drivers/gpu/drm/virtio/virtgpu_vq.c index 51bef1775e47..93f2c3a51ee8 100644 --- a/drivers/gpu/drm/virtio/virtgpu_vq.c +++ b/drivers/gpu/drm/virtio/virtgpu_vq.c @@ -896,9 +896,9 @@ void virtio_gpu_object_detach(struct virtio_gpu_device *vgdev, struct virtio_gpu_object *obj) { bool use_dma_api = !virtio_has_iommu_quirk(vgdev->vdev); - struct virtio_gpu_fence *fence; if (use_dma_api && obj->mapped) { + struct virtio_gpu_fence *fence = virtio_gpu_fence_alloc(vgdev); /* detach backing and wait for the host process it ... */ virtio_gpu_cmd_resource_inval_backing(vgdev, obj->hw_res_handle, &fence); dma_fence_wait(&fence->f, true); |