Skip to contentSkip to conversation

drm/amdgpu: Print full vbios info

PATCH In review Lijo Lazar 2 participants 2 messages Feb 18

Subsystems (2)
lore
Share & tools
lore

Lijo Lazar

author
#0 lore raw

PATCH 1/1 drm/amdgpu: Print full vbios info

Add build number, version and date to the existing part number print.

Example:

[drm] ATOM BIOS: 113-PN000108-103, build: 00159017, ver: 022.040.003.043.000001, 2025/07/27

---
 drivers/gpu/drm/amd/amdgpu/atom.c | 28 ++++++++++++++++++++++++++--
 1 file changed, 26 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/atom.c +26 -2
index 371ee82a8912..cc5b6ea7f6d8 100644
@@ -1462,8 +1462,6 @@ static void atom_get_vbios_pn(struct atom_context *ctx)
 
 		ctx->vbios_pn[count] = 0;
 	}
-
-	drm_info(ctx->card->dev, "ATOM BIOS: %s\n", ctx->vbios_pn);
 }
 
 static void atom_get_vbios_version(struct atom_context *ctx)
@@ -1520,6 +1518,30 @@ static void atom_get_vbios_build(struct atom_context *ctx)
 		strscpy(ctx->build_num, str, len);
 }
 
+static inline void atom_print_vbios_info(struct atom_context *ctx)
+{
+	char vbios_info[256];
+	int off = 0;
+
+	if (ctx->vbios_pn[0])
+		off += scnprintf(vbios_info + off, sizeof(vbios_info) - off,
+				 "%s", ctx->vbios_pn);
+	if (ctx->build_num[0])
+		off += scnprintf(vbios_info + off, sizeof(vbios_info) - off,
+				 "%sbuild: %s", off ? ", " : "",
+				 ctx->build_num);
+	if (ctx->vbios_ver_str[0])
+		off += scnprintf(vbios_info + off, sizeof(vbios_info) - off,
+				 "%sver: %s", off ? ", " : "",
+				 ctx->vbios_ver_str);
+	if (ctx->date[0])
+		off += scnprintf(vbios_info + off, sizeof(vbios_info) - off,
+				 "%s%.10s", off ? ", " : "",
+				 ctx->date);
+	if (off)
+		drm_info(ctx->card->dev, "ATOM BIOS: %s\n", vbios_info);
+}
+
 struct atom_context *amdgpu_atom_parse(struct card_info *card, void *bios)
 {
 	int base;
@@ -1582,6 +1604,8 @@ struct atom_context *amdgpu_atom_parse(struct card_info *card, void *bios)
 	atom_get_vbios_version(ctx);
 	atom_get_vbios_build(ctx);
 
+	atom_print_vbios_info(ctx);
+
 	return ctx;
 }
 
Signature · 1 line
2.49.0
Acked-by on v1 1/1
#1 lore raw
Quoted 8 lines · Lijo Lazar

Add build number, version and date to the existing part number print.

Example:

[drm] ATOM BIOS: 113-PN000108-103, build: 00159017, ver: 022.040.003.043.000001, 2025/07/27

Quoted 60 lines
---
 drivers/gpu/drm/amd/amdgpu/atom.c | 28 ++++++++++++++++++++++++++--
 1 file changed, 26 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/atom.c +26 -3
index 371ee82a8912..cc5b6ea7f6d8 100644
@@ -1462,8 +1462,6 @@ static void atom_get_vbios_pn(struct atom_context *ctx)
 
                ctx->vbios_pn[count] = 0;
        }
-
-       drm_info(ctx->card->dev, "ATOM BIOS: %s\n", ctx->vbios_pn);
 }
 
 static void atom_get_vbios_version(struct atom_context *ctx)
@@ -1520,6 +1518,30 @@ static void atom_get_vbios_build(struct atom_context *ctx)
                strscpy(ctx->build_num, str, len);
 }
 
+static inline void atom_print_vbios_info(struct atom_context *ctx)
+{
+       char vbios_info[256];
+       int off = 0;
+
+       if (ctx->vbios_pn[0])
+               off += scnprintf(vbios_info + off, sizeof(vbios_info) - off,
+                                "%s", ctx->vbios_pn);
+       if (ctx->build_num[0])
+               off += scnprintf(vbios_info + off, sizeof(vbios_info) - off,
+                                "%sbuild: %s", off ? ", " : "",
+                                ctx->build_num);
+       if (ctx->vbios_ver_str[0])
+               off += scnprintf(vbios_info + off, sizeof(vbios_info) - off,
+                                "%sver: %s", off ? ", " : "",
+                                ctx->vbios_ver_str);
+       if (ctx->date[0])
+               off += scnprintf(vbios_info + off, sizeof(vbios_info) - off,
+                                "%s%.10s", off ? ", " : "",
+                                ctx->date);
+       if (off)
+               drm_info(ctx->card->dev, "ATOM BIOS: %s\n", vbios_info);
+}
+
 struct atom_context *amdgpu_atom_parse(struct card_info *card, void *bios)
 {
        int base;
@@ -1582,6 +1604,8 @@ struct atom_context *amdgpu_atom_parse(struct card_info *card, void *bios)
        atom_get_vbios_version(ctx);
        atom_get_vbios_build(ctx);
 
+       atom_print_vbios_info(ctx);
+
        return ctx;
 }
 
--

2.49.0