Re: [PATCH v3 3/3] gpu: nova-core: gsp: Extract and display usable FB regions from GSP

From: Alexandre Courbot

Date: Sat Jun 20 2026 - 10:06:42 EST


On Sat Jun 20, 2026 at 8:30 PM JST, Danilo Krummrich wrote:
> On Wed Jun 17, 2026 at 3:24 PM CEST, Alexandre Courbot wrote:
>> @@ -377,6 +378,21 @@ pub(crate) fn new(
>> Err(e) => dev_warn!(pdev, "GPU name unavailable: {:?}\n", e),
>> }
>>
>> + if !info.usable_fb_regions.is_empty() {
>> + dev_info!(pdev, "Usable FB regions:\n");
>> + for region in &info.usable_fb_regions {
>> + dev_info!(pdev, " - {:#x?}\n", region);
>> + }
>> +
>> + dev_info!(
>> + pdev,
>> + "Total usable VRAM: {} MiB\n",
>> + info.usable_fb_regions.iter().fold(0u64, |res, region| res
>> + .saturating_add(region.end - region.start))
>> + / u64::SZ_1M
>> + );
>> + }
>
> Drivers should generally remain silent when they work properly, some exceptions
> are fine, but this seems too verbose. Let's use dev_dbg!() instead.

Right, it seemed useful for the time being to display some information
since that's all the driver is currently able to do, but I'll change it
to `dev_dbg!`.

>
> Also, would it make sense to (rather) warn in the else case? (I think OpenRM
> treats this as error, although the check in OpenRM checks whether there are no
> regions at all.)

I expect that the users of the VRAM regions (i.e. the MM subsystem) will
not be able to contruct properly if no region is detected, and that sounds
like the right place to raise an error rather than making an assumption
here that no VRAM region is an error. For instance, I am not sure what
the regions layout will be on Tegra systems, although your comment about
OpenRM seems to hint that there are regions defined for them as well.