diff --git a/drivers/gpu/drm/asahi/fw/channels.rs b/drivers/gpu/drm/asahi/fw/channels.rs index 200ea0333f4d7a..85bfc1cec0a255 100644 --- a/drivers/gpu/drm/asahi/fw/channels.rs +++ b/drivers/gpu/drm/asahi/fw/channels.rs @@ -5,6 +5,7 @@ use super::types::*; use crate::default_zeroed; use core::sync::atomic::Ordering; +use kernel::static_assert; pub(crate) mod raw { use super::*; @@ -215,6 +216,9 @@ pub(crate) enum DeviceControlMsg { Initialize(Pad), // Update RegionC } +#[versions(AGX)] +static_assert!(core::mem::size_of::() == 4 + DEVICECONTROL_SZ::ver); + #[versions(AGX)] default_zeroed!(DeviceControlMsg::ver); @@ -256,6 +260,8 @@ pub(crate) enum EventMsg { }, // Max discriminant: 0x7 } +static_assert!(core::mem::size_of::() == 4 + EVENT_SZ); + pub(crate) const EVENT_MAX: u32 = 0x7; #[derive(Copy, Clone)] @@ -392,6 +398,9 @@ pub(crate) enum StatsMsg { }, // Max discriminant: 0xe } +#[versions(AGX)] +static_assert!(core::mem::size_of::() == 4 + STATS_SZ::ver); + #[versions(AGX)] pub(crate) const STATS_MAX: u32 = 0xe;