This patch converts all the bindings to use the new zerocopy library. Bindings are currently generated using a fairly simple bindgen script[1]. This is a temporary solution until the bindings have been stablisied but for now upstream should be kept in sync with the resulting output.
Note that this does not completely remove all users of the transmute From/AsBytes traits from nova-core, leaving some ambiguity with when referring to FromBytes. However others have recently posted patches[2][3][4] to remove the majority of other uses which should allow us to remove transmute::FromBytes entirely from nova-core. Given the inevitable conflicts that will arise from trying to merge several different series doing bits of the same thing I'm happy if someone wants to take this patch and the others and roll them into a single series. Alternatively I am happy to take that on - hopefully Alex can provide some guidance here for what would be preferred. [1] - https://github.com/apopple-nvidia/nova-gsp-binding-generator/tree/zerocopy [2] - https://lore.kernel.org/rust-for-linux/[email protected]/ [3] - https://lore.kernel.org/rust-for-linux/[email protected]/ [4] - https://lore.kernel.org/rust-for-linux/[email protected]/ Cc: Danilo Krummrich <[email protected]> Cc: Alice Ryhl <[email protected]> Cc: Miguel Ojeda <[email protected] Cc: "Nicolás Antinori" <[email protected]> Cc: "Alexandre Courbot" <[email protected]> Cc: "David Airlie" <[email protected]> Cc: "Shuah Khan" <[email protected]> Cc: "Simona Vetter" <[email protected]> Cc: "Gary Guo" <[email protected]> Cc: "Onur Özkan" <[email protected]> Cc: "Tamir Duberstein" <[email protected]> Cc: "Trevor Gross" <[email protected]> Cc: Pedro Yudi Honda <[email protected]> Cc: SeungJong Ha <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Alistair Popple (1): nova-core: Update firmware bindings to use zerocopy traits drivers/gpu/nova-core/Makefile | 4 + drivers/gpu/nova-core/gsp/cmdq.rs | 21 +- .../gpu/nova-core/gsp/cmdq/continuation.rs | 16 +- drivers/gpu/nova-core/gsp/commands.rs | 19 +- drivers/gpu/nova-core/gsp/fw.rs | 54 +---- drivers/gpu/nova-core/gsp/fw/commands.rs | 50 ++--- drivers/gpu/nova-core/gsp/fw/r570_144.rs | 41 ++++ .../gpu/nova-core/gsp/fw/r570_144/bindings.rs | 185 ++++++++++++------ drivers/gpu/nova-core/gsp/sequencer.rs | 5 +- scripts/Makefile.build | 4 +- 10 files changed, 223 insertions(+), 176 deletions(-) -- 2.54.0
