History

drm/virtio: Support sync objects

Add sync object DRM UAPI support to VirtIO-GPU driver. Sync objects support is needed by native context VirtIO-GPU Mesa drivers, it also will be used by Venus and Virgl contexts. Reviewed-by; Emil Velikov <emil.velikov@collabora.com> Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com> Tested-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> # amdgpu nctx Tested-by: Rob Clark <robdclark@gmail.com> # freedreno nctx Reviewed-by: Rob Clark <robdclark@gmail.com> Acked-by: Gurchetan Singh <gurchetansingh@chromium.org> Acked-by: Gerd Hoffmann <kraxel@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/20230416115237.798604-4-dmitry.osipenko@collabora.com

Dmitry Osipenko committed 3 years ago

Commit 7cb8d1a1 parent 744d35d3 files · +241 −2Browse files

Showing the changes to include/uapi/drm (1 of 3 files). Show all

Unified · Split

include/uapi/drm/virtgpu_drm.h+15−1
@@ -64,6 +64,16 @@ struct drm_virtgpu_map { · 63 unmodified lines
6464 __u32 pad;
6565 };
6666
67+#define VIRTGPU_EXECBUF_SYNCOBJ_RESET 0x01
68+#define VIRTGPU_EXECBUF_SYNCOBJ_FLAGS ( \
69+ VIRTGPU_EXECBUF_SYNCOBJ_RESET | \
70+ 0)
71+struct drm_virtgpu_execbuffer_syncobj {
72+ __u32 handle;
73+ __u32 flags;
74+ __u64 point;
75+};
76+
6777 /* fence_fd is modified on success if VIRTGPU_EXECBUF_FENCE_FD_OUT flag is set. */
6878 struct drm_virtgpu_execbuffer {
6979 __u32 flags;
@@ -73,7 +83,11 @@ struct drm_virtgpu_execbuffer { · 3 unmodified lines
7383 __u32 num_bo_handles;
7484 __s32 fence_fd; /* in/out fence fd (see VIRTGPU_EXECBUF_FENCE_FD_IN/OUT) */
7585 __u32 ring_idx; /* command ring index (see VIRTGPU_EXECBUF_RING_IDX) */
76− __u32 pad;
86+ __u32 syncobj_stride; /* size of @drm_virtgpu_execbuffer_syncobj */
87+ __u32 num_in_syncobjs;
88+ __u32 num_out_syncobjs;
89+ __u64 in_syncobjs;
90+ __u64 out_syncobjs;
7791 };
7892
7993 #define VIRTGPU_PARAM_3D_FEATURES 1 /* do we have 3D features in the hw */