Skip to content

Commit f7572f7

Browse files
committed
drm/asahi: initdata: Fold GlobalsSub struct into Globals
With commit 42415d1 ("rust: pin-init: add references to previously initialized fields") "#[repr(C, packed)]" structs can no longer be embedded into (pin-)init structs because they have an lignment of 1. Signed-off-by: Janne Grunau <j@jannau.net>
1 parent 9a9b862 commit f7572f7

2 files changed

Lines changed: 17 additions & 24 deletions

File tree

drivers/gpu/drm/asahi/fw/initdata.rs

Lines changed: 14 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1007,26 +1007,6 @@ pub(crate) mod raw {
10071007
}
10081008
default_zeroed!(FaultInfo);
10091009

1010-
#[versions(AGX)]
1011-
#[derive(Debug, Clone, Copy)]
1012-
#[repr(C, packed)]
1013-
pub(crate) struct GlobalsSub {
1014-
pub(crate) unk_54: u16,
1015-
pub(crate) unk_56: u16,
1016-
pub(crate) unk_58: u16,
1017-
pub(crate) unk_5a: U32,
1018-
pub(crate) unk_5e: U32,
1019-
pub(crate) unk_62: U32,
1020-
1021-
#[ver(V >= V13_0B4)]
1022-
pub(crate) unk_66_0: Array<0xc, u8>,
1023-
1024-
pub(crate) unk_66: U32,
1025-
pub(crate) unk_6a: Array<0x16, u8>,
1026-
}
1027-
#[versions(AGX)]
1028-
default_zeroed!(GlobalsSub::ver);
1029-
10301010
#[derive(Debug, Clone, Copy)]
10311011
#[repr(C)]
10321012
pub(crate) struct PowerZoneGlobal {
@@ -1064,7 +1044,20 @@ pub(crate) mod raw {
10641044
pub(crate) unk_34: u32,
10651045
pub(crate) unk_38: Array<0x1c, u8>,
10661046

1067-
pub(crate) sub: GlobalsSub::ver,
1047+
// pub(crate) sub: GlobalsSub::ver,
1048+
pub(crate) unk_54: u16,
1049+
pub(crate) unk_56: u16,
1050+
pub(crate) unk_58: u16,
1051+
pub(crate) unk_5a: U32,
1052+
pub(crate) unk_5e: U32,
1053+
pub(crate) unk_62: U32,
1054+
1055+
#[ver(V >= V13_0B4)]
1056+
pub(crate) unk_66_0: Array<0xc, u8>,
1057+
1058+
pub(crate) unk_66: U32,
1059+
pub(crate) unk_6a: Array<0x16, u8>,
1060+
// end GlobalsSub::ver
10681061

10691062
pub(crate) unk_80: Array<0xf80, u8>,
10701063
pub(crate) unk_1000: Array<0x7000, u8>,

drivers/gpu/drm/asahi/initdata.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -670,14 +670,14 @@ impl<'a> InitDataBuilder::ver<'a> {
670670
unk_2c: 1,
671671
unk_30: 0,
672672
unk_34: 120,
673-
sub <- try_init!(raw::GlobalsSub::ver {
673+
// sub <- try_init!(raw::GlobalsSub::ver {
674674
unk_54: cfg.global_unk_54,
675675
unk_56: 40,
676676
unk_58: 0xffff,
677677
unk_5e: U32(1),
678678
unk_66: U32(1),
679-
..Zeroable::init_zeroed()
680-
}),
679+
// ..Zeroable::init_zeroed()
680+
// }),
681681
unk_8900: 1,
682682
pending_submissions: AtomicU32::new(0),
683683
max_power: pwr.max_power_mw,

0 commit comments

Comments
 (0)