[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <628D2479-AC44-402C-B15D-CBE0927F7053@collabora.com>
Date: Thu, 28 Nov 2024 10:54:41 -0300
From: Daniel Almeida <daniel.almeida@...labora.com>
To: Lyude Paul <lyude@...hat.com>
Cc: dri-devel@...ts.freedesktop.org,
rust-for-linux@...r.kernel.org,
Asahi Lina <lina@...hilina.net>,
Danilo Krummrich <dakr@...nel.org>,
mcanal@...lia.com,
airlied@...hat.com,
zhiw@...dia.com,
cjia@...dia.com,
jhubbard@...dia.com,
Miguel Ojeda <ojeda@...nel.org>,
Alex Gaynor <alex.gaynor@...il.com>,
Wedson Almeida Filho <wedsonaf@...il.com>,
Boqun Feng <boqun.feng@...il.com>,
Gary Guo <gary@...yguo.net>,
Björn Roy Baron <bjorn3_gh@...tonmail.com>,
Benno Lossin <benno.lossin@...ton.me>,
Andreas Hindborg <a.hindborg@...sung.com>,
Alice Ryhl <aliceryhl@...gle.com>,
Trevor Gross <tmgross@...ch.edu>,
open list <linux-kernel@...r.kernel.org>
Subject: Re: [WIP RFC v2 24/35] rust: drm/kms: Add RawCrtcState::active()
Hi Lyude,
> On 30 Sep 2024, at 20:10, Lyude Paul <lyude@...hat.com> wrote:
>
> A binding for checking drm_crtc_state.active.
>
> Signed-off-by: Lyude Paul <lyude@...hat.com>
> ---
> rust/kernel/drm/kms/crtc.rs | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/rust/kernel/drm/kms/crtc.rs b/rust/kernel/drm/kms/crtc.rs
> index 43c7264402b07..ec9b58763dcca 100644
> --- a/rust/kernel/drm/kms/crtc.rs
> +++ b/rust/kernel/drm/kms/crtc.rs
> @@ -496,6 +496,14 @@ fn crtc(&self) -> &Self::Crtc {
> // state
> unsafe { <Self::Crtc as AsRawCrtc>::from_raw((*self.as_raw()).crtc) }
> }
> +
> + /// Returns whether or not the CRTC is active in this atomic state.
> + fn active(&self) -> bool {
> + // SAFETY: `active` and the rest of its containing bitfield can only be modified from the
> + // atomic check context, and are invariant beyond that point - so our interface can ensure
> + // this access is serialized
> + unsafe { (*self.as_raw()).active }
> + }
> }
> impl<T: AsRawCrtcState> RawCrtcState for T {}
>
> --
> 2.46.1
>
>
LGTM.
— Daniel
Powered by blists - more mailing lists