]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
rust: drm: add base GPUVM immediate mode abstraction
authorAsahi Lina <lina+kernel@asahilina.net>
Thu, 9 Apr 2026 15:26:06 +0000 (15:26 +0000)
committerDanilo Krummrich <dakr@kernel.org>
Tue, 5 May 2026 10:52:49 +0000 (12:52 +0200)
commit82b78182eacf82c1847c6f1fd93d91c15efb69cf
tree9c82b56ad44e7624b8797423e9ad66eea5a6bbbe
parentc2d72717e0a9dd01c6a1bac61a1462a8e04bd179
rust: drm: add base GPUVM immediate mode abstraction

Add a GPUVM abstraction to be used by Rust GPU drivers.

GPUVM keeps track of a GPU's virtual address (VA) space and manages the
corresponding virtual mappings represented by "GPU VA" objects. It also
keeps track of the gem::Object<T> used to back the mappings through
GpuVmBo<T>.

This abstraction is only usable by drivers that wish to use GPUVM in
immediate mode. This allows us to build the locking scheme into the API
design. It means that the GEM mutex is used for the GEM gpuva list, and
that the resv lock is used for the extobj list. The evicted list is not
yet used in this version.

This abstraction provides a special handle called the UniqueRefGpuVm,
which is a wrapper around ARef<GpuVm> that provides access to the
interval tree. Generally, all changes to the address space requires
mutable access to this unique handle.

Signed-off-by: Asahi Lina <lina+kernel@asahilina.net>
Co-developed-by: Daniel Almeida <daniel.almeida@collabora.com>
Signed-off-by: Daniel Almeida <daniel.almeida@collabora.com>
Reviewed-by: Daniel Almeida <daniel.almeida@collabora.com>
Co-developed-by: Alice Ryhl <aliceryhl@google.com>
Signed-off-by: Alice Ryhl <aliceryhl@google.com>
Link: https://patch.msgid.link/20260409-gpuvm-rust-v6-1-b16e6ada7261@google.com
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
MAINTAINERS
rust/bindings/bindings_helper.h
rust/helpers/drm_gpuvm.c [new file with mode: 0644]
rust/helpers/helpers.c
rust/kernel/drm/gpuvm/mod.rs [new file with mode: 0644]
rust/kernel/drm/mod.rs