[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20260116204728.725579-1-lyude@redhat.com>
Date: Fri, 16 Jan 2026 15:41:40 -0500
From: Lyude Paul <lyude@...hat.com>
To: dri-devel@...ts.freedesktop.org,
nouveau@...ts.freedesktop.org,
linux-kernel@...r.kernel.org
Cc: rust-for-linux@...r.kernel.org,
"Ewan Chorynski" <ewan.chorynski@...me>,
"Miguel Ojeda" <ojeda@...nel.org>,
"Simona Vetter" <simona@...ll.ch>,
"Alice Ryhl" <aliceryhl@...gle.com>,
"Shankari Anand" <shankari.ak0208@...il.com>,
"David Airlie" <airlied@...il.com>,
"Benno Lossin" <lossin@...nel.org>,
"Danilo Krummrich" <dakr@...nel.org>,
"Asahi Lina" <lina+kernel@...hilina.net>,
"Atharv Dubey" <atharvd440@...il.com>,
"Daniel Almeida" <daniel.almeida@...labora.com>,
"Lyude Paul" <lyude@...hat.com>
Subject: [PATCH v2 0/3] Introduce DeviceContext
Previous version of this patch series:
https://lists.freedesktop.org/archives/dri-devel/2025-November/535387.html
One of the unsolved issues we still have with the rust DRM bindings is
the ability to limit certain Device operations to contexts where we can
guarantee that a Device has been fully initialized and registered with
userspace, or vice-versa (e.g. must be unregistered).
While the previous solution for this that I had was simply not exposing
drm::Device at all until the device has been registered with userspace,
unfortunately this isn't enough since:
* As we found out with Tyr, drivers occasionally need to be able to
create GEM objects before device registration
* We would still need to be able to handle KMS callbacks which could be
invoked after KMS init but before userspace registration (not handled
in this series specifically, but DeviceContext will be required for
handling this).
This patch series provides a pretty nice solution to this, by
implementing a very similar solution to kernel::device::DeviceContext:
introducing our own DeviceContext type state.
Series-wide changes
V2:
* s/DeviceCtx/DeviceContext/ for consistency
* Move private driver-data availability to the Registration
DeviceContext
* s/AnyCtx/Init/
More changes described in each patch description.
Lyude Paul (3):
rust/drm: Introduce DeviceContext
rust/drm: Don't setup private driver data until registration
rust/drm/gem: Use DeviceContext with GEM objects
drivers/gpu/drm/nova/driver.rs | 10 +-
drivers/gpu/drm/nova/gem.rs | 11 +-
drivers/gpu/drm/tyr/driver.rs | 12 +-
drivers/gpu/drm/tyr/gem.rs | 3 +-
rust/kernel/drm/device.rs | 231 +++++++++++++++++++++++++--------
rust/kernel/drm/driver.rs | 56 ++++++--
rust/kernel/drm/gem/mod.rs | 66 ++++++----
rust/kernel/drm/mod.rs | 4 +
8 files changed, 292 insertions(+), 101 deletions(-)
base-commit: 086714bbb96f63785da251e1f8d1ce3e716a6e42
--
2.52.0
Powered by blists - more mailing lists