Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH i-g-t v2 0/8] Vswing / Pre-emphasis Override decoding
@ 2026-06-08 12:41 Michał Grzelak
  2026-06-08 12:41 ` [PATCH i-g-t v2 1/8] tools/vbt_decode: fix tables' offset reading Michał Grzelak
                   ` (10 more replies)
  0 siblings, 11 replies; 17+ messages in thread
From: Michał Grzelak @ 2026-06-08 12:41 UTC (permalink / raw)
  To: igt-dev; +Cc: jani.nikula, suraj.kandpal, Michał Grzelak

Next version of [1]. Kernel v6 is at [2].

BR,
Michał

[1] https://lore.kernel.org/igt-dev/20260507012821.527453-1-michal.grzelak@intel.com
[2] https://lore.kernel.org/intel-gfx/20260603230544.1993439-1-michal.grzelak@intel.com/

---
Changelog:
v1->v2
- check platform basing on devid not VBT signature (Jani)


Michał Grzelak (8):
  tools/vbt_decode: fix tables' offset reading
  tools/vbt_decode: rename VBT#57 related vars
  tools/vbt_decode: return 0 from get_device_id()
  tools/vbt_decode: validate DEVICE env var
  tools/vbt_decode: guess devid from VBT signature
  tools/vbt_decode: parse & dump VS/PE-O tables for LT
  tools/vbt_decode: parse & dump VS/PE-O tables for Snps
  tools/vbt_decode: parse & dump VS/PE-O tables for Combo

 lib/intel_chipset.h      |   2 +
 tools/intel_vbt_decode.c | 202 +++++++++++++++++++++++++++++++++++----
 2 files changed, 186 insertions(+), 18 deletions(-)

-- 
2.45.2


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

* [PATCH i-g-t v2 1/8] tools/vbt_decode: fix tables' offset reading
  2026-06-08 12:41 [PATCH i-g-t v2 0/8] Vswing / Pre-emphasis Override decoding Michał Grzelak
@ 2026-06-08 12:41 ` Michał Grzelak
  2026-06-08 12:41 ` [PATCH i-g-t v2 2/8] tools/vbt_decode: rename VBT#57 related vars Michał Grzelak
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 17+ messages in thread
From: Michał Grzelak @ 2026-06-08 12:41 UTC (permalink / raw)
  To: igt-dev; +Cc: jani.nikula, suraj.kandpal, Michał Grzelak

During dumping of VBT #57, all rows are same because parser does not
change offset read. Adjust the offset to change basing on the row used.

Signed-off-by: Michał Grzelak <michal.grzelak@intel.com>
---
 tools/intel_vbt_decode.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/intel_vbt_decode.c b/tools/intel_vbt_decode.c
index cf7bcc5771..1d6bbc88a4 100644
--- a/tools/intel_vbt_decode.c
+++ b/tools/intel_vbt_decode.c
@@ -3478,7 +3478,7 @@ static void dump_vswing_preemphasis(struct context *context,
 			printf("\t\t%s: ", vswing_preemph[i]);
 
 			for (int j = 0; j < vs->num_columns; j++)
-				printf(" 0x%08x", vs->tables[n * 10 * vs->num_columns + j]);
+				printf(" 0x%08x", vs->tables[n * 10 * vs->num_columns + i * j]);
 			printf("\n");
 		}
 	}
-- 
2.45.2


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

