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 <ttabi@nvidia.com>
Link: https://patch.msgid.link/20260428202825.1123719-1-ttabi@nvidia.com
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
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;