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
Showing the changes to include/uapi/drm (1 of 3 files). Show all
Unified · Split
| @@ -64,6 +64,16 @@ struct drm_virtgpu_map { · 63 unmodified lines | |||
| 64 | __u32 pad; | 64 | __u32 pad; |
| 65 | }; | 65 | }; |
| 66 | 66 | ||
| 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 | |||
| 67 | /* fence_fd is modified on success if VIRTGPU_EXECBUF_FENCE_FD_OUT flag is set. */ | 77 | /* fence_fd is modified on success if VIRTGPU_EXECBUF_FENCE_FD_OUT flag is set. */ |
| 68 | struct drm_virtgpu_execbuffer { | 78 | struct drm_virtgpu_execbuffer { |
| 69 | __u32 flags; | 79 | __u32 flags; |
| @@ -73,7 +83,11 @@ struct drm_virtgpu_execbuffer { · 3 unmodified lines | |||
| 73 | __u32 num_bo_handles; | 83 | __u32 num_bo_handles; |
| 74 | __s32 fence_fd; /* in/out fence fd (see VIRTGPU_EXECBUF_FENCE_FD_IN/OUT) */ | 84 | __s32 fence_fd; /* in/out fence fd (see VIRTGPU_EXECBUF_FENCE_FD_IN/OUT) */ |
| 75 | __u32 ring_idx; /* command ring index (see VIRTGPU_EXECBUF_RING_IDX) */ | 85 | __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; | ||
| 77 | }; | 91 | }; |
| 78 | 92 | ||
| 79 | #define VIRTGPU_PARAM_3D_FEATURES 1 /* do we have 3D features in the hw */ | 93 | #define VIRTGPU_PARAM_3D_FEATURES 1 /* do we have 3D features in the hw */ |