* [PATCH i-g-t v2 2/8] tools/vbt_decode: rename VBT#57 related vars
  2026-06-08 12:41 [PATCH i-g-t v2 0/8] Vswing / Pre-emphasis Override decoding Michał Grzelak
  2026-06-08 12:41 ` [PATCH i-g-t v2 1/8] tools/vbt_decode: fix tables' offset reading Michał Grzelak
@ 2026-06-08 12:41 ` Michał Grzelak
  2026-06-08 12:41 ` [PATCH i-g-t v2 3/8] tools/vbt_decode: return 0 from get_device_id() Michał Grzelak
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 17+ messages in thread
From: Michał Grzelak @ 2026-06-08 12:41 UTC (permalink / raw)
  To: igt-dev; +Cc: jani.nikula, suraj.kandpal, Michał Grzelak

Rename loop iterators n, i, j into idx, row and col. Rename
vswing_preemph[] into vspeo_dp14_levels[] since vswing_preemph is an
already overloaded name. Rename vs into vspeo, which stands for VS/PE-O,
which in turn expands to VSwing / Pre-Emphasis Override.

Signed-off-by: Michał Grzelak <michal.grzelak@intel.com>
---
 tools/intel_vbt_decode.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/tools/intel_vbt_decode.c b/tools/intel_vbt_decode.c
index 1d6bbc88a4..5b7a6a49e9 100644
--- a/tools/intel_vbt_decode.c
+++ b/tools/intel_vbt_decode.c
@@ -3450,7 +3450,7 @@ static void dump_compression_parameters(struct context *context,
 	}
 }
 
-static const char * const vswing_preemph[10] = {
+static const char * const vspeo_dp14_levels[10] = {
 	"V0-P0",
 	"V0-P1",
 	"V0-P2",
@@ -3466,19 +3466,19 @@ static const char * const vswing_preemph[10] = {
 static void dump_vswing_preemphasis(struct context *context,
 				    const struct bdb_block *block)
 {
-	const struct bdb_vswing_preemph *vs = block_data(block);
+	const struct bdb_vswing_preemph *vspeo = block_data(block);
 
-	printf("\tNumber of vswing tables: %d\n", vs->num_tables);
-	printf("\tNumber of columns: %d\n", vs->num_columns);
+	printf("\tNumber of vswing tables: %d\n", vspeo->num_tables);
+	printf("\tNumber of columns: %d\n", vspeo->num_columns);
 
-	for (int n = 0; n < vs->num_tables; n++) {
-		printf("\tVswing Table #%d:\n", n+1);
+	for (int idx = 0; idx < vspeo->num_tables; idx++) {
+		printf("\tVswing Table #%d:\n", idx+1);
 
-		for (int i = 0; i < 10; i++) {
-			printf("\t\t%s: ", vswing_preemph[i]);
+		for (int row = 0; row < 10; row++) {
+			printf("\t\t%s: ", vspeo_levels[row]);
 
-			for (int j = 0; j < vs->num_columns; j++)
-				printf(" 0x%08x", vs->tables[n * 10 * vs->num_columns + i * j]);
+			for (int col = 0; col < vspeo->num_columns; col++)
+				printf(" 0x%08x", vspeo->tables[idx * 10 * vspeo->num_columns + row * col]);
 			printf("\n");
 		}
 	}
-- 
2.45.2


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

* [PATCH i-g-t v2 3/8] tools/vbt_decode: return 0 from get_device_id()
  2026-06-08 12:41 [PATCH i-g-t v2 0/8] Vswing / Pre-emphasis Override decoding Michał Grzelak
  2026-06-08 12:41 ` [PATCH i-g-t v2 1/8] tools/vbt_decode: fix tables' offset reading Michał Grzelak
  2026-06-08 12:41 ` [PATCH i-g-t v2 2/8] tools/vbt_decode: rename VBT#57 related vars Michał Grzelak
@ 2026-06-08 12:41 ` Michał Grzelak
  2026-06-11  9:47   ` Jani Nikula
  2026-06-08 12:41 ` [PATCH i-g-t v2 4/8] tools/vbt_decode: validate DEVICE env var Michał Grzelak
                   ` (7 subsequent siblings)
  10 siblings, 1 reply; 17+ messages in thread
From: Michał Grzelak @ 2026-06-08 12:41 UTC (permalink / raw)
  To: igt-dev; +Cc: jani.nikula, suraj.kandpal, Michał Grzelak

This function returns -1 on errors and the caller checks for 0. This
leads to -1 being used as the device id. Return 0 instead of -1.

Signed-off-by: Michał Grzelak <michal.grzelak@intel.com>
---
 tools/intel_vbt_decode.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/intel_vbt_decode.c b/tools/intel_vbt_decode.c
index 5b7a6a49e9..6a9c1de7b3 100644
--- a/tools/intel_vbt_decode.c
+++ b/tools/intel_vbt_decode.c
@@ -3700,13 +3700,13 @@ get_device_id(unsigned char *bios, int size)
     int offset = (bios[0x19] << 8) + bios[0x18];
 
     if (offset + 7 >= size)
-	return -1;
+	return 0;
 
     if (bios[offset] != 'P' ||
 	bios[offset+1] != 'C' ||
 	bios[offset+2] != 'I' ||
 	bios[offset+3] != 'R')
-	return -1;
+	return 0;
 
     device = (bios[offset+7] << 8) + bios[offset+6];
 
-- 
2.45.2


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

* [PATCH i-g-t v2 4/8] tools/vbt_decode: validate DEVICE env var
  2026-06-08 12:41 [PATCH i-g-t v2 0/8] Vswing / Pre-emphasis Override decoding Michał Grzelak
                   ` (2 preceding siblings ...)
  2026-06-08 12:41 ` [PATCH i-g-t v2 3/8] tools/vbt_decode: return 0 from get_device_id() Michał Grzelak
@ 2026-06-08 12:41 ` Michał Grzelak
  2026-06-11  9:51   ` Jani Nikula
  2026-06-08 12:41 ` [PATCH i-g-t v2 5/8] tools/vbt_decode: guess devid from VBT signature Michał Grzelak
                   ` (6 subsequent siblings)
  10 siblings, 1 reply; 17+ messages in thread
From: Michał Grzelak @ 2026-06-08 12:41 UTC (permalink / raw)
  To: igt-dev; +Cc: jani.nikula, suraj.kandpal, Michał Grzelak

On error, strotoul() returns converted value of longest substring
spanning from beginning. Check if device ID input via DEVICE env var is
valid. Log to the user if it is not and reset the devid.

Signed-off-by: Michał Grzelak <michal.grzelak@intel.com>
---
 tools/intel_vbt_decode.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/tools/intel_vbt_decode.c b/tools/intel_vbt_decode.c
index 6a9c1de7b3..5681643f4b 100644
--- a/tools/intel_vbt_decode.c
+++ b/tools/intel_vbt_decode.c
@@ -4315,8 +4315,13 @@ int main(int argc, char **argv)
 
 	if (!context.devid) {
 		const char *devid_string = getenv("DEVICE");
-		if (devid_string)
-			context.devid = strtoul(devid_string, NULL, 16);
+		if (devid_string) {
+			context.devid = strtoul(devid_string, &endp, 16);
+			if (*endp) {
+				fprintf(stderr, "invalid devid: %s\n", endp);
+				context.devid = 0;
+			}
+		}
 	}
 	if (!context.devid)
 		context.devid = get_device_id(VBIOS, size);
-- 
2.45.2


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

* [PATCH i-g-t v2 5/8] tools/vbt_decode: guess devid from VBT signature
  2026-06-08 12:41 [PATCH i-g-t v2 0/8] Vswing / Pre-emphasis Override decoding Michał Grzelak
                   ` (3 preceding siblings ...)
  2026-06-08 12:41 ` [PATCH i-g-t v2 4/8] tools/vbt_decode: validate DEVICE env var Michał Grzelak
@ 2026-06-08 12:41 ` Michał Grzelak
  2026-06-10 14:42   ` Jani Nikula
  2026-06-08 12:41 ` [PATCH i-g-t v2 6/8] tools/vbt_decode: parse & dump VS/PE-O tables for LT Michał Grzelak
                   ` (5 subsequent siblings)
  10 siblings, 1 reply; 17+ messages in thread
From: Michał Grzelak @ 2026-06-08 12:41 UTC (permalink / raw)
  To: igt-dev; +Cc: jani.nikula, suraj.kandpal, Michał Grzelak

Nowadays Device ID needs to be passed to decode VBT precisely. VBT lacks
it since VBT has been moved from PCI ROM into opregion.

However we can narrow from which platform VBT originated basing on VBT
signature.

Add a command-line option to guess devid using VBT signature. Create an
array of signatures and check if any of those is a substring of
signature extracted from given VBT. Map each signature into first Device
ID of a platform picked from include/drm/intel/pciids.h. Log that devid
has not been matched if signature is not found.

Note that the platform-specific name should appear after "$VBT ", hence
the match.

Suggested-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Michał Grzelak <michal.grzelak@intel.com>
---
 tools/intel_vbt_decode.c | 36 +++++++++++++++++++++++++++++++++++-
 1 file changed, 35 insertions(+), 1 deletion(-)

diff --git a/tools/intel_vbt_decode.c b/tools/intel_vbt_decode.c
index 5681643f4b..ec82b00939 100644
--- a/tools/intel_vbt_decode.c
+++ b/tools/intel_vbt_decode.c
@@ -77,6 +77,7 @@ struct context {
 	uint32_t devid;
 	int panel_type, panel_type2;
 	int sdvo_panel_type;
+	bool devid_from_signature;
 	bool dump_all_panel_types;
 	bool hexdump;
 };
@@ -3693,6 +3694,31 @@ static int get_sdvo_panel_type(struct context *context)
 	return panel_type;
 }
 
+static int
+get_devid_from_signature(const char *vbt_signature)
+{
+	int i;
+
+	const char *signature[] = {"PANTHERLAKE",
+				   "LUNARLAKE",
+				   "METEORLAKE",
+				   "JASPERLAKE",
+				   NULL};
+
+	int devid[] = {0xB080, /* PTL */
+		       0x6420, /* LNL */
+		       0x7D40, /* MTL */
+		       0x4E51, /* JSL */
+		       0x0};
+
+	for (i = 0; signature[i]; i++)
+		if (strstr(vbt_signature, signature[i]))
+			return devid[i];
+
+	fprintf(stderr, "Warning: cannot find devid for signature %s\n", vbt_signature);
+	return 0;
+}
+
 static int
 get_device_id(unsigned char *bios, int size)
 {
@@ -4108,6 +4134,7 @@ enum opt {
 	OPT_PANEL_TYPE2,
 	OPT_PANEL_EDID,
 	OPT_PANEL_EDID2,
+	OPT_VBT_DEVID,
 	OPT_ALL_PANELS,
 	OPT_HEXDUMP,
 	OPT_BLOCK,
@@ -4162,6 +4189,8 @@ int main(int argc, char **argv)
 		{ "panel-edid",	required_argument,	NULL,	OPT_PANEL_EDID },
 		{ "panel-type2",	required_argument,	NULL,	OPT_PANEL_TYPE2 },
 		{ "panel-edid2",	required_argument,	NULL,	OPT_PANEL_EDID2 },
+		{ "devid-from-signature",
+				no_argument,		NULL,	OPT_VBT_DEVID },
 		{ "all-panels",	no_argument,		NULL,	OPT_ALL_PANELS },
 		{ "hexdump",	no_argument,		NULL,	OPT_HEXDUMP },
 		{ "block",	required_argument,	NULL,	OPT_BLOCK },
@@ -4207,6 +4236,9 @@ int main(int argc, char **argv)
 		case OPT_PANEL_EDID2:
 			panel_edid2 = optarg;
 			break;
+		case OPT_VBT_DEVID:
+			context.devid_from_signature = true;
+			break;
 		case OPT_ALL_PANELS:
 			context.dump_all_panel_types = true;
 			break;
@@ -4313,6 +4345,8 @@ int main(int argc, char **argv)
 	context.bdb = (const struct bdb_header *)(VBIOS + bdb_off);
 	context.size = size;
 
+	if (!context.devid && context.devid_from_signature)
+		context.devid = get_devid_from_signature((char *) vbt->signature);
 	if (!context.devid) {
 		const char *devid_string = getenv("DEVICE");
 		if (devid_string) {
@@ -4326,7 +4360,7 @@ int main(int argc, char **argv)
 	if (!context.devid)
 		context.devid = get_device_id(VBIOS, size);
 	if (!context.devid)
-		fprintf(stderr, "Warning: could not find PCI device ID!\n");
+		fprintf(stderr, "Warning: could not find PCI device ID! Use --devid or --devid-from-signature\n");
 
 	if (context.panel_type == -1)
 		context.panel_type = get_panel_type(&context, false);
-- 
2.45.2


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

* [PATCH i-g-t v2 6/8] tools/vbt_decode: parse & dump VS/PE-O tables for LT
  2026-06-08 12:41 [PATCH i-g-t v2 0/8] Vswing / Pre-emphasis Override decoding Michał Grzelak
                   ` (4 preceding siblings ...)
  2026-06-08 12:41 ` [PATCH i-g-t v2 5/8] tools/vbt_decode: guess devid from VBT signature Michał Grzelak
@ 2026-06-08 12:41 ` Michał Grzelak
  2026-06-08 12:41 ` [PATCH i-g-t v2 7/8] tools/vbt_decode: parse & dump VS/PE-O tables for Snps Michał Grzelak
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 17+ messages in thread
From: Michał Grzelak @ 2026-06-08 12:41 UTC (permalink / raw)
  To: igt-dev; +Cc: jani.nikula, suraj.kandpal, Michał Grzelak

Dump VBT #57 tables for LT. Add a table of strings to store each table
purpose. Show the affected modes on dumping.

v1->v2
- check platform basing on devid not VBT signature (Jani)

Signed-off-by: Michał Grzelak <michal.grzelak@intel.com>
---
 tools/intel_vbt_decode.c | 64 +++++++++++++++++++++++++++++++++-------
 1 file changed, 54 insertions(+), 10 deletions(-)

diff --git a/tools/intel_vbt_decode.c b/tools/intel_vbt_decode.c
index ec82b00939..f209fd89b0 100644
--- a/tools/intel_vbt_decode.c
+++ b/tools/intel_vbt_decode.c
@@ -3464,24 +3464,68 @@ static const char * const vspeo_dp14_levels[10] = {
 	"V3-P0",
 };
 
-static void dump_vswing_preemphasis(struct context *context,
-				    const struct bdb_block *block)
+static const char * const vspeo_lt_tables[6] = {
+	"UNUSED",
+	"UNUSED",
+	"UNUSED",
+	"UNUSED",
+	"DP 1.4",
+	"DP 2.1",
+};
+
+static void dump_lt_vspeo(const struct bdb_vswing_preemph *vspeo,
+			  int num_rows)
 {
-	const struct bdb_vswing_preemph *vspeo = block_data(block);
+	const unsigned int *tables = vspeo->tables;
+	size_t offset = 0;
 
 	printf("\tNumber of vswing tables: %d\n", vspeo->num_tables);
 	printf("\tNumber of columns: %d\n", vspeo->num_columns);
+	printf("\tNumber of rows: %d\n", num_rows);
+
+	printf("\tPHY type: LT\n");
 
 	for (int idx = 0; idx < vspeo->num_tables; idx++) {
-		printf("\tVswing Table #%d:\n", idx+1);
+		printf("\tVswing Table #%d (%s):\n", idx, vspeo_lt_tables[idx]);
+		for (int row = 0; row < num_rows; row++) {
+			int main_cursor = tables[offset];
+			int pre_cursor = tables[offset + 1];
+			int post_cursor = tables[offset + 2];
+
+			printf("\t\tPreset #%02d: ", row+1);
+			printf("main-cursor: 0x%08x, ", main_cursor);
+			printf("pre-cursor: 0x%08x, ", pre_cursor);
+			printf("post-cursor: 0x%08x\n", post_cursor);
+
+			offset += vspeo->num_columns;
+		}
+	}
+}
 
-		for (int row = 0; row < 10; row++) {
-			printf("\t\t%s: ", vspeo_levels[row]);
+static int
+vswing_preemph_num_rows(int devid)
+{
+	return intel_display_ver(devid) > 14 ? 16 : 10;
+}
 
-			for (int col = 0; col < vspeo->num_columns; col++)
-				printf(" 0x%08x", vspeo->tables[idx * 10 * vspeo->num_columns + row * col]);
-			printf("\n");
-		}
+static void dump_vswing_preemphasis(struct context *context,
+				    const struct bdb_block *block)
+{
+	const struct bdb_vswing_preemph *vspeo = block_data(block);
+	int devid = context->devid;
+	int num_rows;
+
+	if (!devid) {
+		fprintf(stderr, "Error: cannot parse VS/PE-O without devid\n");
+		return;
+	}
+
+	num_rows = vswing_preemph_num_rows(devid);
+
+	if (IS_NOVALAKE_P(devid) || IS_NOVALAKE_S(devid)) {
+		dump_lt_vspeo(vspeo, num_rows);
+	} else {
+		printf("Warning: deparsing VS/PE-O from devid %x not supported\n", devid);
 	}
 }
 
-- 
2.45.2


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

* [PATCH i-g-t v2 7/8] tools/vbt_decode: parse & dump VS/PE-O tables for Snps
  2026-06-08 12:41 [PATCH i-g-t v2 0/8] Vswing / Pre-emphasis Override decoding Michał Grzelak
                   ` (5 preceding siblings ...)
  2026-06-08 12:41 ` [PATCH i-g-t v2 6/8] tools/vbt_decode: parse & dump VS/PE-O tables for LT Michał Grzelak
@ 2026-06-08 12:41 ` Michał Grzelak
  2026-06-08 12:41 ` [PATCH i-g-t v2 8/8] tools/vbt_decode: parse & dump VS/PE-O tables for Combo Michał Grzelak
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 17+ messages in thread
From: Michał Grzelak @ 2026-06-08 12:41 UTC (permalink / raw)
  To: igt-dev; +Cc: jani.nikula, suraj.kandpal, Michał Grzelak

Dump VBT #57 tables for Snps. Add a table of strings to store each table
purpose. Show the affected modes on dumping.

v1->v2
- check platform basing on devid not VBT signature (Jani)

Signed-off-by: Michał Grzelak <michal.grzelak@intel.com>
---
 tools/intel_vbt_decode.c | 42 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 42 insertions(+)

diff --git a/tools/intel_vbt_decode.c b/tools/intel_vbt_decode.c
index f209fd89b0..0ec08530a9 100644
--- a/tools/intel_vbt_decode.c
+++ b/tools/intel_vbt_decode.c
@@ -3473,6 +3473,15 @@ static const char * const vspeo_lt_tables[6] = {
 	"DP 2.1",
 };
 
+static const char * const vspeo_cx0_tables[6] = {
+	"C10: DP 1.4 RBR/HBR; C20: UNUSED",
+	"C10: DP 1.4 HBR2/HBR3; C20: UNUSED",
+	"C10: eDP non-HBR3; C20: UNUSED",
+	"C10: eDP HBR3; C20: UNUSED",
+	"C10: UNUSED; C20: DP 1.4",
+	"C10: UNUSED; C20: DP 2.X",
+};
+
 static void dump_lt_vspeo(const struct bdb_vswing_preemph *vspeo,
 			  int num_rows)
 {
@@ -3502,6 +3511,34 @@ static void dump_lt_vspeo(const struct bdb_vswing_preemph *vspeo,
 	}
 }
 
+static void dump_c20_vspeo(const struct bdb_vswing_preemph *vspeo,
+			   int num_rows)
+{
+	const unsigned int *tables = vspeo->tables;
+	size_t offset = 0;
+
+	printf("\tNumber of vswing tables: %d\n", vspeo->num_tables);
+	printf("\tNumber of columns: %d\n", vspeo->num_columns);
+	printf("\tNumber of rows: %d\n", num_rows);
+
+	printf("\tPHY type: C20\n");
+	for (int idx = 0; idx < vspeo->num_tables; idx++) {
+		printf("\tVswing Table #%d (%s):\n", idx, vspeo_cx0_tables[idx]);
+		for (int row = 0; row < num_rows; row++) {
+			int vswing = tables[offset];
+			int pre_cursor = tables[offset + 1];
+			int post_cursor = tables[offset + 2];
+
+			printf("\t\tPreset #%02d: ", row+1);
+			printf("vswing: 0x%08x, ", vswing);
+			printf("pre-cursor: 0x%08x, ", pre_cursor);
+			printf("post-cursor: 0x%08x\n", post_cursor);
+
+			offset += vspeo->num_columns;
+		}
+	}
+}
+
 static int
 vswing_preemph_num_rows(int devid)
 {
@@ -3524,6 +3561,11 @@ static void dump_vswing_preemphasis(struct context *context,
 
 	if (IS_NOVALAKE_P(devid) || IS_NOVALAKE_S(devid)) {
 		dump_lt_vspeo(vspeo, num_rows);
+	} else if (IS_PANTHERLAKE(devid) ||
+		   IS_BATTLEMAGE(devid) ||
+		   IS_LUNARLAKE(devid) ||
+		   IS_METEORLAKE(devid)) {
+		dump_c20_vspeo(vspeo, num_rows);
 	} else {
 		printf("Warning: deparsing VS/PE-O from devid %x not supported\n", devid);
 	}
-- 
2.45.2


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

* [PATCH i-g-t v2 8/8] tools/vbt_decode: parse & dump VS/PE-O tables for Combo
  2026-06-08 12:41 [PATCH i-g-t v2 0/8] Vswing / Pre-emphasis Override decoding Michał Grzelak
                   ` (6 preceding siblings ...)
  2026-06-08 12:41 ` [PATCH i-g-t v2 7/8] tools/vbt_decode: parse & dump VS/PE-O tables for Snps Michał Grzelak
@ 2026-06-08 12:41 ` Michał Grzelak
  2026-06-09  0:04 ` ✓ Xe.CI.BAT: success for Vswing / Pre-emphasis Override decoding Patchwork
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 17+ messages in thread
From: Michał Grzelak @ 2026-06-08 12:41 UTC (permalink / raw)
  To: igt-dev; +Cc: jani.nikula, suraj.kandpal, Michał Grzelak

Dump VBT #57 tables for JSL/EHL. Add a table of strings to store each
table's purpose. Show the affected modes on dumping. Warn the user on
varying purpose of VS/PE-O tables which depend on whether VBT comes from
EHL or JSL.

v1->v2
- check platform basing on devid not VBT signature (Jani)

Signed-off-by: Michał Grzelak <michal.grzelak@intel.com>
---
 lib/intel_chipset.h      |  2 ++
 tools/intel_vbt_decode.c | 41 ++++++++++++++++++++++++++++++++++++++++
 2 files changed, 43 insertions(+)

diff --git a/lib/intel_chipset.h b/lib/intel_chipset.h
index 3fcc5b18d6..28600a01b3 100644
--- a/lib/intel_chipset.h
+++ b/lib/intel_chipset.h
@@ -201,6 +201,8 @@ void intel_check_pch(void);
 #define IS_COMETLAKE(devid)	(intel_get_device_info(devid)->is_cometlake)
 #define IS_CANNONLAKE(devid)	(intel_get_device_info(devid)->is_cannonlake)
 #define IS_ICELAKE(devid)	(intel_get_device_info(devid)->is_icelake)
+#define IS_JASPERLAKE(devid)	(intel_get_device_info(devid)->is_jasperlake)
+#define IS_ELKHARTLAKE(devid)	(intel_get_device_info(devid)->is_elkhartlake)
 #define IS_TIGERLAKE(devid)	(intel_get_device_info(devid)->is_tigerlake)
 #define IS_ROCKETLAKE(devid)	(intel_get_device_info(devid)->is_rocketlake)
 #define IS_DG1(devid)		(intel_get_device_info(devid)->is_dg1)
diff --git a/tools/intel_vbt_decode.c b/tools/intel_vbt_decode.c
index 0ec08530a9..f30337d84b 100644
--- a/tools/intel_vbt_decode.c
+++ b/tools/intel_vbt_decode.c
@@ -3482,6 +3482,12 @@ static const char * const vspeo_cx0_tables[6] = {
 	"C10: UNUSED; C20: DP 2.X",
 };
 
+static const char * const vspeo_combo_tables[3] = {
+	"High Vswing eDP/DP upto HBR3",
+	"Low Vswing eDP upto HBR2",
+	"Low Vswing eDP upto HBR3",
+};
+
 static void dump_lt_vspeo(const struct bdb_vswing_preemph *vspeo,
 			  int num_rows)
 {
@@ -3539,6 +3545,39 @@ static void dump_c20_vspeo(const struct bdb_vswing_preemph *vspeo,
 	}
 }
 
+static void dump_combo_vspeo(const struct bdb_vswing_preemph *vspeo,
+			     int num_rows)
+{
+	const unsigned int *tables = vspeo->tables;
+	size_t offset = 0;
+
+	fprintf(stderr, "\tWarning: purpose of tables varies between EHL & JSL\n");
+	printf("\tNumber of vswing tables: %d\n", vspeo->num_tables);
+	printf("\tNumber of columns: %d\n", vspeo->num_columns);
+	printf("\tNumber of rows: %d\n", num_rows);
+
+	printf("\tPHY type: Combo\n");
+	for (int idx = 0; idx < vspeo->num_tables; idx++) {
+		printf("\tVswing Table #%d (%s):\n", idx, vspeo_combo_tables[idx]);
+		for (int row = 0; row < num_rows; row++) {
+			int dw2_swing_sel = tables[offset];
+			int dw7_n_scalar = tables[offset + 1];
+			int dw4_cursor_coeff = tables[offset + 2];
+			int dw4_post_cursor_2 = tables[offset + 3];
+			int dw4_post_cursor_1 = tables[offset + 4];
+
+			printf("\t\t%s: ", vspeo_dp14_levels[row]);
+			printf("dw2_swing_sel: 0x%08x, ", dw2_swing_sel);
+			printf("dw7_n_scalar: 0x%08x, ", dw7_n_scalar);
+			printf("dw4_cursor_coeff: 0x%08x, ", dw4_cursor_coeff);
+			printf("dw4_post_cursor_2: 0x%08x, ", dw4_post_cursor_2);
+			printf("dw4_post_cursor_1: 0x%08x\n", dw4_post_cursor_1);
+
+			offset += vspeo->num_columns;
+		}
+	}
+}
+
 static int
 vswing_preemph_num_rows(int devid)
 {
@@ -3566,6 +3605,8 @@ static void dump_vswing_preemphasis(struct context *context,
 		   IS_LUNARLAKE(devid) ||
 		   IS_METEORLAKE(devid)) {
 		dump_c20_vspeo(vspeo, num_rows);
+	} else if (IS_JASPERLAKE(devid) || IS_ELKHARTLAKE(devid)) {
+		dump_combo_vspeo(vspeo, num_rows);
 	} else {
 		printf("Warning: deparsing VS/PE-O from devid %x not supported\n", devid);
 	}
-- 
2.45.2


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

* ✓ Xe.CI.BAT: success for Vswing / Pre-emphasis Override decoding
  2026-06-08 12:41 [PATCH i-g-t v2 0/8] Vswing / Pre-emphasis Override decoding Michał Grzelak
                   ` (7 preceding siblings ...)
  2026-06-08 12:41 ` [PATCH i-g-t v2 8/8] tools/vbt_decode: parse & dump VS/PE-O tables for Combo Michał Grzelak
@ 2026-06-09  0:04 ` Patchwork
  2026-06-09  0:18 ` ✓ i915.CI.BAT: " Patchwork
  2026-06-09  5:04 ` ✗ Xe.CI.FULL: failure " Patchwork
  10 siblings, 0 replies; 17+ messages in thread
