summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/virtio/virtgpu_fence.c
diff options
context:
space:
mode:
authorGurchetan Singh <gurchetansingh@chromium.org>2021-09-22 02:20:23 +0300
committerGerd Hoffmann <kraxel@redhat.com>2021-09-29 10:22:31 +0300
commitcd7f5ca33585918febe5e2f6dc090a21cfa775b0 (patch)
tree6bbee480a5b3c6073de5ffcdea6c9be2bd3f6771 /drivers/gpu/drm/virtio/virtgpu_fence.c
parent8d6b006e1f51c99016aa39ca9e03947cbdd024e3 (diff)
downloadlinux-cd7f5ca33585918febe5e2f6dc090a21cfa775b0.tar.xz
drm/virtio: implement context init: add virtio_gpu_fence_event
Similar to DRM_VMW_EVENT_FENCE_SIGNALED. Sends a pollable event to the DRM file descriptor when a fence on a specific ring is signaled. One difference is the event is not exposed via the UAPI -- this is because host responses are on a shared memory buffer of type BLOB_MEM_GUEST [this is the common way to receive responses with virtgpu]. As such, there is no context specific read(..) implementation either -- just a poll(..) implementation. Signed-off-by: Gurchetan Singh <gurchetansingh@chromium.org> Acked-by: Nicholas Verne <nverne@chromium.org> Link: http://patchwork.freedesktop.org/patch/msgid/20210921232024.817-12-gurchetansingh@chromium.org Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/virtio/virtgpu_fence.c')
-rw-r--r--drivers/gpu/drm/virtio/virtgpu_fence.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/gpu/drm/virtio/virtgpu_fence.c b/drivers/gpu/drm/virtio/virtgpu_fence.c
index 98a00c1e654d..f28357dbde35 100644
--- a/drivers/gpu/drm/virtio/virtgpu_fence.c
+++ b/drivers/gpu/drm/virtio/virtgpu_fence.c
@@ -152,11 +152,21 @@ void virtio_gpu_fence_event_process(struct virtio_gpu_device *vgdev,
continue;
dma_fence_signal_locked(&curr->f);
+ if (curr->e) {
+ drm_send_event(vgdev->ddev, &curr->e->base);
+ curr->e = NULL;
+ }
+
list_del(&curr->node);
dma_fence_put(&curr->f);
}
dma_fence_signal_locked(&signaled->f);
+ if (signaled->e) {
+ drm_send_event(vgdev->ddev, &signaled->e->base);
+ signaled->e = NULL;
+ }
+
list_del(&signaled->node);
dma_fence_put(&signaled->f);
break;