[PATCH v6 13/13] drm: nova: Report GPU GID in GPU info

From: Alistair Popple

Date: Wed Sep 09 2026 - 02:55:39 EST


Add the GPU GID to the reported GPU info. This is the 16-byte SHA-1
based identifier GSP-RM reports for the GPU.

Signed-off-by: Alistair Popple <apopple@xxxxxxxxxx>

---

Changes since v5:

- Read the GID from the GSP static info exposed by nova-core rather
than adding a forwarding method

Changes since v4:

- New for v5
---
drivers/gpu/drm/nova/file.rs | 1 +
drivers/gpu/nova-core/gsp/commands.rs | 3 +++
drivers/gpu/nova-core/gsp/fw/commands.rs | 10 ++++++++++
include/uapi/drm/nova_drm.h | 5 +++++
4 files changed, 19 insertions(+)

diff --git a/drivers/gpu/drm/nova/file.rs b/drivers/gpu/drm/nova/file.rs
index d2e1f9f798a4..7f7f0a0ba622 100644
--- a/drivers/gpu/drm/nova/file.rs
+++ b/drivers/gpu/drm/nova/file.rs
@@ -56,6 +56,7 @@ fn new(reg_data: &DrmRegData<'_>) -> Result<Self> {
architecture: spec.chipset.arch() as u32,
chipid: spec.chipset as u32,
vram_size: gsp_static_info.vram_size(),
+ gpu_gid: gsp_static_info.gpu_gid,
..Default::default()
};

diff --git a/drivers/gpu/nova-core/gsp/commands.rs b/drivers/gpu/nova-core/gsp/commands.rs
index 5ea0f625f7df..40cef8332eae 100644
--- a/drivers/gpu/nova-core/gsp/commands.rs
+++ b/drivers/gpu/nova-core/gsp/commands.rs
@@ -215,6 +215,8 @@ fn init(&self) -> impl Init<Self::Command, Self::InitError> {
pub struct GetGspStaticInfoReply {
gpu_name: [u8; 64],
gpu_short_name: [u8; 64],
+ /// The 16-byte SHA-1 based GPU identifier (GID) reported by GSP-RM.
+ pub gpu_gid: [u8; 16],
/// Usable FB (VRAM) regions for driver memory allocation.
pub(crate) usable_fb_regions: KVec<Range<u64>>,
}
@@ -236,6 +238,7 @@ fn read(
Ok(GetGspStaticInfoReply {
gpu_name: msg.gpu_name_str(),
gpu_short_name: msg.gpu_short_name_str(),
+ gpu_gid: msg.gpu_gid(),
usable_fb_regions,
})
}
diff --git a/drivers/gpu/nova-core/gsp/fw/commands.rs b/drivers/gpu/nova-core/gsp/fw/commands.rs
index f62fb85f4473..d1ce2f1aeda9 100644
--- a/drivers/gpu/nova-core/gsp/fw/commands.rs
+++ b/drivers/gpu/nova-core/gsp/fw/commands.rs
@@ -136,6 +136,16 @@ impl GspStaticConfigInfo {
self.0.gpuShortNameString
}

+ /// Returns the 16-byte SHA-1 GPU identifier supplied by GSP-RM.
+ ///
+ /// GSP-RM reports the GID in binary SHA-1 form, which occupies the first 16 bytes of the
+ /// GID info payload.
+ pub(crate) fn gpu_gid(&self) -> [u8; 16] {
+ let mut gid = [0u8; 16];
+ gid.copy_from_slice(&self.0.gidInfo.data[..16]);
+ gid
+ }
+
/// Returns an iterator over valid FB regions from GSP firmware data.
fn fb_regions(
&self,
diff --git a/include/uapi/drm/nova_drm.h b/include/uapi/drm/nova_drm.h
index b0af9945b6c5..9283660a04cb 100644
--- a/include/uapi/drm/nova_drm.h
+++ b/include/uapi/drm/nova_drm.h
@@ -196,6 +196,11 @@ struct drm_nova_info_gpu {
* @gpu_short_name: NUL-terminated short GPU name.
*/
__u8 gpu_short_name[64];
+
+ /**
+ * @gpu_gid: 16-byte SHA-1 GPU identifier supplied by GSP-RM.
+ */
+ __u8 gpu_gid[16];
};

#define DRM_NOVA_GETPARAM 0x00
--
2.54.0