]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
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)
commit3cee1a10b8a65af38826e8a57caa6bf613706c48
tree007a0e581f873b9343684e173a507e0a709e812f
parent604d0efb17cc0dd197e089134736ac2698d5fca7
drm/nouveau/gsp: use fb.bios.addr for gspFwWprEnd instead of vga_workspace.addr

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