summaryrefslogtreecommitdiff
path: root/rust/kernel/drm
diff options
context:
space:
mode:
authorDeborah Brouwer <deborah.brouwer@collabora.com>2026-06-10 17:01:26 -0700
committerDanilo Krummrich <dakr@kernel.org>2026-06-12 22:28:36 +0200
commit20003c1a1fd80ae1b1742ff54297b67f7f21b77f (patch)
treef766694e8ea0c15358259af4966f05a4565352d0 /rust/kernel/drm
parentd055768429b3a49090e5f633fa45d7b964fc23ec (diff)
downloadlinux-next-20003c1a1fd80ae1b1742ff54297b67f7f21b77f.tar.gz
linux-next-20003c1a1fd80ae1b1742ff54297b67f7f21b77f.zip
rust: drm: gpuvm: update DriverGpuVm for DeviceContext
Since the introduction of DeviceContext, there is no longer a single driver object type to equate with the GPUVM object type. Instead of threading DeviceContext through GPUVM, remove the strict identity between DriverGpuVm::Object and drm::Driver::Object and instead tighten the requirement that the DriverGpuVm::Object be an allocatable GEM object associated with the same DRM driver. Also, make GpuVm::new() generic over DeviceContext so it can accept a drm::Device<T::Driver, Ctx>. Fixes: 0023a1e8d01a ("rust/drm/gem: Use DeviceContext with GEM objects") Signed-off-by: Deborah Brouwer <deborah.brouwer@collabora.com> Reviewed-by: Alice Ryhl <aliceryhl@google.com> Reviewed-by: Sami Tolvanen <samitolvanen@google.com> Link: https://patch.msgid.link/20260610-gpuvm_device_context_v1-v1-1-01a890b17448@collabora.com Signed-off-by: Danilo Krummrich <dakr@kernel.org>
Diffstat (limited to 'rust/kernel/drm')
-rw-r--r--rust/kernel/drm/gpuvm/mod.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/rust/kernel/drm/gpuvm/mod.rs b/rust/kernel/drm/gpuvm/mod.rs
index ae58f6f667c1..a625fcd9b5f2 100644
--- a/rust/kernel/drm/gpuvm/mod.rs
+++ b/rust/kernel/drm/gpuvm/mod.rs
@@ -116,9 +116,9 @@ impl<T: DriverGpuVm> GpuVm<T> {
/// Creates a GPUVM instance.
#[expect(clippy::new_ret_no_self)]
- pub fn new<E>(
+ pub fn new<E, Ctx: drm::DeviceContext>(
name: &'static CStr,
- dev: &drm::Device<T::Driver>,
+ dev: &drm::Device<T::Driver, Ctx>,
r_obj: &T::Object,
range: Range<u64>,
reserve_range: Range<u64>,
@@ -252,10 +252,10 @@ impl<T: DriverGpuVm> GpuVm<T> {
/// The manager for a GPUVM.
pub trait DriverGpuVm: Sized + Send {
/// Parent `Driver` for this object.
- type Driver: drm::Driver<Object = Self::Object>;
+ type Driver: drm::Driver;
/// The kind of GEM object stored in this GPUVM.
- type Object: IntoGEMObject;
+ type Object: drm::driver::AllocImpl<Driver = Self::Driver>;
/// Data stored with each [`struct drm_gpuva`](struct@GpuVa).
type VaData;