linux/drivers/gpu/drm/virtio
Gurchetan Singh 70d1ace56d drm/virtio: Conditionally allocate virtio_gpu_fence
We don't want to create a fence for every command submission.  It's
only necessary when userspace provides a waitable token for submission.
This could be:

1) bo_handles, to be used with VIRTGPU_WAIT
2) out_fence_fd, to be used with dma_fence apis
3) a ring_idx provided with VIRTGPU_CONTEXT_PARAM_POLL_RINGS_MASK
   + DRM event API
4) syncobjs in the future

The use case for just submitting a command to the host, and expecting
no response.  For example, gfxstream has GFXSTREAM_CONTEXT_PING that
just wakes up the host side worker threads.  There's also
CROSS_DOMAIN_CMD_SEND which just sends data to the Wayland server.

This prevents the need to signal the automatically created
virtio_gpu_fence.

In addition, VIRTGPU_EXECBUF_RING_IDX is checked when creating a
DRM event object.  VIRTGPU_CONTEXT_PARAM_POLL_RINGS_MASK is
already defined in terms of per-context rings.  It was theoretically
possible to create a DRM event on the global timeline (ring_idx == 0),
if the context enabled DRM event polling.  However, that wouldn't
work and userspace (Sommelier).  Explicitly disallow it for
clarity.

Signed-off-by: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Tested-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com> # edited coding style
Link: https://patchwork.freedesktop.org/patch/msgid/20230707213124.494-1-gurchetansingh@chromium.org
2023-07-09 23:30:50 +03:00
..
Kconfig drm/virtio: Add option to disable KMS support 2023-03-03 23:29:54 +03:00
Makefile drm/virtio: Refactor and optimize job submission code path 2023-06-03 04:50:40 +03:00
virtgpu_debugfs.c
virtgpu_display.c drm/virtio: Add option to disable KMS support 2023-03-03 23:29:54 +03:00
virtgpu_drv.c drm: Clear fd/handle callbacks in struct drm_driver 2023-06-26 11:08:41 +02:00
virtgpu_drv.h drm/virtio: Refactor and optimize job submission code path 2023-06-03 04:50:40 +03:00
virtgpu_fence.c
virtgpu_gem.c drm/virtio: Unlock reservations on dma_resv_reserve_fences() error 2022-07-19 14:40:58 +02:00
virtgpu_ioctl.c drm/virtio: Refactor and optimize job submission code path 2023-06-03 04:50:40 +03:00
virtgpu_kms.c drm/virtio: Fix handling CONFIG_DRM_VIRTIO_GPU_KMS option 2023-03-06 20:32:17 +03:00
virtgpu_object.c drm/virtio: Fix memory leak in virtio_gpu_object_create() 2023-01-02 17:42:25 +03:00
virtgpu_plane.c drm/virtio: Enable fb damage clips property for the primary plane 2023-03-13 18:22:24 +01:00
virtgpu_prime.c drm/virtio: simplify the return expression 2022-06-09 07:30:13 +02:00
virtgpu_submit.c drm/virtio: Conditionally allocate virtio_gpu_fence 2023-07-09 23:30:50 +03:00
virtgpu_trace.h drm/virtio: Spiff out cmd queue/response traces 2023-01-02 17:51:27 +03:00
virtgpu_trace_points.c
virtgpu_vq.c Linux 6.3-rc4 2023-03-29 16:00:23 +02:00
virtgpu_vram.c mm: replace vma->vm_flags direct modifications with modifier calls 2023-02-09 16:51:39 -08:00