From patchwork Fri Mar 17 12:12:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ma=C3=ADra_Canal?= X-Patchwork-Id: 13179006 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E0AF5C6FD1D for ; Fri, 17 Mar 2023 12:13:49 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 220E810EEF8; Fri, 17 Mar 2023 12:13:49 +0000 (UTC) Received: from fanzine2.igalia.com (fanzine2.igalia.com [213.97.179.56]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8B5FE10EEF8 for ; Fri, 17 Mar 2023 12:13:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com; s=20170329; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References: In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=/WKUdMa+rFnar+m5MEJR5FApwgbeESggxlzzv31hPyg=; b=YUSpuvwvXF7w6JCAchHXh5anX7 dDTByVK9yPgwGjG5XK9RP986Wre2Ezb4sKF75mJvDNaMByhSijDWSVpWvRq/V6wOeFSXnVCq94YWO 4vrv8KZjQeiCIhezvtzi182KP7xUQsOTcNoPAlP1UYCEc7r4D/w7kfq+JNtR6nfwPv85VgONOx4j+ paXk8FzlkZYTC7gZywj+Acgd1gyBbzgYFHxTBDFiP4ZrXfPgmyA/bco885ABF4D4db4j++88sObbl Vp/48QO2spyJn2jPDes9hDzfCNEWedBqn6zq9857QX6sv4d53OqN7Ajzpx5KPZoQefNQmDngKsAam J7ZjWCmQ==; Received: from [177.34.168.16] (helo=bowie..) by fanzine2.igalia.com with esmtpsa (Cipher TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim) id 1pd8xf-00FrGz-9a; Fri, 17 Mar 2023 13:13:31 +0100 From: =?utf-8?q?Ma=C3=ADra_Canal?= To: Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Miguel Ojeda , Alex Gaynor , Wedson Almeida Filho , Boqun Feng , Gary Guo , Asahi Lina , Faith Ekstrand Subject: [RFC PATCH 6/9] drm/vgem: move IOCTLs numbers to enum Date: Fri, 17 Mar 2023 09:12:10 -0300 Message-Id: <20230317121213.93991-7-mcanal@igalia.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230317121213.93991-1-mcanal@igalia.com> References: <20230317121213.93991-1-mcanal@igalia.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Melissa Wen , =?utf-8?q?Ma=C3=ADra_Canal?= , dri-devel@lists.freedesktop.org, rust-for-linux@vger.kernel.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 --- include/uapi/drm/vgem_drm.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/include/uapi/drm/vgem_drm.h b/include/uapi/drm/vgem_drm.h index bf66f5db6da8..53ee3af0b25a 100644 --- a/include/uapi/drm/vgem_drm.h +++ b/include/uapi/drm/vgem_drm.h @@ -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