Re: [PATCH v3 13/16] gpu: nova-core: convert hshub0 from relative register to projection

From: Alexandre Courbot

Date: Thu Aug 27 2026 - 21:29:38 EST


On Wed Aug 19, 2026 at 8:09 PM JST, Gary Guo wrote:
> Similar to the PFALCON and PFALCON2 conversion, the hshub0 relative access
> can also be achieved cleanly with projection and a new base.
>
> Signed-off-by: Gary Guo <gary@xxxxxxxxxxx>

Reviewed-by: Alexandre Courbot <acourbot@xxxxxxxxxx>

<...>
> diff --git a/drivers/gpu/nova-core/fb/regs.rs b/drivers/gpu/nova-core/fb/regs.rs
> index c27582e376e2..584488a3e012 100644
> --- a/drivers/gpu/nova-core/fb/regs.rs
> +++ b/drivers/gpu/nova-core/fb/regs.rs
> @@ -2,7 +2,8 @@
>
> use kernel::{
> io::register,
> - sizes::SizeConstants, //
> + prelude::*,
> + sizes::{SizeConstants, SZ_4K}, //
> };
>
> use crate::driver::NovaRegisters;
> @@ -65,31 +66,33 @@ pub(super) fn vga_workspace_addr(self) -> Option<u64> {
> }
> }
>
> -/// Base of the GB10x HSHUB0 register window (`NV_HSHUB0_PRIV_BASE` in Open RM).
> +/// The GB10x HSHUB0 register window (Base defined as `NV_HSHUB0_PRIV_BASE` in Open RM).
> ///
> /// The base is provided by the GB10x framebuffer HAL.
> -pub(super) struct Hshub0Base(());
> +#[repr(align(4))]
> +#[derive(FromBytes, IntoBytes)]
> +pub(super) struct Hshub0Registers([u8; SZ_4K]);

A named constant for the size would be nice here as well.