From: Patchwork @ 2026-06-09  0:04 UTC (permalink / raw)
  To: Michał Grzelak; +Cc: igt-dev

[-- Attachment #1: Type: text/plain, Size: 769 bytes --]

== Series Details ==

Series: Vswing / Pre-emphasis Override decoding
URL   : https://patchwork.freedesktop.org/series/168078/
State : success

== Summary ==

CI Bug Log - changes from XEIGT_8953_BAT -> XEIGTPW_15321_BAT
====================================================

Summary
-------

  **SUCCESS**

  No regressions found.

  

Participating hosts (13 -> 13)
------------------------------

  No changes in participating hosts


Changes
-------

  No changes found


Build changes
-------------

  * IGT: IGT_8953 -> IGTPW_15321

  IGTPW_15321: 15321
  IGT_8953: 8953
  xe-5218-0375ba98c1fdf69bc3a05ffa80591f9ffe910330: 0375ba98c1fdf69bc3a05ffa80591f9ffe910330

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_15321/index.html

[-- Attachment #2: Type: text/html, Size: 1314 bytes --]

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

* ✓ i915.CI.BAT: success for Vswing / Pre-emphasis Override decoding
  2026-06-08 12:41 [PATCH i-g-t v2 0/8] Vswing / Pre-emphasis Override decoding Michał Grzelak
                   ` (8 preceding siblings ...)
  2026-06-09  0:04 ` ✓ Xe.CI.BAT: success for Vswing / Pre-emphasis Override decoding Patchwork
@ 2026-06-09  0:18 ` Patchwork
  2026-06-09  5:04 ` ✗ Xe.CI.FULL: failure " Patchwork
  10 siblings, 0 replies; 17+ messages in thread
From: Patchwork @ 2026-06-09  0:18 UTC (permalink / raw)
  To: Michał Grzelak; +Cc: igt-dev

[-- Attachment #1: Type: text/plain, Size: 2276 bytes --]

== Series Details ==

Series: Vswing / Pre-emphasis Override decoding
URL   : https://patchwork.freedesktop.org/series/168078/
State : success

== Summary ==

CI Bug Log - changes from IGT_8953 -> IGTPW_15321
====================================================

Summary
-------

  **SUCCESS**

  No regressions found.

  External URL: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_15321/index.html

Participating hosts (42 -> 40)
------------------------------

  Missing    (2): bat-dg2-13 fi-snb-2520m 

Known issues
------------

  Here are the changes found in IGTPW_15321 that come from known issues:

### IGT changes ###

#### Issues hit ####

  * igt@i915_selftest@live@late_gt_pm:
    - fi-cfl-8109u:       [PASS][1] -> [DMESG-WARN][2] ([i915#13735]) +80 other tests dmesg-warn
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_8953/fi-cfl-8109u/igt@i915_selftest@live@late_gt_pm.html
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_15321/fi-cfl-8109u/igt@i915_selftest@live@late_gt_pm.html

  * igt@kms_pipe_crc_basic@read-crc:
    - fi-cfl-8109u:       [PASS][3] -> [DMESG-WARN][4] ([i915#13735] / [i915#15673]) +49 other tests dmesg-warn
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_8953/fi-cfl-8109u/igt@kms_pipe_crc_basic@read-crc.html
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_15321/fi-cfl-8109u/igt@kms_pipe_crc_basic@read-crc.html

  * igt@kms_pm_rpm@basic-rte:
    - bat-rpls-4:         [PASS][5] -> [DMESG-WARN][6] ([i915#13400])
   [5]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_8953/bat-rpls-4/igt@kms_pm_rpm@basic-rte.html
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_15321/bat-rpls-4/igt@kms_pm_rpm@basic-rte.html

  
  [i915#13400]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/13400
  [i915#13735]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/13735
  [i915#15673]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/15673


Build changes
-------------

  * CI: CI-20190529 -> None
  * IGT: IGT_8953 -> IGTPW_15321

  CI-20190529: 20190529
  CI_DRM_18641: 0375ba98c1fdf69bc3a05ffa80591f9ffe910330 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_15321: 15321
  IGT_8953: 8953

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_15321/index.html

[-- Attachment #2: Type: text/html, Size: 3001 bytes --]

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

* ✗ Xe.CI.FULL: failure for Vswing / Pre-emphasis Override decoding
  2026-06-08 12:41 [PATCH i-g-t v2 0/8] Vswing / Pre-emphasis Override decoding Michał Grzelak
                   ` (9 preceding siblings ...)
  2026-06-09  0:18 ` ✓ i915.CI.BAT: " Patchwork
@ 2026-06-09  5:04 ` Patchwork
  10 siblings, 0 replies; 17+ messages in thread
From: Patchwork @ 2026-06-09  5:04 UTC (permalink / raw)
  To: Michał Grzelak; +Cc: igt-dev

[-- Attachment #1: Type: text/plain, Size: 16107 bytes --]

== Series Details ==

Series: Vswing / Pre-emphasis Override decoding
URL   : https://patchwork.freedesktop.org/series/168078/
State : failure

== Summary ==

CI Bug Log - changes from XEIGT_8953_FULL -> XEIGTPW_15321_FULL
====================================================

Summary
-------

  **FAILURE**

  Serious unknown changes coming with XEIGTPW_15321_FULL absolutely need to be
  verified manually.
  
  If you think the reported changes have nothing to do with the changes
  introduced in XEIGTPW_15321_FULL, please notify your bug team (I915-ci-infra@lists.freedesktop.org) to allow them
  to document this new failure mode, which will reduce false positives in CI.

  

Participating hosts (2 -> 2)
------------------------------

  No changes in participating hosts

Possible new issues
-------------------

  Here are the unknown changes that may have been introduced in XEIGTPW_15321_FULL:

### IGT changes ###

#### Possible regressions ####

  * igt@kms_plane@pixel-format-x-tiled-modifier@pipe-b-plane-5:
    - shard-bmg:          NOTRUN -> [SKIP][1] +1 other test skip
   [1]: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_15321/shard-bmg-10/igt@kms_plane@pixel-format-x-tiled-modifier@pipe-b-plane-5.html

  * igt@xe_sriov_admin@exec-quantum-write-readback-vfs-disabled@pf-eq_ms-10:
    - shard-bmg:          [PASS][2] -> [SKIP][3]
   [2]: https://intel-gfx-ci.01.org/tree/intel-xe/IGT_8953/shard-bmg-8/igt@xe_sriov_admin@exec-quantum-write-readback-vfs-disabled@pf-eq_ms-10.html
   [3]: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_15321/shard-bmg-9/igt@xe_sriov_admin@exec-quantum-write-readback-vfs-disabled@pf-eq_ms-10.html

  
Known issues
------------

  Here are the changes found in XEIGTPW_15321_FULL that come from known issues:

### IGT changes ###

#### Issues hit ####

  * igt@kms_big_fb@linear-16bpp-rotate-90:
    - shard-lnl:          NOTRUN -> [SKIP][4] ([Intel XE#1407])
   [4]: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_15321/shard-lnl-7/igt@kms_big_fb@linear-16bpp-rotate-90.html
    - shard-bmg:          NOTRUN -> [SKIP][5] ([Intel XE#2327])
   [5]: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_15321/shard-bmg-1/igt@kms_big_fb@linear-16bpp-rotate-90.html

  * igt@kms_fbcon_fbt@fbc:
    - shard-bmg:          NOTRUN -> [SKIP][6] ([Intel XE#4156] / [Intel XE#7425])
   [6]: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_15321/shard-bmg-9/igt@kms_fbcon_fbt@fbc.html

  * igt@kms_flip@2x-plain-flip-fb-recreate-interruptible:
    - shard-lnl:          NOTRUN -> [SKIP][7] ([Intel XE#1421])
   [7]: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_15321/shard-lnl-7/igt@kms_flip@2x-plain-flip-fb-recreate-interruptible.html

  * igt@kms_flip@flip-vs-expired-vblank@a-edp1:
    - shard-lnl:          [PASS][8] -> [FAIL][9] ([Intel XE#301])
   [8]: https://intel-gfx-ci.01.org/tree/intel-xe/IGT_8953/shard-lnl-8/igt@kms_flip@flip-vs-expired-vblank@a-edp1.html
   [9]: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_15321/shard-lnl-7/igt@kms_flip@flip-vs-expired-vblank@a-edp1.html

  * igt@kms_flip_scaled_crc@flip-32bpp-yuv-linear-to-32bpp-yuv-linear-reflect-x:
    - shard-bmg:          NOTRUN -> [SKIP][10] ([Intel XE#7179])
   [10]: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_15321/shard-bmg-10/igt@kms_flip_scaled_crc@flip-32bpp-yuv-linear-to-32bpp-yuv-linear-reflect-x.html

  * igt@kms_frontbuffer_tracking@drrs-1p-primscrn-spr-indfb-draw-mmap-wc:
    - shard-lnl:          NOTRUN -> [SKIP][11] ([Intel XE#6312] / [Intel XE#651])
   [11]: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_15321/shard-lnl-8/igt@kms_frontbuffer_tracking@drrs-1p-primscrn-spr-indfb-draw-mmap-wc.html

  * igt@kms_frontbuffer_tracking@fbcdrrshdr-1p-primscrn-spr-indfb-draw-render:
    - shard-bmg:          NOTRUN -> [SKIP][12] ([Intel XE#2311]) +3 other tests skip
   [12]: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_15321/shard-bmg-1/igt@kms_frontbuffer_tracking@fbcdrrshdr-1p-primscrn-spr-indfb-draw-render.html

  * igt@kms_frontbuffer_tracking@fbcpsrhdr-2p-scndscrn-spr-indfb-onoff:
    - shard-bmg:          NOTRUN -> [SKIP][13] ([Intel XE#2313]) +2 other tests skip
   [13]: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_15321/shard-bmg-8/igt@kms_frontbuffer_tracking@fbcpsrhdr-2p-scndscrn-spr-indfb-onoff.html

  * igt@kms_frontbuffer_tracking@hdr-2p-scndscrn-pri-shrfb-draw-mmap-wc:
    - shard-lnl:          NOTRUN -> [SKIP][14] ([Intel XE#7905]) +4 other tests skip
   [14]: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_15321/shard-lnl-7/igt@kms_frontbuffer_tracking@hdr-2p-scndscrn-pri-shrfb-draw-mmap-wc.html

  * igt@kms_hdr@invalid-metadata-sizes@pipe-a-hdmi-a-3-xrgb16161616f:
    - shard-bmg:          [PASS][15] -> [SKIP][16] ([Intel XE#7915]) +3 other tests skip
   [15]: https://intel-gfx-ci.01.org/tree/intel-xe/IGT_8953/shard-bmg-10/igt@kms_hdr@invalid-metadata-sizes@pipe-a-hdmi-a-3-xrgb16161616f.html
   [16]: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_15321/shard-bmg-8/igt@kms_hdr@invalid-metadata-sizes@pipe-a-hdmi-a-3-xrgb16161616f.html

  * igt@kms_joiner@basic-ultra-joiner:
    - shard-bmg:          NOTRUN -> [SKIP][17] ([Intel XE#6911] / [Intel XE#7378])
   [17]: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_15321/shard-bmg-9/igt@kms_joiner@basic-ultra-joiner.html
    - shard-lnl:          NOTRUN -> [SKIP][18] ([Intel XE#6900] / [Intel XE#7362])
   [18]: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_15321/shard-lnl-1/igt@kms_joiner@basic-ultra-joiner.html

  * igt@kms_psr@psr-no-drrs:
    - shard-bmg:          NOTRUN -> [SKIP][19] ([Intel XE#2234] / [Intel XE#2850])
   [19]: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_15321/shard-bmg-7/igt@kms_psr@psr-no-drrs.html

  * igt@kms_sharpness_filter@filter-scaler-downscale:
    - shard-bmg:          NOTRUN -> [SKIP][20] ([Intel XE#6503])
   [20]: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_15321/shard-bmg-8/igt@kms_sharpness_filter@filter-scaler-downscale.html

  * igt@xe_eudebug_online@writes-caching-vram-bb-sram-target-sram:
    - shard-bmg:          NOTRUN -> [SKIP][21] ([Intel XE#7636])
   [21]: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_15321/shard-bmg-1/igt@xe_eudebug_online@writes-caching-vram-bb-sram-target-sram.html

  * igt@xe_evict@evict-small-external-multi-queue-cm:
    - shard-bmg:          NOTRUN -> [SKIP][22] ([Intel XE#7140])
   [22]: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_15321/shard-bmg-1/igt@xe_evict@evict-small-external-multi-queue-cm.html
    - shard-lnl:          NOTRUN -> [SKIP][23] ([Intel XE#6540] / [Intel XE#688])
   [23]: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_15321/shard-lnl-2/igt@xe_evict@evict-small-external-multi-queue-cm.html

  * igt@xe_exec_basic@multigpu-many-execqueues-many-vm-userptr-invalidate-race:
    - shard-bmg:          NOTRUN -> [SKIP][24] ([Intel XE#2322] / [Intel XE#7372])
   [24]: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_15321/shard-bmg-7/igt@xe_exec_basic@multigpu-many-execqueues-many-vm-userptr-invalidate-race.html
    - shard-lnl:          NOTRUN -> [SKIP][25] ([Intel XE#1392])
   [25]: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_15321/shard-lnl-5/igt@xe_exec_basic@multigpu-many-execqueues-many-vm-userptr-invalidate-race.html

  * igt@xe_exec_multi_queue@many-queues-priority-smem:
    - shard-bmg:          NOTRUN -> [SKIP][26] ([Intel XE#6874]) +1 other test skip
   [26]: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_15321/shard-bmg-9/igt@xe_exec_multi_queue@many-queues-priority-smem.html
    - shard-lnl:          NOTRUN -> [SKIP][27] ([Intel XE#6874])
   [27]: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_15321/shard-lnl-1/igt@xe_exec_multi_queue@many-queues-priority-smem.html

  * igt@xe_sriov_auto_provisioning@selfconfig-basic:
    - shard-bmg:          [PASS][28] -> [FAIL][29] ([Intel XE#7992]) +1 other test fail
   [28]: https://intel-gfx-ci.01.org/tree/intel-xe/IGT_8953/shard-bmg-7/igt@xe_sriov_auto_provisioning@selfconfig-basic.html
   [29]: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_15321/shard-bmg-9/igt@xe_sriov_auto_provisioning@selfconfig-basic.html

  * igt@xe_sriov_flr@flr-vfs-parallel:
    - shard-bmg:          [PASS][30] -> [FAIL][31] ([Intel XE#6569]) +1 other test fail
   [30]: https://intel-gfx-ci.01.org/tree/intel-xe/IGT_8953/shard-bmg-8/igt@xe_sriov_flr@flr-vfs-parallel.html
   [31]: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_15321/shard-bmg-10/igt@xe_sriov_flr@flr-vfs-parallel.html

  * igt@xe_wedged@wedged-mode-toggle:
    - shard-lnl:          [PASS][32] -> [ABORT][33] ([Intel XE#8007])
   [32]: https://intel-gfx-ci.01.org/tree/intel-xe/IGT_8953/shard-lnl-1/igt@xe_wedged@wedged-mode-toggle.html
   [33]: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_15321/shard-lnl-5/igt@xe_wedged@wedged-mode-toggle.html

  
#### Possible fixes ####

  * igt@intel_hwmon@hwmon-write:
    - shard-bmg:          [FAIL][34] ([Intel XE#7445]) -> [PASS][35]
   [34]: https://intel-gfx-ci.01.org/tree/intel-xe/IGT_8953/shard-bmg-8/igt@intel_hwmon@hwmon-write.html
   [35]: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_15321/shard-bmg-7/igt@intel_hwmon@hwmon-write.html

  * igt@kms_flip@flip-vs-expired-vblank-interruptible@b-edp1:
    - shard-lnl:          [FAIL][36] ([Intel XE#301]) -> [PASS][37] +2 other tests pass
   [36]: https://intel-gfx-ci.01.org/tree/intel-xe/IGT_8953/shard-lnl-2/igt@kms_flip@flip-vs-expired-vblank-interruptible@b-edp1.html
   [37]: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_15321/shard-lnl-8/igt@kms_flip@flip-vs-expired-vblank-interruptible@b-edp1.html

  * igt@kms_hdmi_inject@inject-audio:
    - shard-bmg:          [SKIP][38] ([Intel XE#7308]) -> [PASS][39]
   [38]: https://intel-gfx-ci.01.org/tree/intel-xe/IGT_8953/shard-bmg-8/igt@kms_hdmi_inject@inject-audio.html
   [39]: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_15321/shard-bmg-1/igt@kms_hdmi_inject@inject-audio.html

  * igt@kms_pm_dc@dc6-psr:
    - shard-lnl:          [FAIL][40] ([Intel XE#7340]) -> [PASS][41]
   [40]: https://intel-gfx-ci.01.org/tree/intel-xe/IGT_8953/shard-lnl-7/igt@kms_pm_dc@dc6-psr.html
   [41]: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_15321/shard-lnl-7/igt@kms_pm_dc@dc6-psr.html

  * igt@kms_vrr@seamless-rr-switch-virtual@pipe-a-edp-1:
    - shard-lnl:          [FAIL][42] ([Intel XE#2142]) -> [PASS][43] +1 other test pass
   [42]: https://intel-gfx-ci.01.org/tree/intel-xe/IGT_8953/shard-lnl-8/igt@kms_vrr@seamless-rr-switch-virtual@pipe-a-edp-1.html
   [43]: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_15321/shard-lnl-4/igt@kms_vrr@seamless-rr-switch-virtual@pipe-a-edp-1.html

  * igt@xe_exec_reset@long-spin-reuse-many-preempt-gt0-threads:
    - shard-bmg:          [INCOMPLETE][44] -> [PASS][45]
   [44]: https://intel-gfx-ci.01.org/tree/intel-xe/IGT_8953/shard-bmg-7/igt@xe_exec_reset@long-spin-reuse-many-preempt-gt0-threads.html
   [45]: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_15321/shard-bmg-9/igt@xe_exec_reset@long-spin-reuse-many-preempt-gt0-threads.html

  * igt@xe_sriov_flr@flr-vf1-clear:
    - shard-bmg:          [FAIL][46] ([Intel XE#6569]) -> [PASS][47]
   [46]: https://intel-gfx-ci.01.org/tree/intel-xe/IGT_8953/shard-bmg-1/igt@xe_sriov_flr@flr-vf1-clear.html
   [47]: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_15321/shard-bmg-1/igt@xe_sriov_flr@flr-vf1-clear.html

  
#### Warnings ####

  * igt@kms_frontbuffer_tracking@fbcdrrs-2p-scndscrn-indfb-plflip-blt:
    - shard-lnl:          [ABORT][48] ([Intel XE#8007]) -> [SKIP][49] ([Intel XE#656] / [Intel XE#7905])
   [48]: https://intel-gfx-ci.01.org/tree/intel-xe/IGT_8953/shard-lnl-1/igt@kms_frontbuffer_tracking@fbcdrrs-2p-scndscrn-indfb-plflip-blt.html
   [49]: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_15321/shard-lnl-8/igt@kms_frontbuffer_tracking@fbcdrrs-2p-scndscrn-indfb-plflip-blt.html

  * igt@kms_tiled_display@basic-test-pattern:
    - shard-bmg:          [FAIL][50] ([Intel XE#1729] / [Intel XE#7424]) -> [SKIP][51] ([Intel XE#2426] / [Intel XE#5848])
   [50]: https://intel-gfx-ci.01.org/tree/intel-xe/IGT_8953/shard-bmg-10/igt@kms_tiled_display@basic-test-pattern.html
   [51]: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_15321/shard-bmg-9/igt@kms_tiled_display@basic-test-pattern.html

  * igt@kms_tiled_display@basic-test-pattern-with-chamelium:
    - shard-bmg:          [SKIP][52] ([Intel XE#2509] / [Intel XE#7437]) -> [SKIP][53] ([Intel XE#2426] / [Intel XE#5848])
   [52]: https://intel-gfx-ci.01.org/tree/intel-xe/IGT_8953/shard-bmg-1/igt@kms_tiled_display@basic-test-pattern-with-chamelium.html
   [53]: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_15321/shard-bmg-8/igt@kms_tiled_display@basic-test-pattern-with-chamelium.html

  
  [Intel XE#1392]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/1392
  [Intel XE#1407]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/1407
  [Intel XE#1421]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/1421
  [Intel XE#1729]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/1729
  [Intel XE#2142]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/2142
  [Intel XE#2234]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/2234
  [Intel XE#2311]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/2311
  [Intel XE#2313]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/2313
  [Intel XE#2322]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/2322
  [Intel XE#2327]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/2327
  [Intel XE#2426]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/2426
  [Intel XE#2509]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/2509
  [Intel XE#2850]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/2850
  [Intel XE#301]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/301
  [Intel XE#4156]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/4156
  [Intel XE#5848]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/5848
  [Intel XE#6312]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/6312
  [Intel XE#6503]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/6503
  [Intel XE#651]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/651
  [Intel XE#6540]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/6540
  [Intel XE#656]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/656
  [Intel XE#6569]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/6569
  [Intel XE#6874]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/6874
  [Intel XE#688]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/688
  [Intel XE#6900]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/6900
  [Intel XE#6911]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/6911
  [Intel XE#7140]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/7140
  [Intel XE#7179]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/7179
  [Intel XE#7308]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/7308
  [Intel XE#7340]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/7340
  [Intel XE#7362]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/7362
  [Intel XE#7372]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/7372
  [Intel XE#7378]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/7378
  [Intel XE#7424]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/7424
  [Intel XE#7425]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/7425
  [Intel XE#7437]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/7437
  [Intel XE#7445]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/7445
  [Intel XE#7636]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/7636
  [Intel XE#7905]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/7905
  [Intel XE#7915]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/7915
  [Intel XE#7992]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/7992
  [Intel XE#8007]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/8007


Build changes
-------------

  * IGT: IGT_8953 -> IGTPW_15321

  IGTPW_15321: 15321
  IGT_8953: 8953
  xe-5218-0375ba98c1fdf69bc3a05ffa80591f9ffe910330: 0375ba98c1fdf69bc3a05ffa80591f9ffe910330

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_15321/index.html

[-- Attachment #2: Type: text/html, Size: 17830 bytes --]

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

* Re: [PATCH i-g-t v2 5/8] tools/vbt_decode: guess devid from VBT signature
  2026-06-08 12:41 ` [PATCH i-g-t v2 5/8] tools/vbt_decode: guess devid from VBT signature Michał Grzelak
@ 2026-06-10 14:42   ` Jani Nikula
  2026-06-10 15:13     ` Ville Syrjälä
  0 siblings, 1 reply; 17+ messages in thread
From: Jani Nikula @ 2026-06-10 14:42 UTC (permalink / raw)
  To: Michał Grzelak, igt-dev
  Cc: suraj.kandpal, Michał Grzelak, ville.syrjala

On Mon, 08 Jun 2026, Michał Grzelak <michal.grzelak@intel.com> wrote:
> Nowadays Device ID needs to be passed to decode VBT precisely. VBT lacks
> it since VBT has been moved from PCI ROM into opregion.
>
> However we can narrow from which platform VBT originated basing on VBT
> signature.
>
> Add a command-line option to guess devid using VBT signature. Create an
> array of signatures and check if any of those is a substring of
> signature extracted from given VBT. Map each signature into first Device
> ID of a platform picked from include/drm/intel/pciids.h. Log that devid
> has not been matched if signature is not found.
>
> Note that the platform-specific name should appear after "$VBT ", hence
> the match.
>
> Suggested-by: Jani Nikula <jani.nikula@intel.com>
> Signed-off-by: Michał Grzelak <michal.grzelak@intel.com>
> ---
>  tools/intel_vbt_decode.c | 36 +++++++++++++++++++++++++++++++++++-
>  1 file changed, 35 insertions(+), 1 deletion(-)
>
> diff --git a/tools/intel_vbt_decode.c b/tools/intel_vbt_decode.c
> index 5681643f4b..ec82b00939 100644
> --- a/tools/intel_vbt_decode.c
> +++ b/tools/intel_vbt_decode.c
> @@ -77,6 +77,7 @@ struct context {
>  	uint32_t devid;
>  	int panel_type, panel_type2;
>  	int sdvo_panel_type;
> +	bool devid_from_signature;
>  	bool dump_all_panel_types;
>  	bool hexdump;
>  };
> @@ -3693,6 +3694,31 @@ static int get_sdvo_panel_type(struct context *context)
>  	return panel_type;
>  }
>  
> +static int
> +get_devid_from_signature(const char *vbt_signature)
> +{
> +	int i;
> +
> +	const char *signature[] = {"PANTHERLAKE",
> +				   "LUNARLAKE",
> +				   "METEORLAKE",
> +				   "JASPERLAKE",
> +				   NULL};
> +
> +	int devid[] = {0xB080, /* PTL */
> +		       0x6420, /* LNL */
> +		       0x7D40, /* MTL */
> +		       0x4E51, /* JSL */
> +		       0x0};

Please use a struct, something along the lines of:

	static const struct {
		const char *signature;
		uint16_t devid;
	} devids[] = {
		{ .signature = "PANTHERLAKE", .devid = 0xb080, },
		...
	};

Then you can also ditch the /* PTL */ etc. comments.

> +
> +	for (i = 0; signature[i]; i++)
> +		if (strstr(vbt_signature, signature[i]))
> +			return devid[i];
> +
> +	fprintf(stderr, "Warning: cannot find devid for signature %s\n", vbt_signature);

This should be a fallback, please don't warn anything here. Only one
warning for the whole devid thing.

> +	return 0;
> +}
> +
>  static int
>  get_device_id(unsigned char *bios, int size)
>  {
> @@ -4108,6 +4134,7 @@ enum opt {
>  	OPT_PANEL_TYPE2,
>  	OPT_PANEL_EDID,
>  	OPT_PANEL_EDID2,
> +	OPT_VBT_DEVID,
>  	OPT_ALL_PANELS,
>  	OPT_HEXDUMP,
>  	OPT_BLOCK,
> @@ -4162,6 +4189,8 @@ int main(int argc, char **argv)
>  		{ "panel-edid",	required_argument,	NULL,	OPT_PANEL_EDID },
>  		{ "panel-type2",	required_argument,	NULL,	OPT_PANEL_TYPE2 },
>  		{ "panel-edid2",	required_argument,	NULL,	OPT_PANEL_EDID2 },
> +		{ "devid-from-signature",
> +				no_argument,		NULL,	OPT_VBT_DEVID },
>  		{ "all-panels",	no_argument,		NULL,	OPT_ALL_PANELS },
>  		{ "hexdump",	no_argument,		NULL,	OPT_HEXDUMP },
>  		{ "block",	required_argument,	NULL,	OPT_BLOCK },
> @@ -4207,6 +4236,9 @@ int main(int argc, char **argv)
>  		case OPT_PANEL_EDID2:
>  			panel_edid2 = optarg;
>  			break;
> +		case OPT_VBT_DEVID:
> +			context.devid_from_signature = true;
> +			break;
>  		case OPT_ALL_PANELS:
>  			context.dump_all_panel_types = true;
>  			break;
> @@ -4313,6 +4345,8 @@ int main(int argc, char **argv)
>  	context.bdb = (const struct bdb_header *)(VBIOS + bdb_off);
>  	context.size = size;
>  
> +	if (!context.devid && context.devid_from_signature)
> +		context.devid = get_devid_from_signature((char *) vbt->signature);

This should be last. The priority should be:

	1. command-line, if set
	2. environment variable, if set
	3. VBIOS, if available
	4. deduce from signature, if requested

Come to think of it, not sure about the "if requested". Maybe just use
it if not otherwise specified. This is userspace decoding, not kernel,
after all.

Ville, thoughts?

>  	if (!context.devid) {
>  		const char *devid_string = getenv("DEVICE");
>  		if (devid_string) {
> @@ -4326,7 +4360,7 @@ int main(int argc, char **argv)
>  	if (!context.devid)
>  		context.devid = get_device_id(VBIOS, size);
>  	if (!context.devid)
> -		fprintf(stderr, "Warning: could not find PCI device ID!\n");
> +		fprintf(stderr, "Warning: could not find PCI device ID! Use --devid or --devid-from-signature\n");
>  
>  	if (context.panel_type == -1)
>  		context.panel_type = get_panel_type(&context, false);

-- 
Jani Nikula, Intel

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

* Re: [PATCH i-g-t v2 5/8] tools/vbt_decode: guess devid from VBT signature
  2026-06-10 14:42   ` Jani Nikula
@ 2026-06-10 15:13     ` Ville Syrjälä
  2026-06-11  9:58       ` Jani Nikula
  0 siblings, 1 reply; 17+ messages in thread
From: Ville Syrjälä @ 2026-06-10 15:13 UTC (permalink / raw)
  To: Jani Nikula; +Cc: Michał Grzelak, igt-dev, suraj.kandpal

On Wed, Jun 10, 2026 at 05:42:58PM +0300, Jani Nikula wrote:
> On Mon, 08 Jun 2026, Michał Grzelak <michal.grzelak@intel.com> wrote:
> > Nowadays Device ID needs to be passed to decode VBT precisely. VBT lacks
> > it since VBT has been moved from PCI ROM into opregion.
> >
> > However we can narrow from which platform VBT originated basing on VBT
> > signature.
> >
> > Add a command-line option to guess devid using VBT signature. Create an
> > array of signatures and check if any of those is a substring of
> > signature extracted from given VBT. Map each signature into first Device
> > ID of a platform picked from include/drm/intel/pciids.h. Log that devid
> > has not been matched if signature is not found.
> >
> > Note that the platform-specific name should appear after "$VBT ", hence
> > the match.
> >
> > Suggested-by: Jani Nikula <jani.nikula@intel.com>
> > Signed-off-by: Michał Grzelak <michal.grzelak@intel.com>
> > ---
> >  tools/intel_vbt_decode.c | 36 +++++++++++++++++++++++++++++++++++-
> >  1 file changed, 35 insertions(+), 1 deletion(-)
> >
> > diff --git a/tools/intel_vbt_decode.c b/tools/intel_vbt_decode.c
> > index 5681643f4b..ec82b00939 100644
> > --- a/tools/intel_vbt_decode.c
> > +++ b/tools/intel_vbt_decode.c
> > @@ -77,6 +77,7 @@ struct context {
> >  	uint32_t devid;
> >  	int panel_type, panel_type2;
> >  	int sdvo_panel_type;
> > +	bool devid_from_signature;
> >  	bool dump_all_panel_types;
> >  	bool hexdump;
> >  };
> > @@ -3693,6 +3694,31 @@ static int get_sdvo_panel_type(struct context *context)
> >  	return panel_type;
> >  }
> >  
> > +static int
> > +get_devid_from_signature(const char *vbt_signature)
> > +{
> > +	int i;
> > +
> > +	const char *signature[] = {"PANTHERLAKE",
> > +				   "LUNARLAKE",
> > +				   "METEORLAKE",
> > +				   "JASPERLAKE",

That's a somewhat weird selection of platforms.

> > +				   NULL};
> > +
> > +	int devid[] = {0xB080, /* PTL */
> > +		       0x6420, /* LNL */
> > +		       0x7D40, /* MTL */
> > +		       0x4E51, /* JSL */
> > +		       0x0};
> 
> Please use a struct, something along the lines of:
> 
> 	static const struct {
> 		const char *signature;
> 		uint16_t devid;
> 	} devids[] = {
> 		{ .signature = "PANTHERLAKE", .devid = 0xb080, },
> 		...
> 	};
> 
> Then you can also ditch the /* PTL */ etc. comments.
> 
> > +
> > +	for (i = 0; signature[i]; i++)
> > +		if (strstr(vbt_signature, signature[i]))
> > +			return devid[i];
> > +
> > +	fprintf(stderr, "Warning: cannot find devid for signature %s\n", vbt_signature);
> 
> This should be a fallback, please don't warn anything here. Only one
> warning for the whole devid thing.
> 
> > +	return 0;
> > +}
> > +
> >  static int
> >  get_device_id(unsigned char *bios, int size)
> >  {
> > @@ -4108,6 +4134,7 @@ enum opt {
> >  	OPT_PANEL_TYPE2,
> >  	OPT_PANEL_EDID,
> >  	OPT_PANEL_EDID2,
> > +	OPT_VBT_DEVID,
> >  	OPT_ALL_PANELS,
> >  	OPT_HEXDUMP,
> >  	OPT_BLOCK,
> > @@ -4162,6 +4189,8 @@ int main(int argc, char **argv)
> >  		{ "panel-edid",	required_argument,	NULL,	OPT_PANEL_EDID },
> >  		{ "panel-type2",	required_argument,	NULL,	OPT_PANEL_TYPE2 },
> >  		{ "panel-edid2",	required_argument,	NULL,	OPT_PANEL_EDID2 },
> > +		{ "devid-from-signature",
> > +				no_argument,		NULL,	OPT_VBT_DEVID },
> >  		{ "all-panels",	no_argument,		NULL,	OPT_ALL_PANELS },
> >  		{ "hexdump",	no_argument,		NULL,	OPT_HEXDUMP },
> >  		{ "block",	required_argument,	NULL,	OPT_BLOCK },
> > @@ -4207,6 +4236,9 @@ int main(int argc, char **argv)
> >  		case OPT_PANEL_EDID2:
> >  			panel_edid2 = optarg;
> >  			break;
> > +		case OPT_VBT_DEVID:
> > +			context.devid_from_signature = true;
> > +			break;
> >  		case OPT_ALL_PANELS:
> >  			context.dump_all_panel_types = true;
> >  			break;
> > @@ -4313,6 +4345,8 @@ int main(int argc, char **argv)
> >  	context.bdb = (const struct bdb_header *)(VBIOS + bdb_off);
> >  	context.size = size;
> >  
> > +	if (!context.devid && context.devid_from_signature)
> > +		context.devid = get_devid_from_signature((char *) vbt->signature);
> 
> This should be last. The priority should be:
> 
> 	1. command-line, if set
> 	2. environment variable, if set
> 	3. VBIOS, if available
> 	4. deduce from signature, if requested
> 
> Come to think of it, not sure about the "if requested". Maybe just use
> it if not otherwise specified. This is userspace decoding, not kernel,
> after all.
> 
> Ville, thoughts?

Yeah, could probably just take the fallback when we don't know
any better.

But I'm thinking we should just add the devid to the VBT dump produced
by the kernel. Would avoid having to guess, especially since vendors
have been known to sometime reuse older VBTs across platforms. Perhaps
just prepend the VBT image with a PCIR structure which can then be
parsed by the code in get_device_id().

> 
> >  	if (!context.devid) {
> >  		const char *devid_string = getenv("DEVICE");
> >  		if (devid_string) {
> > @@ -4326,7 +4360,7 @@ int main(int argc, char **argv)
> >  	if (!context.devid)
> >  		context.devid = get_device_id(VBIOS, size);
> >  	if (!context.devid)
> > -		fprintf(stderr, "Warning: could not find PCI device ID!\n");
> > +		fprintf(stderr, "Warning: could not find PCI device ID! Use --devid or --devid-from-signature\n");
> >  
> >  	if (context.panel_type == -1)
> >  		context.panel_type = get_panel_type(&context, false);
> 
> -- 
> Jani Nikula, Intel

-- 
Ville Syrjälä
Intel

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

* Re: [PATCH i-g-t v2 3/8] tools/vbt_decode: return 0 from get_device_id()
  2026-06-08 12:41 ` [PATCH i-g-t v2 3/8] tools/vbt_decode: return 0 from get_device_id() Michał Grzelak
@ 2026-06-11  9:47   ` Jani Nikula
  0 siblings, 0 replies; 17+ messages in thread
From: Jani Nikula @ 2026-06-11  9:47 UTC (permalink / raw)
  To: Michał Grzelak, igt-dev; +Cc: suraj.kandpal, Michał Grzelak

On Mon, 08 Jun 2026, Michał Grzelak <michal.grzelak@intel.com> wrote:
> This function returns -1 on errors and the caller checks for 0. This
> leads to -1 being used as the device id. Return 0 instead of -1.
>
> Signed-off-by: Michał Grzelak <michal.grzelak@intel.com>

Reviewed-by: Jani Nikula <jani.nikula@intel.com>

> ---
>  tools/intel_vbt_decode.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/tools/intel_vbt_decode.c b/tools/intel_vbt_decode.c
> index 5b7a6a49e9..6a9c1de7b3 100644
> --- a/tools/intel_vbt_decode.c
> +++ b/tools/intel_vbt_decode.c
> @@ -3700,13 +3700,13 @@ get_device_id(unsigned char *bios, int size)
>      int offset = (bios[0x19] << 8) + bios[0x18];
>  
>      if (offset + 7 >= size)
> -	return -1;
> +	return 0;
>  
>      if (bios[offset] != 'P' ||
>  	bios[offset+1] != 'C' ||
>  	bios[offset+2] != 'I' ||
>  	bios[offset+3] != 'R')
> -	return -1;
> +	return 0;
>  
>      device = (bios[offset+7] << 8) + bios[offset+6];

-- 
Jani Nikula, Intel

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

* Re: [PATCH i-g-t v2 4/8] tools/vbt_decode: validate DEVICE env var
  2026-06-08 12:41 ` [PATCH i-g-t v2 4/8] tools/vbt_decode: validate DEVICE env var Michał Grzelak
@ 2026-06-11  9:51   ` Jani Nikula
  0 siblings, 0 replies; 17+ messages in thread
From: Jani Nikula @ 2026-06-11  9:51 UTC (permalink / raw)
  To: Michał Grzelak, igt-dev; +Cc: suraj.kandpal, Michał Grzelak

On Mon, 08 Jun 2026, Michał Grzelak <michal.grzelak@intel.com> wrote:
> On error, strotoul() returns converted value of longest substring
> spanning from beginning. Check if device ID input via DEVICE env var is
> valid. Log to the user if it is not and reset the devid.

The idea is good, nitpicks on the implementation.

>
> Signed-off-by: Michał Grzelak <michal.grzelak@intel.com>
> ---
>  tools/intel_vbt_decode.c | 9 +++++++--
>  1 file changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/tools/intel_vbt_decode.c b/tools/intel_vbt_decode.c
> index 6a9c1de7b3..5681643f4b 100644
> --- a/tools/intel_vbt_decode.c
> +++ b/tools/intel_vbt_decode.c
> @@ -4315,8 +4315,13 @@ int main(int argc, char **argv)
>  
>  	if (!context.devid) {
>  		const char *devid_string = getenv("DEVICE");
> -		if (devid_string)
> -			context.devid = strtoul(devid_string, NULL, 16);
> +		if (devid_string) {
> +			context.devid = strtoul(devid_string, &endp, 16);
> +			if (*endp) {

	if (!context.devid || *endp)

> +				fprintf(stderr, "invalid devid: %s\n", endp);

This should print the whole devid_string, not endp. Most places also
have single quotes around %s for this kind of stuff.

Maybe this should also say where the invalid devid originates from?
invalid devid in DEVICE environment variable?

> +				context.devid = 0;

I think just return EXIT_FAILURE; here. No need to proceed.

> +			}
> +		}
>  	}
>  	if (!context.devid)
>  		context.devid = get_device_id(VBIOS, size);

-- 
Jani Nikula, Intel

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

* Re: [PATCH i-g-t v2 5/8] tools/vbt_decode: guess devid from VBT signature
  2026-06-10 15:13     ` Ville Syrjälä
@ 2026-06-11  9:58       ` Jani Nikula
  0 siblings, 0 replies; 17+ messages in thread
From: Jani Nikula @ 2026-06-11  9:58 UTC (permalink / raw)
  To: Ville Syrjälä; +Cc: Michał Grzelak, igt-dev, suraj.kandpal

On Wed, 10 Jun 2026, Ville Syrjälä <ville.syrjala@linux.intel.com> wrote:
> On Wed, Jun 10, 2026 at 05:42:58PM +0300, Jani Nikula wrote:
>> On Mon, 08 Jun 2026, Michał Grzelak <michal.grzelak@intel.com> wrote:
>> > Nowadays Device ID needs to be passed to decode VBT precisely. VBT lacks
>> > it since VBT has been moved from PCI ROM into opregion.
>> >
>> > However we can narrow from which platform VBT originated basing on VBT
>> > signature.
>> >
>> > Add a command-line option to guess devid using VBT signature. Create an
>> > array of signatures and check if any of those is a substring of
>> > signature extracted from given VBT. Map each signature into first Device
>> > ID of a platform picked from include/drm/intel/pciids.h. Log that devid
>> > has not been matched if signature is not found.
>> >
>> > Note that the platform-specific name should appear after "$VBT ", hence
>> > the match.
>> >
>> > Suggested-by: Jani Nikula <jani.nikula@intel.com>
>> > Signed-off-by: Michał Grzelak <michal.grzelak@intel.com>
>> > ---
>> >  tools/intel_vbt_decode.c | 36 +++++++++++++++++++++++++++++++++++-
>> >  1 file changed, 35 insertions(+), 1 deletion(-)
>> >
>> > diff --git a/tools/intel_vbt_decode.c b/tools/intel_vbt_decode.c
>> > index 5681643f4b..ec82b00939 100644
>> > --- a/tools/intel_vbt_decode.c
>> > +++ b/tools/intel_vbt_decode.c
>> > @@ -77,6 +77,7 @@ struct context {
>> >  	uint32_t devid;
>> >  	int panel_type, panel_type2;
>> >  	int sdvo_panel_type;
>> > +	bool devid_from_signature;
>> >  	bool dump_all_panel_types;
>> >  	bool hexdump;
>> >  };
>> > @@ -3693,6 +3694,31 @@ static int get_sdvo_panel_type(struct context *context)
>> >  	return panel_type;
>> >  }
>> >  
>> > +static int
>> > +get_devid_from_signature(const char *vbt_signature)
>> > +{
>> > +	int i;
>> > +
>> > +	const char *signature[] = {"PANTHERLAKE",
>> > +				   "LUNARLAKE",
>> > +				   "METEORLAKE",
>> > +				   "JASPERLAKE",
>
> That's a somewhat weird selection of platforms.

Come to think of it, I wonder how hard and/or useful it would be to add
some fuzzy lookup into intel_device_info.c based on the signature. It
would bypass the need to add anything here.

>
>> > +				   NULL};
>> > +
>> > +	int devid[] = {0xB080, /* PTL */
>> > +		       0x6420, /* LNL */
>> > +		       0x7D40, /* MTL */
>> > +		       0x4E51, /* JSL */
>> > +		       0x0};
>> 
>> Please use a struct, something along the lines of:
>> 
>> 	static const struct {
>> 		const char *signature;
>> 		uint16_t devid;
>> 	} devids[] = {
>> 		{ .signature = "PANTHERLAKE", .devid = 0xb080, },
>> 		...
>> 	};
>> 
>> Then you can also ditch the /* PTL */ etc. comments.
>> 
>> > +
>> > +	for (i = 0; signature[i]; i++)
>> > +		if (strstr(vbt_signature, signature[i]))
>> > +			return devid[i];
>> > +
>> > +	fprintf(stderr, "Warning: cannot find devid for signature %s\n", vbt_signature);
>> 
>> This should be a fallback, please don't warn anything here. Only one
>> warning for the whole devid thing.
>> 
>> > +	return 0;
>> > +}
>> > +
>> >  static int
>> >  get_device_id(unsigned char *bios, int size)
>> >  {
>> > @@ -4108,6 +4134,7 @@ enum opt {
>> >  	OPT_PANEL_TYPE2,
>> >  	OPT_PANEL_EDID,
>> >  	OPT_PANEL_EDID2,
>> > +	OPT_VBT_DEVID,
>> >  	OPT_ALL_PANELS,
>> >  	OPT_HEXDUMP,
>> >  	OPT_BLOCK,
>> > @@ -4162,6 +4189,8 @@ int main(int argc, char **argv)
>> >  		{ "panel-edid",	required_argument,	NULL,	OPT_PANEL_EDID },
>> >  		{ "panel-type2",	required_argument,	NULL,	OPT_PANEL_TYPE2 },
>> >  		{ "panel-edid2",	required_argument,	NULL,	OPT_PANEL_EDID2 },
>> > +		{ "devid-from-signature",
>> > +				no_argument,		NULL,	OPT_VBT_DEVID },
>> >  		{ "all-panels",	no_argument,		NULL,	OPT_ALL_PANELS },
>> >  		{ "hexdump",	no_argument,		NULL,	OPT_HEXDUMP },
>> >  		{ "block",	required_argument,	NULL,	OPT_BLOCK },
>> > @@ -4207,6 +4236,9 @@ int main(int argc, char **argv)
>> >  		case OPT_PANEL_EDID2:
>> >  			panel_edid2 = optarg;
>> >  			break;
>> > +		case OPT_VBT_DEVID:
>> > +			context.devid_from_signature = true;
>> > +			break;
>> >  		case OPT_ALL_PANELS:
>> >  			context.dump_all_panel_types = true;
>> >  			break;
>> > @@ -4313,6 +4345,8 @@ int main(int argc, char **argv)
>> >  	context.bdb = (const struct bdb_header *)(VBIOS + bdb_off);
>> >  	context.size = size;
>> >  
>> > +	if (!context.devid && context.devid_from_signature)
>> > +		context.devid = get_devid_from_signature((char *) vbt->signature);
>> 
>> This should be last. The priority should be:
>> 
>> 	1. command-line, if set
>> 	2. environment variable, if set
>> 	3. VBIOS, if available
>> 	4. deduce from signature, if requested
>> 
>> Come to think of it, not sure about the "if requested". Maybe just use
>> it if not otherwise specified. This is userspace decoding, not kernel,
>> after all.
>> 
>> Ville, thoughts?
>
> Yeah, could probably just take the fallback when we don't know
> any better.
>
> But I'm thinking we should just add the devid to the VBT dump produced
> by the kernel. Would avoid having to guess, especially since vendors
> have been known to sometime reuse older VBTs across platforms. Perhaps
> just prepend the VBT image with a PCIR structure which can then be
> parsed by the code in get_device_id().

Maybe should've thought of that when we added i915_vbt... I wonder
what's going to break if we do this?

Anyway, even if we added it, not all VBTs are going to have it. I think
the idea behind the patch at hand is sound, and it should be added as a
fallback. The kernel part can be added separately, and if we follow the
order outlined above, it'll take precedence over the guesses here.

BR,
Jani.


>
>> 
>> >  	if (!context.devid) {
>> >  		const char *devid_string = getenv("DEVICE");
>> >  		if (devid_string) {
>> > @@ -4326,7 +4360,7 @@ int main(int argc, char **argv)
>> >  	if (!context.devid)
>> >  		context.devid = get_device_id(VBIOS, size);
>> >  	if (!context.devid)
>> > -		fprintf(stderr, "Warning: could not find PCI device ID!\n");
>> > +		fprintf(stderr, "Warning: could not find PCI device ID! Use --devid or --devid-from-signature\n");
>> >  
>> >  	if (context.panel_type == -1)
>> >  		context.panel_type = get_panel_type(&context, false);
>> 
>> -- 
>> Jani Nikula, Intel

-- 
Jani Nikula, Intel

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

end of thread, other threads:[~2026-06-11  9:59 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-08 12:41 [PATCH i-g-t v2 0/8] Vswing / Pre-emphasis Override decoding Michał Grzelak
2026-06-08 12:41 ` [PATCH i-g-t v2 1/8] tools/vbt_decode: fix tables' offset reading Michał Grzelak
2026-06-08 12:41 ` [PATCH i-g-t v2 2/8] tools/vbt_decode: rename VBT#57 related vars Michał Grzelak
2026-06-08 12:41 ` [PATCH i-g-t v2 3/8] tools/vbt_decode: return 0 from get_device_id() Michał Grzelak
2026-06-11  9:47   ` Jani Nikula
2026-06-08 12:41 ` [PATCH i-g-t v2 4/8] tools/vbt_decode: validate DEVICE env var Michał Grzelak
2026-06-11  9:51   ` Jani Nikula
2026-06-08 12:41 ` [PATCH i-g-t v2 5/8] tools/vbt_decode: guess devid from VBT signature Michał Grzelak
2026-06-10 14:42   ` Jani Nikula
2026-06-10 15:13     ` Ville Syrjälä
2026-06-11  9:58       ` Jani Nikula
2026-06-08 12:41 ` [PATCH i-g-t v2 6/8] tools/vbt_decode: parse & dump VS/PE-O tables for LT Michał Grzelak
2026-06-08 12:41 ` [PATCH i-g-t v2 7/8] tools/vbt_decode: parse & dump VS/PE-O tables for Snps Michał Grzelak
2026-06-08 12:41 ` [PATCH i-g-t v2 8/8] tools/vbt_decode: parse & dump VS/PE-O tables for Combo Michał Grzelak
2026-06-09  0:04 ` ✓ Xe.CI.BAT: success for Vswing / Pre-emphasis Override decoding Patchwork
2026-06-09  0:18 ` ✓ i915.CI.BAT: " Patchwork
2026-06-09  5:04 ` ✗ Xe.CI.FULL: failure " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox