diff --git a/rust/kernel/drm/kms/crtc.rs b/rust/kernel/drm/kms/crtc.rs index 43c7264402b071c92eb4556e109541cfc32c1e59..ec9b58763dcca4ee23b6929d54d8bbedfc9f8ade 100644 --- a/rust/kernel/drm/kms/crtc.rs +++ b/rust/kernel/drm/kms/crtc.rs @@ -496,6 +496,14 @@ pub trait RawCrtcState: AsRawCrtcState { // 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 {}