drm/nouveau: expose VBIOS via debugfs on GSP-RM systems
Subsystems (3)
PATCH v2 1/1 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.
--- drivers/gpu/drm/nouveau/nouveau_bios.c | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-)
drivers/gpu/drm/nouveau/nouveau_bios.c +19 -2
@@ -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 ;
Signature · 1 line
2.54.0
Quoted 1 line · Timur Tabi
[PATCH v2] drm/nouveau: expose VBIOS via debugfs on GSP-RM systems
Applied, thanks!
Branch: drm-misc-next
Tree: https://gitlab.freedesktop.org/drm/misc/kernel.git
[1/1] drm/nouveau: expose VBIOS via debugfs on GSP-RM systems
commit: a5640267d6d3
The patch will appear in the next linux-next integration (typically within 24 hours on weekdays).
The patch is queued up for the upcoming merge window for the next major kernel release.