All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/nouveau: expose VBIOS via debugfs on GSP-RM systems
@ 2026-04-07 18:53 Timur Tabi
  2026-04-28 15:53 ` Danilo Krummrich
  0 siblings, 1 reply; 3+ messages in thread
From: Timur Tabi @ 2026-04-07 18:53 UTC (permalink / raw)
  To: Dave Airlie, Lyude Paul, nouveau

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>
---
 drivers/gpu/drm/nouveau/nouveau_bios.c | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/nouveau/nouveau_bios.c b/drivers/gpu/drm/nouveau/nouveau_bios.c
index c8335f5b49db..28bcf38cdddf 100644
--- a/drivers/gpu/drm/nouveau/nouveau_bios.c
+++ b/drivers/gpu/drm/nouveau/nouveau_bios.c
@@ -2085,10 +2085,24 @@ 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);
+
+		/*
+		 * 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.
+		 */
+		bios->data = nvkm_bios->data;
+		bios->length = nvkm_bios->size;
+
+		return 0;
+	}
+
 	if (!NVInitVBIOS(dev))
 		return -ENODEV;
 
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-04-28 20:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-07 18:53 [PATCH] drm/nouveau: expose VBIOS via debugfs on GSP-RM systems Timur Tabi
2026-04-28 15:53 ` Danilo Krummrich
2026-04-28 20:23   ` Timur Tabi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.