rust: drm: gpuvm: update DriverGpuVm for DeviceContext
Subsystems (4)
PATCH 1/1 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>.
--- rust/kernel/drm/gpuvm/mod.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
rust/kernel/drm/gpuvm/mod.rs +4 -4
@@ -116,9 +116,9 @@ const fn vtable() -> &'static bindings::drm_gpuvm_ops {/// Creates a GPUVM instance. #[expect(clippy::new_ret_no_self)] -pub fn new <E >( +pub fn new <E ,Ctx : drm::DeviceContext >( name: &'staticCStr , - 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 @@ fn raw_resv(&self) -> *mut bindings::dma_resv {/// 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 ;
---
base-commit: 550dc7536644db2d67c6f8cf525bba682fba08d9
change-id: 20260610-gpuvm_device_context_v1-367c21f94e1e
Best regards,
Signature · 1 line
Deborah Brouwer <[email protected]>
Quoted 8 lines · Deborah Brouwer
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::Objectanddrm::Driver::Objectand instead tighten the requirement that theDriverGpuVm::Objectbe an allocatable GEM object associated with the same DRM driver.
Quoted 4 lines
Also, make
GpuVm::new()generic over DeviceContext so it can accept a drm::Device<T::Driver, Ctx>.Signed-off-by Deborah Brouwer <[email protected]>
Quoted 8 lines · Deborah Brouwer
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::Objectanddrm::Driver::Objectand instead tighten the requirement that theDriverGpuVm::Objectbe an allocatable GEM object associated with the same DRM driver.
Quoted 4 lines
Also, make
GpuVm::new()generic over DeviceContext so it can accept a drm::Device<T::Driver, Ctx>.Signed-off-by Deborah Brouwer <[email protected]>
Sami
Danilo Krummrich
maintainerQuoted 8 lines · Deborah Brouwer
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::Objectanddrm::Driver::Objectand instead tighten the requirement that theDriverGpuVm::Objectbe an allocatable GEM object associated with the same DRM driver.
Quoted 4 lines
Also, make
GpuVm::new()generic over DeviceContext so it can accept a drm::Device<T::Driver, Ctx>.Signed-off-by Deborah Brouwer <[email protected]>
Quoted 1 line · Deborah Brouwer
[PATCH] rust: drm: gpuvm: update DriverGpuVm for DeviceContext
Applied, thanks!
Branch: drm-rust-next
Tree: https://gitlab.freedesktop.org/drm/rust/kernel.git
[1/1] rust: drm: gpuvm: update DriverGpuVm for DeviceContext
commit: 20003c1a1fd8