From: "Alexandre Courbot" <acourbot@nvidia.com>
To: "Timur Tabi" <ttabi@nvidia.com>
Cc: "Danilo Krummrich" <dakr@kernel.org>,
"Joel Fernandes" <joelagnelf@nvidia.com>,
"Eliot Courtney" <ecourtney@nvidia.com>,
"John Hubbard" <jhubbard@nvidia.com>,
<rust-for-linux@vger.kernel.org>
Subject: Re: [PATCH 4/6] gpu: nova-core: add FbHal::frts_size() for GA100 support
Date: Tue, 14 Apr 2026 10:04:42 +0900 [thread overview]
Message-ID: <DHSH2KPBYD22.3AWUHG3TCVAVY@nvidia.com> (raw)
In-Reply-To: <20260410203722.1586938-5-ttabi@nvidia.com>
On Sat Apr 11, 2026 at 5:37 AM JST, Timur Tabi wrote:
> Introduce FbHal method frts_size() to return the size of the FRTS
> window. GA100 is a special case in that there is no FRTS, and so
> the size must be set to 0.
>
> Note that we cannot use supports_display() to determine the FRTS
> size because there are other GPUs (e.g. GA102GL) that have display
> disabled (and so supports_display() returns False), but the FRTS
> window size still needs to be 1MB.
Order-wise this should probably come before patch 3 - I was a bit
confused about the fact that we are checking the size of the frts region
since it is defined as a constant until this patch.
>
> Signed-off-by: Timur Tabi <ttabi@nvidia.com>
> ---
> drivers/gpu/nova-core/fb.rs | 6 +++---
> drivers/gpu/nova-core/fb/hal.rs | 3 +++
> drivers/gpu/nova-core/fb/hal/ga100.rs | 5 +++++
> drivers/gpu/nova-core/fb/hal/ga102.rs | 8 +++++++-
> drivers/gpu/nova-core/fb/hal/tu102.rs | 8 +++++++-
> 5 files changed, 25 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/nova-core/fb.rs b/drivers/gpu/nova-core/fb.rs
> index bdd5eed760e1..abffc21427a1 100644
> --- a/drivers/gpu/nova-core/fb.rs
> +++ b/drivers/gpu/nova-core/fb.rs
> @@ -216,10 +216,10 @@ pub(crate) fn new(chipset: Chipset, bar: &Bar0, gsp_fw: &GspFirmware) -> Result<
>
> let frts = {
> const FRTS_DOWN_ALIGN: Alignment = Alignment::new::<SZ_128K>();
> - const FRTS_SIZE: u64 = usize_as_u64(SZ_1M);
> - let frts_base = vga_workspace.start.align_down(FRTS_DOWN_ALIGN) - FRTS_SIZE;
> + let frts_size: u64 = hal.frts_size();
> + let frts_base = vga_workspace.start.align_down(FRTS_DOWN_ALIGN) - frts_size;
>
> - FbRange(frts_base..frts_base + FRTS_SIZE)
> + FbRange(frts_base..frts_base + frts_size)
> };
>
> let boot = {
> diff --git a/drivers/gpu/nova-core/fb/hal.rs b/drivers/gpu/nova-core/fb/hal.rs
> index aba0abd8ee00..1c01a6cbed65 100644
> --- a/drivers/gpu/nova-core/fb/hal.rs
> +++ b/drivers/gpu/nova-core/fb/hal.rs
> @@ -25,6 +25,9 @@ pub(crate) trait FbHal {
>
> /// Returns the VRAM size, in bytes.
> fn vidmem_size(&self, bar: &Bar0) -> u64;
> +
> + /// Returns the FRTS size, in bytes.
> + fn frts_size(&self) -> u64;
> }
>
> /// Returns the HAL corresponding to `chipset`.
> diff --git a/drivers/gpu/nova-core/fb/hal/ga100.rs b/drivers/gpu/nova-core/fb/hal/ga100.rs
> index 1c03783cddef..0e7d91fbd130 100644
> --- a/drivers/gpu/nova-core/fb/hal/ga100.rs
> +++ b/drivers/gpu/nova-core/fb/hal/ga100.rs
> @@ -66,6 +66,11 @@ fn supports_display(&self, bar: &Bar0) -> bool {
> fn vidmem_size(&self, bar: &Bar0) -> u64 {
> super::tu102::vidmem_size_gp102(bar)
> }
> +
> + // GA100 is a special case where it has no FRTS.
> + fn frts_size(&self) -> u64 {
> + 0
> + }
> }
>
> const GA100: Ga100 = Ga100;
> diff --git a/drivers/gpu/nova-core/fb/hal/ga102.rs b/drivers/gpu/nova-core/fb/hal/ga102.rs
> index 4b9f0f74d0e7..167d38e34370 100644
> --- a/drivers/gpu/nova-core/fb/hal/ga102.rs
> +++ b/drivers/gpu/nova-core/fb/hal/ga102.rs
> @@ -2,12 +2,14 @@
>
> use kernel::{
> io::Io,
> - prelude::*, //
> + prelude::*,
> + sizes::*, //
> };
>
> use crate::{
> driver::Bar0,
> fb::hal::FbHal,
> + num::*,
> regs, //
> };
>
> @@ -35,6 +37,10 @@ fn supports_display(&self, bar: &Bar0) -> bool {
> fn vidmem_size(&self, bar: &Bar0) -> u64 {
> vidmem_size_ga102(bar)
> }
> +
> + fn frts_size(&self) -> u64 {
> + usize_as_u64(SZ_1M)
> + }
This implementation is identical to the one in `tu102.rs`. As a pattern,
when different HALs use different implementations, we define it into a
function that both HALs can call instead of repeating the code (see for
instance how `read_sysmem_flush_page` is handled between ga100 and
ga102).
next prev parent reply other threads:[~2026-04-14 1:04 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-10 20:37 [PATCH 0/6] gpu: nova-core: add GA100 support Timur Tabi
2026-04-10 20:37 ` [PATCH 1/6] gpu: nova-core: use correct fwsignature for GA100 Timur Tabi
2026-04-13 4:10 ` Eliot Courtney
2026-04-10 20:37 ` [PATCH 2/6] gpu: nova-core: do not consider 0xBB77 as a valid PCI ROM header signature Timur Tabi
2026-04-13 4:11 ` Eliot Courtney
2026-04-10 20:37 ` [PATCH 3/6] gpu: nova-core: only boot FRTS if it actually exists Timur Tabi
2026-04-13 4:19 ` Eliot Courtney
2026-04-13 19:49 ` Timur Tabi
2026-04-13 23:48 ` Timur Tabi
2026-04-14 18:10 ` Timur Tabi
2026-04-15 2:35 ` Eliot Courtney
2026-04-10 20:37 ` [PATCH 4/6] gpu: nova-core: add FbHal::frts_size() for GA100 support Timur Tabi
2026-04-14 1:04 ` Alexandre Courbot [this message]
2026-04-14 3:13 ` Timur Tabi
2026-04-14 6:03 ` Alexandre Courbot
2026-04-10 20:37 ` [PATCH 5/6] gpu: nova-core: skip the IFR header if present Timur Tabi
2026-04-13 4:53 ` Eliot Courtney
2026-04-14 20:42 ` Timur Tabi
2026-04-10 20:37 ` [PATCH 6/6] gpu: nova-core: enable GA100 Timur Tabi
2026-04-13 4:20 ` Eliot Courtney
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=DHSH2KPBYD22.3AWUHG3TCVAVY@nvidia.com \
--to=acourbot@nvidia.com \
--cc=dakr@kernel.org \
--cc=ecourtney@nvidia.com \
--cc=jhubbard@nvidia.com \
--cc=joelagnelf@nvidia.com \
--cc=rust-for-linux@vger.kernel.org \
--cc=ttabi@nvidia.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.