Re: [PATCH v12 03/22] gpu: nova-core: gsp: Expose total physical VRAM end from FB region info
From: Alexandre Courbot
Date: Sat May 02 2026 - 11:42:27 EST
On Sun Apr 26, 2026 at 6:14 AM JST, Joel Fernandes wrote:
> Add `total_fb_end()` to `GspStaticConfigInfo` that computes the
> exclusive end address of the highest valid FB region covering both
> usable and GSP-reserved areas.
>
> This allows callers to know the full physical VRAM extent, not just
> the allocatable portion.
>
> Signed-off-by: Joel Fernandes <joelagnelf@xxxxxxxxxx>
> ---
> drivers/gpu/nova-core/gpu.rs | 12 +++++++++++-
> drivers/gpu/nova-core/gsp/commands.rs | 5 +++++
> drivers/gpu/nova-core/gsp/fw/commands.rs | 7 +++++++
> 3 files changed, 23 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/nova-core/gpu.rs b/drivers/gpu/nova-core/gpu.rs
> index f2a8915a1ff4..675a0676f032 100644
> --- a/drivers/gpu/nova-core/gpu.rs
> +++ b/drivers/gpu/nova-core/gpu.rs
> @@ -273,7 +273,17 @@ pub(crate) fn new<'a>(
>
> gsp <- Gsp::new(pdev),
>
> - gsp_static_info: { gsp.boot(pdev, bar, spec.chipset, gsp_falcon, sec2_falcon)? },
> + gsp_static_info: {
> + let info = gsp.boot(pdev, bar, spec.chipset, gsp_falcon, sec2_falcon)?;
> +
> + dev_info!(
> + pdev.as_ref(),
> + "Total physical VRAM: {} MiB\n",
> + info.total_fb_end >> 20
`info.total_fb_end / u64::SZ_1M` (after importing `kernel::sizes::SizeConstants`) would carry the intent better.
> + );
> +
> + info
> + },
Let's use `inspect`:
gsp_static_info: gsp.boot(pdev, bar, spec.chipset, gsp_falcon, sec2_falcon)
.inspect(|info|
dev_info!(
pdev.as_ref(),
"Total physical VRAM: {} MiB\n",
info.total_fb_end / u64::SZ_1M
)
)?,
If we combine these 3 first patches with the series enabling calls from
nova-drm to nova-core, we should be able to implement a `TOTAL_VRAM`
argument to `GET_PARAM` that would be the first example of an actual
Nova ioctl using real information from the GSP (granted, with an
unstable interface). Looking forward to this.