From: Alice Ryhl Date: Mon, 27 Apr 2026 10:54:51 +0000 (+0000) Subject: drm/gpuvm: rust: add RUST_DRM_GPUVM option to Kconfig X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=37f748ed0c19e007e7c5677f5d605d6b93841792;p=thirdparty%2Flinux.git drm/gpuvm: rust: add RUST_DRM_GPUVM option to Kconfig Since Rust uses GPUVM via the kernel crate, which is built-in, the GPUVM module must also be built-in to use GPUVM from Rust. Adjust the Kconfig settings accordingly. Suggested-by: Danilo Krummrich Signed-off-by: Alice Ryhl Link: https://patch.msgid.link/20260427-gpuvm-config-v1-1-8ece03771f8a@google.com Signed-off-by: Danilo Krummrich --- diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig index 8f5a8d3012e4..323422861e8f 100644 --- a/drivers/gpu/drm/Kconfig +++ b/drivers/gpu/drm/Kconfig @@ -218,6 +218,13 @@ config DRM_GPUVM GPU-VM representation providing helpers to manage a GPUs virtual address space +config RUST_DRM_GPUVM + bool + depends on DRM + select DRM_GPUVM + help + Choose this if you need GPUVM functions in Rust + config DRM_GPUSVM tristate depends on DRM diff --git a/rust/helpers/drm_gpuvm.c b/rust/helpers/drm_gpuvm.c index ca959d9a66f6..4130b6325213 100644 --- a/rust/helpers/drm_gpuvm.c +++ b/rust/helpers/drm_gpuvm.c @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0 or MIT -#ifdef CONFIG_DRM_GPUVM +#ifdef CONFIG_RUST_DRM_GPUVM #include @@ -23,4 +23,4 @@ bool rust_helper_drm_gpuvm_is_extobj(struct drm_gpuvm *gpuvm, return drm_gpuvm_is_extobj(gpuvm, obj); } -#endif // CONFIG_DRM_GPUVM +#endif // CONFIG_RUST_DRM_GPUVM diff --git a/rust/kernel/drm/gpuvm/mod.rs b/rust/kernel/drm/gpuvm/mod.rs index dc755f248143..ae58f6f667c1 100644 --- a/rust/kernel/drm/gpuvm/mod.rs +++ b/rust/kernel/drm/gpuvm/mod.rs @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0 OR MIT -#![cfg(CONFIG_DRM_GPUVM = "y")] +#![cfg(CONFIG_RUST_DRM_GPUVM)] //! DRM GPUVM in immediate mode //!