@@ -39,9 +39,6 @@ extern "C" {
#define DRM_VGEM_FENCE_ATTACH 0x1
#define DRM_VGEM_FENCE_SIGNAL 0x2
-#define DRM_IOCTL_VGEM_FENCE_ATTACH DRM_IOWR( DRM_COMMAND_BASE + DRM_VGEM_FENCE_ATTACH, struct drm_vgem_fence_attach)
-#define DRM_IOCTL_VGEM_FENCE_SIGNAL DRM_IOW( DRM_COMMAND_BASE + DRM_VGEM_FENCE_SIGNAL, struct drm_vgem_fence_signal)
-
struct drm_vgem_fence_attach {
__u32 handle;
__u32 flags;
@@ -55,6 +52,12 @@ struct drm_vgem_fence_signal {
__u32 flags;
};
+/* Note: this is an enum so that it can be resolved by Rust bindgen. */
+enum {
+ DRM_IOCTL_VGEM_FENCE_ATTACH = DRM_IOWR(DRM_COMMAND_BASE + DRM_VGEM_FENCE_ATTACH, struct drm_vgem_fence_attach),
+ DRM_IOCTL_VGEM_FENCE_SIGNAL = DRM_IOW(DRM_COMMAND_BASE + DRM_VGEM_FENCE_SIGNAL, struct drm_vgem_fence_signal),
+};
+
#if defined(__cplusplus)
}
#endif
Bindgen doesn't expand C macros, which makes DRM_IOCTL_VGEM_FENCE_ATTACH and DRM_IOCTL_VGEM_FENCE_SIGNAL not accessible through the Rust bindings. So, move the IOCTLs numbers to a enum, preserving the same values and the same name. This won't produce any functional changes to the UAPI and it will make it possible to use this UAPI in Rust. Signed-off-by: Maíra Canal <mcanal@igalia.com> --- include/uapi/drm/vgem_drm.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)