[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250423225405.139613-6-joelagnelf@nvidia.com>
Date: Wed, 23 Apr 2025 18:54:01 -0400
From: Joel Fernandes <joelagnelf@...dia.com>
To: linux-kernel@...r.kernel.org,
Danilo Krummrich <dakr@...nel.org>,
David Airlie <airlied@...il.com>,
Simona Vetter <simona@...ll.ch>
Cc: nouveau@...ts.freedesktop.org,
dri-devel@...ts.freedesktop.org,
Alexandre Courbot <acourbot@...dia.com>,
John Hubbard <jhubbard@...dia.com>,
Shirish Baskaran <sbaskaran@...dia.com>,
Alistair Popple <apopple@...dia.com>,
Timur Tabi <ttabi@...dia.com>,
Ben Skeggs <bskeggs@...dia.com>,
Joel Fernandes <joelagnelf@...dia.com>
Subject: [PATCH 5/6] gpu: nova-core: Clarify fields in FalconAppifHdrV1
Signed-off-by: Joel Fernandes <joelagnelf@...dia.com>
---
drivers/gpu/nova-core/firmware/fwsec.rs | 17 ++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)
diff --git a/drivers/gpu/nova-core/firmware/fwsec.rs b/drivers/gpu/nova-core/firmware/fwsec.rs
index 664319d1d31c..79c21db9d89d 100644
--- a/drivers/gpu/nova-core/firmware/fwsec.rs
+++ b/drivers/gpu/nova-core/firmware/fwsec.rs
@@ -29,11 +29,14 @@
#[repr(C)]
#[derive(Debug)]
+
+/// The header of the Application Interface table, used
+/// to locate the DMEMMAPPER section in the DMEM (see fwsec.rst).
struct FalconAppifHdrV1 {
- ver: u8,
- hdr: u8,
- len: u8,
- cnt: u8,
+ version: u8,
+ header_size: u8,
+ entry_size: u8,
+ entry_count: u8,
}
// SAFETY: any byte sequence is valid for this struct.
unsafe impl FromBytes for FalconAppifHdrV1 {}
@@ -169,14 +172,14 @@ fn patch_command(fw: &mut DmaObject, v3_desc: &FalconUCodeDescV3, cmd: FwsecComm
let hdr_offset = (v3_desc.imem_load_size + v3_desc.interface_offset) as usize;
let hdr: &FalconAppifHdrV1 = unsafe { transmute(fw, hdr_offset) }?;
- if hdr.ver != 1 {
+ if hdr.version != 1 {
return Err(EINVAL);
}
// Find the DMEM mapper section in the firmware.
- for i in 0..hdr.cnt as usize {
+ for i in 0..hdr.entry_count as usize {
let app: &FalconAppifV1 =
- unsafe { transmute(fw, hdr_offset + hdr.hdr as usize + i * hdr.len as usize) }?;
+ unsafe { transmute(fw, hdr_offset + hdr.header_size as usize + i * hdr.entry_size as usize) }?;
if app.id != NVFW_FALCON_APPIF_ID_DMEMMAPPER {
continue;
--
2.43.0
Powered by blists - more mailing lists