[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <C0299B00-B2E9-44F7-8527-D6C03D95786E@collabora.com>
Date: Fri, 25 Jul 2025 14:06:19 -0300
From: Daniel Almeida <daniel.almeida@...labora.com>
To: Alexandre Courbot <acourbot@...dia.com>
Cc: Danilo Krummrich <dakr@...nel.org>,
David Airlie <airlied@...il.com>,
Simona Vetter <simona@...ll.ch>,
Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
Maxime Ripard <mripard@...nel.org>,
Thomas Zimmermann <tzimmermann@...e.de>,
Beata Michalska <beata.michalska@....com>,
nouveau@...ts.freedesktop.org,
dri-devel@...ts.freedesktop.org,
rust-for-linux@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 09/19] gpu: nova-core: register: add missing
doccomments for fixed registers I/O accessors
> On 18 Jul 2025, at 04:26, Alexandre Courbot <acourbot@...dia.com> wrote:
>
> Add the missing doccomments for these accessors, as having a bit of
> inline documentation is always helpful.
>
> Signed-off-by: Alexandre Courbot <acourbot@...dia.com>
> ---
> drivers/gpu/nova-core/regs/macros.rs | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/drivers/gpu/nova-core/regs/macros.rs b/drivers/gpu/nova-core/regs/macros.rs
> index 32fbd7e7deb9edeed91972a373a5a6ac7ce9db53..0a18a0d76b2265d3138f93ffc7c561b94bca3187 100644
> --- a/drivers/gpu/nova-core/regs/macros.rs
> +++ b/drivers/gpu/nova-core/regs/macros.rs
> @@ -300,6 +300,7 @@ pub(crate) fn [<set_ $field>](mut self, value: $to_type) -> Self {
> impl $name {
> pub(crate) const OFFSET: usize = $offset;
>
> + /// Read the register from its address in `io`.
> #[inline]
> pub(crate) fn read<const SIZE: usize, T>(io: &T) -> Self where
> T: ::core::ops::Deref<Target = ::kernel::io::Io<SIZE>>,
> @@ -307,6 +308,7 @@ pub(crate) fn read<const SIZE: usize, T>(io: &T) -> Self where
> Self(io.read32($offset))
> }
>
> + /// Write the value contained in `self` to the register address in `io`.
> #[inline]
> pub(crate) fn write<const SIZE: usize, T>(self, io: &T) where
> T: ::core::ops::Deref<Target = ::kernel::io::Io<SIZE>>,
> @@ -314,6 +316,8 @@ pub(crate) fn write<const SIZE: usize, T>(self, io: &T) where
> io.write32(self.0, $offset)
> }
>
> + /// Read the register from its address in `io` and run `f` on its value to obtain a new
> + /// value to write back.
Ah, really neat!
> #[inline]
> pub(crate) fn alter<const SIZE: usize, T, F>(
> io: &T,
>
> --
> 2.50.1
>
>
Reviewed-by: Daniel Almeida <daniel.almeida@...labora.com>
Powered by blists - more mailing lists