diff options
| -rw-r--r-- | drivers/gpu/drm/nova/file.rs | 1 | ||||
| -rw-r--r-- | drivers/gpu/nova-core/gsp/commands.rs | 3 | ||||
| -rw-r--r-- | drivers/gpu/nova-core/gsp/fw/commands.rs | 10 | ||||
| -rw-r--r-- | include/uapi/drm/nova_drm.h | 5 |
4 files changed, 19 insertions, 0 deletions
diff --git a/drivers/gpu/drm/nova/file.rs b/drivers/gpu/drm/nova/file.rs index 134f011d16c6..766a6ddb7e10 100644 --- a/drivers/gpu/drm/nova/file.rs +++ b/drivers/gpu/drm/nova/file.rs @@ -60,6 +60,7 @@ impl GpuInfo { architecture: spec.chipset.arch().into(), chipid: spec.chipset.into(), vram_size: gsp_static_info.vram_size(), + gpu_gid: gsp_static_info.gpu_gid, ..pin_init::zeroed() }; diff --git a/drivers/gpu/nova-core/gsp/commands.rs b/drivers/gpu/nova-core/gsp/commands.rs index e865b92047fa..59d7d7fb15e8 100644 --- a/drivers/gpu/nova-core/gsp/commands.rs +++ b/drivers/gpu/nova-core/gsp/commands.rs @@ -215,6 +215,8 @@ impl CommandToGsp for GetGspStaticInfo { 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], /// BAR1 Page Directory Entry base address. pub(crate) bar1_pde_base: u64, /// Usable FB (VRAM) regions for driver memory allocation. @@ -241,6 +243,7 @@ impl MessageFromGsp for GetGspStaticInfoReply { Ok(GetGspStaticInfoReply { gpu_name: msg.gpu_name_str(), gpu_short_name: msg.gpu_short_name_str(), + gpu_gid: msg.gpu_gid(), bar1_pde_base: msg.bar1_pde_base(), usable_fb_regions, total_fb_end, diff --git a/drivers/gpu/nova-core/gsp/fw/commands.rs b/drivers/gpu/nova-core/gsp/fw/commands.rs index 5891922ff678..567c56fbbfe3 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 the BAR1 Page Directory Entry base address. /// /// This is the root page table address for BAR1 virtual memory, diff --git a/include/uapi/drm/nova_drm.h b/include/uapi/drm/nova_drm.h index 0e6a44c2ea5a..a74daba6ea94 100644 --- a/include/uapi/drm/nova_drm.h +++ b/include/uapi/drm/nova_drm.h @@ -198,6 +198,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 |
