]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/nouveau/gsp: use fb.bios.addr for gspFwWprEnd instead of vga_workspace.addr
authorTimur Tabi <ttabi@nvidia.com>
Thu, 30 Apr 2026 22:38:31 +0000 (17:38 -0500)
committerDanilo Krummrich <dakr@kernel.org>
Thu, 28 May 2026 17:30:15 +0000 (19:30 +0200)
In OpenRM's kgspCalculateFbLayout_TU102(), gspFwWprEnd is derived from
vbiosReservedOffset, which is computed as:

    vbiosReservedOffset = min(mmuLockLo, vgaWorkspaceOffset)

The VGA workspace offset is one input into this calculation, not the
direct source of gspFwWprEnd.  vbiosReservedOffset is the effective
top boundary for WPR2 placement, and it may be lower than the VGA
workspace when VBIOS has locked a region via MMU_LOCK.

In Nouveau, gsp->fb.bios.addr is the equivalent of vbiosReservedOffset,
while gsp->fb.bios.vga_workspace.addr corresponds to the raw VGA
workspace location.  The original code assigned vga_workspace.addr to
gspFwWprEnd, which produced the correct result only because bios.addr
was always set equal to vga_workspace.addr and never adjusted.

Use gsp->fb.bios.addr for gspFwWprEnd to correctly mirror OpenRM's
layout logic, so that future adjustments to bios.addr (such as clamping
it to an MMU_LOCK boundary) are properly reflected in the WPR metadata
passed to the booter.

Signed-off-by: Timur Tabi <ttabi@nvidia.com>
Link: https://patch.msgid.link/20260430223838.2530778-4-ttabi@nvidia.com
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
drivers/gpu/drm/nouveau/nvkm/subdev/gsp/tu102.c

index 19cb269e7a2659c77c6384b4583af966f6c99f90..aa3ac34989b78c3ce8e04041e987d72663d949d9 100644 (file)
@@ -246,7 +246,7 @@ tu102_gsp_wpr_meta_init(struct nvkm_gsp *gsp)
        meta->bootBinOffset = gsp->fb.wpr2.boot.addr;
        meta->frtsOffset = gsp->fb.wpr2.frts.addr;
        meta->frtsSize = gsp->fb.wpr2.frts.size;
-       meta->gspFwWprEnd = ALIGN_DOWN(gsp->fb.bios.vga_workspace.addr, 0x20000);
+       meta->gspFwWprEnd = ALIGN_DOWN(gsp->fb.bios.addr, 0x20000);
        meta->fbSize = gsp->fb.size;
        meta->vgaWorkspaceOffset = gsp->fb.bios.vga_workspace.addr;
        meta->vgaWorkspaceSize = gsp->fb.bios.vga_workspace.size;