diff --git a/rust/kernel/drm/kms/plane.rs b/rust/kernel/drm/kms/plane.rs index 3fe8941f464854f60bbdbb6833378fb8a95a560e..03a2266bb36657392090cf97bdbc26862adf9204 100644 --- a/rust/kernel/drm/kms/plane.rs +++ b/rust/kernel/drm/kms/plane.rs @@ -451,6 +451,26 @@ pub trait RawPlaneState: AsRawPlaneState { // SAFETY: The layout of Framebuffer<T> is identical to `fb` unsafe { self.as_raw().fb.as_ref().map(|fb| Framebuffer::from_raw(fb)) } } + + /// The (maybe clipped) source coordinates of the plane + /// + /// When using `Plane::atomic_helper_check()`, the coordinates are clipped, but the driver may + /// choose to use unclipped coordinates instead when the hardware performs the clipping + /// automatically. + #[inline] + fn src(&self) -> &Rect { + self.as_raw().src.as_ref() + } + + /// The (maybe clipped) dst coordinates of the plane + /// + /// When using `Plane::atomic_helper_check()`, the coordinates are clipped, but the driver may + /// choose to use unclipped coordinates instead when the hardware performs the clipping + /// automatically. + #[inline] + fn dst(&self) -> &Rect { + self.as_raw().dst.as_ref() + } } impl<T: AsRawPlaneState + ?Sized> RawPlaneState for T {}