* [PATCH] drm/gpuvm: rust: add RUST_DRM_GPUVM option to Kconfig
@ 2026-04-27 10:54 Alice Ryhl
0 siblings, 0 replies; only message in thread
From: Alice Ryhl @ 2026-04-27 10:54 UTC (permalink / raw)
To: Danilo Krummrich, Matthew Brost, Thomas Hellström
Cc: Miguel Ojeda, Boqun Feng, Gary Guo, Björn Roy Baron,
Benno Lossin, Andreas Hindborg, Trevor Gross, dri-devel,
linux-kernel, rust-for-linux, Alice Ryhl
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.
Signed-off-by: Alice Ryhl <aliceryhl@google.com>
---
drivers/gpu/drm/Kconfig | 7 +++++++
rust/helpers/drm_gpuvm.c | 4 ++--
rust/kernel/drm/gpuvm/mod.rs | 2 +-
3 files changed, 10 insertions(+), 3 deletions(-)
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 <drm/drm_gpuvm.h>
@@ -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
//!
---
base-commit: 5ba12cca3230f6bee5fe1090a30db6b70733e2c7
change-id: 20260427-gpuvm-config-7abf27967f8d
prerequisite-change-id: 20251128-gpuvm-rust-b719cac27ad6:v6
prerequisite-patch-id: f1f55d8f1e7d6e5378673812830d40a6ab00ac15
prerequisite-patch-id: 69eaacfa09229181832b2c2a19ce1a2f96e5e532
prerequisite-patch-id: 27fb7278e13bb18b493e207720dcad4e41862281
prerequisite-patch-id: 76a7592dd4f4da18243091a615f9a8f8579b5d56
prerequisite-patch-id: 0044f8f6356e6fe0759db08ec663822df204cdad
Best regards,
--
Alice Ryhl <aliceryhl@google.com>
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-04-27 10:55 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-27 10:54 [PATCH] drm/gpuvm: rust: add RUST_DRM_GPUVM option to Kconfig Alice Ryhl
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox