diff options
| author | Danilo Krummrich <dakr@kernel.org> | 2026-06-28 16:53:27 +0200 |
|---|---|---|
| committer | Danilo Krummrich <dakr@kernel.org> | 2026-07-12 15:56:52 +0200 |
| commit | ec8b2cc27c766fab80f70b02d196b7c3be7d10ce (patch) | |
| tree | a9f84cae205c6ee8aab512e730c5b491f499bec5 /drivers/gpu/drm/tyr/gem.rs | |
| parent | 506a7d63dab00f0f279869c956b986749292623a (diff) | |
| download | linux-next-ec8b2cc27c766fab80f70b02d196b7c3be7d10ce.tar.gz linux-next-ec8b2cc27c766fab80f70b02d196b7c3be7d10ce.zip | |
rust: drm: restrict AlwaysRefCounted to Normal GEM Object context
Restrict AlwaysRefCounted for gem::Object and gem::shmem::Object to the
Normal context, since only Normal objects should be independently
reference-counted.
To avoid cascading through IntoGEMObject (which had AlwaysRefCounted as
a supertrait), remove AlwaysRefCounted from IntoGEMObject's supertraits
and instead add it as an explicit bound on lookup_handle(), which is the
only BaseObject method that returns an ARef.
Since Object::new() and shmem::Object::new() return ARef<Self>, move
them to Normal-only impl blocks. Similarly, simplify ObjectConfig and
shmem's parent_resv_obj field to the Normal context.
Remove the DeviceContext generic from DriverObject::new() and
Driver::Object, since GEM objects can only be constructed in the Normal
context. Simplify DriverAllocImpl accordingly.
Reviewed-by: Lyude Paul <lyude@redhat.com>
Reviewed-by: Alexandre Courbot <acourbot@nvidia.com>
Tested-by: Deborah Brouwer <deborah.brouwer@collabora.com>
Link: https://patch.msgid.link/20260628145406.2107056-8-dakr@kernel.org
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.rs | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/drivers/gpu/drm/tyr/gem.rs b/drivers/gpu/drm/tyr/gem.rs index c6d4d6f9bae3..1640a161754b 100644 --- a/drivers/gpu/drm/tyr/gem.rs +++ b/drivers/gpu/drm/tyr/gem.rs @@ -5,10 +5,7 @@ //! DRM's GEM subsystem with shmem backing. use kernel::{ - drm::{ - gem, - DeviceContext, // - }, + drm::gem, prelude::*, // }; @@ -33,11 +30,7 @@ impl gem::DriverObject for BoData { type Driver = TyrDrmDriver; type Args = BoCreateArgs; - fn new<Ctx: DeviceContext>( - _dev: &TyrDrmDevice<Ctx>, - _size: usize, - args: BoCreateArgs, - ) -> impl PinInit<Self, Error> { + fn new(_dev: &TyrDrmDevice, _size: usize, args: BoCreateArgs) -> impl PinInit<Self, Error> { try_pin_init!(Self { flags: args.flags }) } } |
