mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alistair Popple <apopple@nvidia.com>
To: Danilo Krummrich <dakr@kernel.org>,
	 Alexandre Courbot <acourbot@nvidia.com>,
	David Airlie <airlied@gmail.com>
Cc: John Hubbard <jhubbard@nvidia.com>,
	nova-gpu@lists.linux.dev,  dri-devel@lists.freedesktop.org,
	linux-kernel@vger.kernel.org,  rust-for-linux@vger.kernel.org,
	Alistair Popple <apopple@nvidia.com>
Subject: [PATCH 2/2] drm: nova: Report compute properties in GPU info
Date: Fri, 04 Dec 2026 15:06:14 +1100	[thread overview]
Message-ID: <20261204-nova_gpu_static_info_v2-v1-2-162bc6bf0a4a@nvidia.com> (raw)
In-Reply-To: <20261204-nova_gpu_static_info_v2-v1-0-162bc6bf0a4a@nvidia.com>

DRM_NOVA_INFO_GPU reports static properties of the GPU such as its
architecture, names and VRAM size.

nova-core now also provides the number of streaming multiprocessors
(SMs), the VRAM bus width, the L2 cache size and the maximum graphics
and memory clock frequencies in GspStaticInfo. Add them to struct
drm_nova_info_gpu. On older GSP firmware versions that don't report
these fields initialise them to zero.

Signed-off-by: Alistair Popple <apopple@nvidia.com>
---
 drivers/gpu/drm/nova/file.rs             |  6 ++++++
 drivers/gpu/drm/nova/nova_drm_unstable.h | 27 +++++++++++++++++++++++++++
 2 files changed, 33 insertions(+)

diff --git a/drivers/gpu/drm/nova/file.rs b/drivers/gpu/drm/nova/file.rs
index 8b800f821e2c..e4e6acd39d1c 100644
--- a/drivers/gpu/drm/nova/file.rs
+++ b/drivers/gpu/drm/nova/file.rs
@@ -61,6 +61,12 @@ fn new(reg_data: &DrmRegData<'_>) -> Result<Self> {
             vram_size: gsp_static_info.vram_size(),
             vram_bar_size: reg_data.api.with(|api| api.bar1_size())?,
             gpu_gid: gsp_static_info.gpu_gid,
+            // The uAPI reports a value which the GSP does not provide as zero.
+            sm_count: gsp_static_info.sm_count.unwrap_or(0),
+            vram_bus_width: gsp_static_info.fb_bus_width.unwrap_or(0),
+            l2_cache_size: gsp_static_info.l2_cache_size.unwrap_or(0).into(),
+            max_graphics_clock: gsp_static_info.max_gpc_clk_hz.unwrap_or(0),
+            max_memory_clock: gsp_static_info.max_mem_clk_hz.unwrap_or(0),
             ..pin_init::zeroed()
         };
 
diff --git a/drivers/gpu/drm/nova/nova_drm_unstable.h b/drivers/gpu/drm/nova/nova_drm_unstable.h
index 3577dede15a6..23273ee596e0 100644
--- a/drivers/gpu/drm/nova/nova_drm_unstable.h
+++ b/drivers/gpu/drm/nova/nova_drm_unstable.h
@@ -189,6 +189,33 @@ struct drm_nova_info_gpu {
 	 * @gpu_gid: 16-byte SHA-1 GPU identifier supplied by GSP-RM.
 	 */
 	__u8 gpu_gid[16];
+
+	/**
+	 * @sm_count: Number of streaming multiprocessors (SMs), or 0 if unknown.
+	 */
+	__u32 sm_count;
+
+	/**
+	 * @vram_bus_width: Width of the VRAM memory bus in bits, or 0 if unknown.
+	 */
+	__u32 vram_bus_width;
+
+	/**
+	 * @l2_cache_size: Size of the GPU L2 cache in bytes, or 0 if unknown.
+	 */
+	__u64 l2_cache_size;
+
+	/**
+	 * @max_graphics_clock: Maximum frequency of the graphics clock in Hz, or
+	 * 0 if unknown.
+	 */
+	__u64 max_graphics_clock;
+
+	/**
+	 * @max_memory_clock: Maximum frequency of the memory clock in Hz, or 0 if
+	 * unknown.
+	 */
+	__u64 max_memory_clock;
 };
 
 #define DRM_NOVA_INFO			0x00

-- 
2.54.0


      parent reply	other threads:[~2026-12-04  4:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-04  4:06 [PATCH 0/2] gpu: nova: Report compute properties of the GPU to userspace Alistair Popple
2026-12-04  4:06 ` [PATCH 1/2] gpu: nova-core: gsp: Add compute properties to GspStaticInfo Alistair Popple
2026-12-04  4:06 ` Alistair Popple [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261204-nova_gpu_static_info_v2-v1-2-162bc6bf0a4a@nvidia.com \
    --to=apopple@nvidia.com \
    --cc=acourbot@nvidia.com \
    --cc=airlied@gmail.com \
    --cc=dakr@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jhubbard@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nova-gpu@lists.linux.dev \
    --cc=rust-for-linux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®