From: "Gary Guo" <gary@garyguo.net>
To: "Danilo Krummrich" <dakr@kernel.org>, <aliceryhl@google.com>,
<daniel.almeida@collabora.com>, <airlied@gmail.com>,
<simona@ffwll.ch>, <lossin@kernel.org>, <gary@garyguo.net>,
<ojeda@kernel.org>, <boqun@kernel.org>,
<bjorn3_gh@protonmail.com>, <a.hindborg@kernel.org>,
<tmgross@umich.edu>, <tamird@kernel.org>, <acourbot@nvidia.com>,
<work@onurozkan.dev>
Cc: <dri-devel@lists.freedesktop.org>,
<rust-for-linux@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2 2/3] drm/tyr: use pin-init self-referential support
Date: Thu, 03 Dec 2026 12:24:56 +0000 [thread overview]
Message-ID: <DNB3GBR3SBM9.361032JRHDZTI@garyguo.net> (raw)
In-Reply-To: <20261130231950.955224-3-dakr@kernel.org>
On Mon Nov 30, 2026 at 11:19 PM GMT, Danilo Krummrich wrote:
> Now that pin-init supports self-referential structs, Arc is no longer
> needed just to share resources whose lifetimes are bounded by their
> owners.
>
> Use pin-init's self-referential support to share the MMIO mapping, MMU
> and firmware VM through borrows instead of Arc, avoiding their separate
> allocations and reference counts.
>
> Hide the invariant resource lifetime shared by the VM and its sections
> behind an existential lifetime that outlives 'mmu, so Firmware only needs
> a single lifetime parameter.
>
> Cc: Gary Guo <gary@garyguo.net>
> Signed-off-by: Danilo Krummrich <dakr@kernel.org>
Reviewed-by: Gary Guo <gary@garyguo.net>
> ---
> drivers/gpu/drm/tyr/driver.rs | 38 +++---
> drivers/gpu/drm/tyr/fw.rs | 152 ++++++++++++-----------
> drivers/gpu/drm/tyr/gem.rs | 15 +--
> drivers/gpu/drm/tyr/mmu.rs | 36 +++---
> drivers/gpu/drm/tyr/mmu/address_space.rs | 14 +--
> drivers/gpu/drm/tyr/tyr.rs | 5 +
> drivers/gpu/drm/tyr/vm.rs | 93 +++++++-------
> 7 files changed, 179 insertions(+), 174 deletions(-)
>
> diff --git a/drivers/gpu/drm/tyr/driver.rs b/drivers/gpu/drm/tyr/driver.rs
> index 557f2ec0a767..a2fa7350f144 100644
> --- a/drivers/gpu/drm/tyr/driver.rs
> +++ b/drivers/gpu/drm/tyr/driver.rs
> @@ -29,7 +29,7 @@
> regulator::Regulator,
> sizes::SZ_2M,
> sync::{
> - Arc,
> + aref::ARef,
> Mutex, //
> },
> time, //
> @@ -71,7 +71,14 @@ pub(crate) struct TyrDrmRegistrationData<'drm> {
> pub(crate) pdev: &'drm platform::Device<Bound>,
>
> /// Firmware sections.
> - pub(crate) fw: Firmware<'drm>,
> + #[pin]
> + #[uses('mmu: invariant)]
> + pub(crate) fw: Firmware<'mmu>,
> +
> + /// MMU shared by the firmware and its buffer objects.
> + #[pin]
> + #[uses('iomem: invariant)]
> + mmu: Mmu<'iomem>,
>
> #[pin]
> clks: Mutex<Clocks>,
> @@ -80,7 +87,7 @@ pub(crate) struct TyrDrmRegistrationData<'drm> {
This isn't renamed because it's top-level I suppose?
Best,
Gary
> regulators: Mutex<Regulators>,
>
> /// GPU MMIO register mapping.
> - pub(crate) iomem: Arc<IoMem<'drm>>,
> + pub(crate) iomem: IoMem<'drm>,
>
> /// GPU information read from hardware during probe.
> pub(crate) gpu_info: GpuInfo,
next prev parent reply other threads:[~2026-12-03 12:25 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-30 23:19 [PATCH v2 0/3] " Danilo Krummrich
2026-11-30 23:19 ` [PATCH v2 1/3] drm/tyr: clarify resource lifetime names Danilo Krummrich
2026-12-03 10:30 ` Alice Ryhl
2026-12-03 12:23 ` Gary Guo
2026-11-30 23:19 ` [PATCH v2 2/3] drm/tyr: use pin-init self-referential support Danilo Krummrich
2026-12-03 10:41 ` Alice Ryhl
2026-12-03 12:24 ` Gary Guo [this message]
2026-11-30 23:19 ` [PATCH v2 3/3] drm/tyr: use ScopeGuard for firmware loading cleanup Danilo Krummrich
2026-12-03 10:47 ` Alice Ryhl
2026-12-03 12:26 ` Gary Guo
2026-12-03 12:36 ` [PATCH v2 0/3] drm/tyr: use pin-init self-referential support Daniel Almeida
2026-12-04 20:34 ` Daniel Almeida
2026-12-05 0:33 ` Danilo Krummrich
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=DNB3GBR3SBM9.361032JRHDZTI@garyguo.net \
--to=gary@garyguo.net \
--cc=a.hindborg@kernel.org \
--cc=acourbot@nvidia.com \
--cc=airlied@gmail.com \
--cc=aliceryhl@google.com \
--cc=bjorn3_gh@protonmail.com \
--cc=boqun@kernel.org \
--cc=dakr@kernel.org \
--cc=daniel.almeida@collabora.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lossin@kernel.org \
--cc=ojeda@kernel.org \
--cc=rust-for-linux@vger.kernel.org \
--cc=simona@ffwll.ch \
--cc=tamird@kernel.org \
--cc=tmgross@umich.edu \
--cc=work@onurozkan.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®