2
0
mirror of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git synced 2025-09-04 20:19:47 +08:00
linux/rust/kernel/drm
Lyude Paul 38cb08c3fc rust: drm: gem: Implement AlwaysRefCounted for all gem objects automatically
Currently we are requiring AlwaysRefCounted in most trait bounds for gem
objects, and implementing it by hand for our only current type of gem
object. However, all gem objects use the same functions for reference
counting - and all gem objects support reference counting.

We're planning on adding support for shmem gem objects, let's move this
around a bit by instead making IntoGEMObject require AlwaysRefCounted as a
trait bound, and then provide a blanket AlwaysRefCounted implementation for
any object that implements IntoGEMObject so all gem object types can use
the same AlwaysRefCounted implementation. This also makes things less
verbose by making the AlwaysRefCounted trait bound implicit for any
IntoGEMObject bound.

Signed-off-by: Lyude Paul <lyude@redhat.com>
Reviewed-by: Daniel Almeida <daniel.almeida@collabora.com>
Link: https://lore.kernel.org/r/20250513221046.903358-5-lyude@redhat.com
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
2025-05-14 00:37:16 +02:00
..
gem rust: drm: gem: Implement AlwaysRefCounted for all gem objects automatically 2025-05-14 00:37:16 +02:00
device.rs rust: drm: gem: Add GEM object abstraction 2025-04-28 10:08:23 +02:00
driver.rs rust: drm: gem: Add GEM object abstraction 2025-04-28 10:08:23 +02:00
file.rs rust: drm: file: Add File abstraction 2025-04-24 14:11:58 +02:00
ioctl.rs rust: drm: ioctl: Add DRM ioctl abstraction 2025-04-24 13:50:05 +02:00
mod.rs rust: drm: gem: Add GEM object abstraction 2025-04-28 10:08:23 +02:00