From: Alice Ryhl <aliceryhl@google.com>
To: Deborah Brouwer <deborah.brouwer@collabora.com>
Cc: "Alice Ryhl" <aliceryhl@google.com>,
"Danilo Krummrich" <dakr@kernel.org>,
"Daniel Almeida" <daniel.almeida@collabora.com>,
"David Airlie" <airlied@gmail.com>,
"Simona Vetter" <simona@ffwll.ch>,
"Miguel Ojeda" <ojeda@kernel.org>,
"Boqun Feng" <boqun@kernel.org>, "Gary Guo" <gary@garyguo.net>,
"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
"Benno Lossin" <lossin@kernel.org>,
"Andreas Hindborg" <a.hindborg@kernel.org>,
"Trevor Gross" <tmgross@umich.edu>,
"Tamir Duberstein" <tamird@kernel.org>,
"Alexandre Courbot" <acourbot@nvidia.com>,
"Onur Özkan" <work@onurozkan.dev>,
dri-devel@lists.freedesktop.org, rust-for-linux@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4 2/2] drm/tyr: safely write GpuInfo to userspace
Date: Tue, 20 Oct 2026 08:01:08 +0000 [thread overview]
Message-ID: <20261020080108.1742496-1-aliceryhl@google.com> (raw)
In-Reply-To: <20261019-b4-gpu_info_intobytes-v4-2-0bc04df46549@collabora.com>
On Mon, Oct 19, 2026 at 04:26:00PM -0700, Deborah Brouwer wrote:
> diff --git a/drivers/gpu/drm/tyr/gpu.rs b/drivers/gpu/drm/tyr/gpu.rs
> index e1b04a0c5159..4808bcbcc3b9 100644
> --- a/drivers/gpu/drm/tyr/gpu.rs
> +++ b/drivers/gpu/drm/tyr/gpu.rs
> @@ -28,6 +27,8 @@
> }, //
> };
>
> +use zerocopy_derive::Immutable;
> +
> /// Struct containing information that can be queried by userspace. This is read from
> /// the GPU's registers.
> ///
> @@ -35,7 +36,7 @@
> ///
> /// - The layout of this struct is identical to the C `struct drm_panthor_gpu_info`.
> #[repr(transparent)]
> -#[derive(Clone, Copy)]
> +#[derive(Clone, Copy, IntoBytes, Immutable)]
> pub(crate) struct GpuInfo(pub(crate) uapi::drm_panthor_gpu_info);
Two tiny optional nits since you'll need a v5 for patch 1:
* `use zerocopy_derive::Immutable;` can be placed above `use crate::{`
with the external crate imports.
* Now that `unsafe impl AsBytes for GpuInfo {}` is removed, nothing
relies on `GpuInfo`'s `# Invariants` doc section anymore, so that
comment block can be dropped too.
Otherwise this looks good to me. Feel free to keep my R-b on v5 with or
without those tweaks:
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Alice
prev parent reply other threads:[~2026-10-20 8:01 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-19 23:25 [PATCH v4 0/2] " Deborah Brouwer
2026-10-19 23:25 ` [PATCH v4 1/2] rust/Makefile: add zerocopy and zerocopy_derive Deborah Brouwer
2026-10-20 8:01 ` Alice Ryhl
2026-10-19 23:26 ` [PATCH v4 2/2] drm/tyr: safely write GpuInfo to userspace Deborah Brouwer
2026-10-20 8:01 ` Alice Ryhl [this message]
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=20261020080108.1742496-1-aliceryhl@google.com \
--to=aliceryhl@google.com \
--cc=a.hindborg@kernel.org \
--cc=acourbot@nvidia.com \
--cc=airlied@gmail.com \
--cc=bjorn3_gh@protonmail.com \
--cc=boqun@kernel.org \
--cc=dakr@kernel.org \
--cc=daniel.almeida@collabora.com \
--cc=deborah.brouwer@collabora.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=gary@garyguo.net \
--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®