From: Timur Tabi Date: Tue, 28 Apr 2026 20:28:25 +0000 (-0500) Subject: drm/nouveau: expose VBIOS via debugfs on GSP-RM systems X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a5640267d6d35b89ebe6418da90a952a247215a5;p=thirdparty%2Fkernel%2Flinux.git drm/nouveau: expose VBIOS via debugfs on GSP-RM systems When Nouveau boots with GSP-RM, it bypasses several traditional code paths to allow GSP-RM to handle those features. In particular, some VBIOS parsing is skipped, and a side effect is that the VBIOS is not exposed in the DRM debugfs entries. Fix this by updating the drm BIOS struct (nvbios) with the VBIOS data from the nvkm BIOS struct (nvkm_bios). This happens normally in NVInitVBIOS(), but that function is skipped when booting with GSP-RM. Signed-off-by: Timur Tabi Link: https://patch.msgid.link/20260428202825.1123719-1-ttabi@nvidia.com Signed-off-by: Danilo Krummrich --- diff --git a/drivers/gpu/drm/nouveau/nouveau_bios.c b/drivers/gpu/drm/nouveau/nouveau_bios.c index c8335f5b49dbf..38032bb958262 100644 --- a/drivers/gpu/drm/nouveau/nouveau_bios.c +++ b/drivers/gpu/drm/nouveau/nouveau_bios.c @@ -2085,10 +2085,27 @@ nouveau_bios_init(struct drm_device *dev) int ret; /* only relevant for PCI devices */ - if (!dev_is_pci(dev->dev) || - nvkm_gsp_rm(nvxx_device(drm)->gsp)) + if (!dev_is_pci(dev->dev)) return 0; + if (nvkm_gsp_rm(nvxx_device(drm)->gsp)) { + struct nvkm_bios *nvkm_bios = nvxx_bios(drm); + + /* + * If this GPU has an nvkm_device_chip.bios entry, then the VBIOS + * data was already read by the nvkm layer during nvkm_bios_new(). + * Point the legacy DRM-level VBIOS structure at the same buffer + * so that any remaining legacy code can access it. This exposes + * the VBIOS via the DRM debugfs entries. + */ + if (nvkm_bios) { + bios->data = nvkm_bios->data; + bios->length = nvkm_bios->size; + } + + return 0; + } + if (!NVInitVBIOS(dev)) return -ENODEV;