]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/gpuvm: rust: add RUST_DRM_GPUVM option to Kconfig
authorAlice Ryhl <aliceryhl@google.com>
Mon, 27 Apr 2026 10:54:51 +0000 (10:54 +0000)
committerDanilo Krummrich <dakr@kernel.org>
Tue, 5 May 2026 10:59:41 +0000 (12:59 +0200)
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 <dakr@kernel.org>
Signed-off-by: Alice Ryhl <aliceryhl@google.com>
Link: https://patch.msgid.link/20260427-gpuvm-config-v1-1-8ece03771f8a@google.com
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
drivers/gpu/drm/Kconfig
rust/helpers/drm_gpuvm.c
rust/kernel/drm/gpuvm/mod.rs

index 8f5a8d3012e4182f3c639ecbd0bb1bd5bb094c9d..323422861e8f683590492184ae24c0064c1ca931 100644 (file)
@@ -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
index ca959d9a66f60fcc9dee4f3f4197cfcb344f2ae4..4130b6325213871ef07742b67be5687726e3cf6b 100644 (file)
@@ -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
index dc755f2481437a422fed326fff0c77a88fced00e..ae58f6f667c1fafa012ddb24b4de4609c326ba4d 100644 (file)
@@ -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
 //!