[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <DE0QGXOEPA7E.22KWRNULPUQ72@nvidia.com>
Date: Wed, 05 Nov 2025 20:44:04 +0900
From: "Alexandre Courbot" <acourbot@...dia.com>
To: "Alexandre Courbot" <acourbot@...dia.com>, "Miguel Ojeda"
<ojeda@...nel.org>, "Alex Gaynor" <alex.gaynor@...il.com>, "Boqun Feng"
<boqun.feng@...il.com>, "Gary Guo" <gary@...yguo.net>,
Björn Roy Baron <bjorn3_gh@...tonmail.com>, "Benno Lossin"
<lossin@...nel.org>, "Andreas Hindborg" <a.hindborg@...nel.org>, "Alice
Ryhl" <aliceryhl@...gle.com>, "Trevor Gross" <tmgross@...ch.edu>, "Danilo
Krummrich" <dakr@...nel.org>, "David Airlie" <airlied@...il.com>, "Simona
Vetter" <simona@...ll.ch>
Cc: "John Hubbard" <jhubbard@...dia.com>, "Alistair Popple"
<apopple@...dia.com>, "Joel Fernandes" <joelagnelf@...dia.com>, "Timur
Tabi" <ttabi@...dia.com>, "Edwin Peer" <epeer@...dia.com>,
<rust-for-linux@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<nouveau@...ts.freedesktop.org>, <dri-devel@...ts.freedesktop.org>,
"Nouveau" <nouveau-bounces@...ts.freedesktop.org>
Subject: Re: [PATCH 0/5] gpu: nova-core: leverage FromBytes for VBIOS
structures
On Wed Oct 29, 2025 at 12:07 AM JST, Alexandre Courbot wrote:
> This series spawns from the discussion in [1], where it was noticed that
> several structures of the VBIOS could just be read using `FromBytes`
> instead of being built manually.
>
> While implementing it, I also noticed that we were repeating the
> following pattern quite a bit in the code:
>
> slice
> .get(..size_of::<TargetType>())
> .and_then(TargetType::from_bytes_copy)
>
> ... which begs for dedicated methods doing this in the `FromBytes`
> trait. This is what the first patch does, taking inspiration from a
> similar feature in the `zerocopy` crate.
>
> The remaining patches leverage these new methods to simplify the VBIOS
> code a bit, accordingly.
>
> If patch 1 is deemed a valid idea, I hope we can merge it into the DRM
> tree along with the rest of this series.
>
> The base for this work is `drm-rust-next`, with [2] applied.
>
> [1] https://lore.kernel.org/rust-for-linux/DDTRW1P2I4PB.10ZTZDY95JBC5@nvidia.com/
> [2] https://lore.kernel.org/rust-for-linux/20251026-nova-as-v1-1-60c78726462d@nvidia.com/
>
> Signed-off-by: Alexandre Courbot <acourbot@...dia.com>
Pushed to drm-rust-next, thanks for the reviews!
Powered by blists - more mailing lists