summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/tyr/gem.rs
diff options
context:
space:
mode:
authorLyude Paul <lyude@redhat.com>2026-05-07 17:59:21 -0400
committerDanilo Krummrich <dakr@kernel.org>2026-06-02 22:51:16 +0200
commit0023a1e8d01a9d400257d30c851bd16a29568809 (patch)
treeccd447eb820810287cf9520b02068b12ed54cbee /drivers/gpu/drm/tyr/gem.rs
parent43a5d04a743b499dbad31083a62cdcb46ee74391 (diff)
downloadlinux-next-0023a1e8d01a9d400257d30c851bd16a29568809.tar.gz
linux-next-0023a1e8d01a9d400257d30c851bd16a29568809.zip
rust/drm/gem: Use DeviceContext with GEM objects
Now that we have the ability to represent the context in which a DRM device is in at compile-time, we can start carrying around this context with GEM object types in order to allow a driver to safely create GEM objects before a DRM device has registered with userspace. Signed-off-by: Lyude Paul <lyude@redhat.com> Reviewed-by: Daniel Almeida <daniel.almeida@collabora.com> Link: https://patch.msgid.link/20260507220044.3204919-4-lyude@redhat.com Signed-off-by: Danilo Krummrich <dakr@kernel.org>
Diffstat (limited to 'drivers/gpu/drm/tyr/gem.rs')
-rw-r--r--drivers/gpu/drm/tyr/gem.rs11
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/gpu/drm/tyr/gem.rs b/drivers/gpu/drm/tyr/gem.rs
index 1640a161754b..c6d4d6f9bae3 100644
--- a/drivers/gpu/drm/tyr/gem.rs
+++ b/drivers/gpu/drm/tyr/gem.rs
@@ -5,7 +5,10 @@
//! DRM's GEM subsystem with shmem backing.
use kernel::{
- drm::gem,
+ drm::{
+ gem,
+ DeviceContext, //
+ },
prelude::*, //
};
@@ -30,7 +33,11 @@ impl gem::DriverObject for BoData {
type Driver = TyrDrmDriver;
type Args = BoCreateArgs;
- fn new(_dev: &TyrDrmDevice, _size: usize, args: BoCreateArgs) -> impl PinInit<Self, Error> {
+ fn new<Ctx: DeviceContext>(
+ _dev: &TyrDrmDevice<Ctx>,
+ _size: usize,
+ args: BoCreateArgs,
+ ) -> impl PinInit<Self, Error> {
try_pin_init!(Self { flags: args.flags })
}
}