Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Michał Grzelak" <michal.grzelak@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: jani.nikula@intel.com, suraj.kandpal@intel.com,
	"Michał Grzelak" <michal.grzelak@intel.com>
Subject: [PATCH i-g-t v5 4/7] tools/vbt_decode: parse & dump VS/PE-O tables for LT
Date: Thu,  2 Jul 2026 20:26:16 +0200	[thread overview]
Message-ID: <20260702182619.3973788-5-michal.grzelak@intel.com> (raw)
In-Reply-To: <20260702182619.3973788-1-michal.grzelak@intel.com>

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

Currently Vswing / Pre-emphasis Override is not supported by kernel on
LT, but it doesn't harm to add decoding into IGT.

v2->v3
- return 16 rows on MTL instead of 10

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 33f8598e5f..2f3f720573 100644
--- a/tools/intel_vbt_decode.c
+++ b/tools/intel_vbt_decode.c
@@ -3465,24 +3465,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+1, 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


  parent reply	other threads:[~2026-07-02 18:27 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-02 18:26 [PATCH i-g-t v5 0/7] Vswing / Pre-emphasis Override decoding Michał Grzelak
2026-07-02 18:26 ` [PATCH i-g-t v5 1/7] tools/vbt_decode: fix tables' offset reading Michał Grzelak
2026-07-02 18:26 ` [PATCH i-g-t v5 2/7] tools/vbt_decode: rename VBT#57 related vars Michał Grzelak
2026-07-02 18:26 ` [PATCH i-g-t v5 3/7] tools/vbt_decode: validate DEVICE env var Michał Grzelak
2026-07-02 18:26 ` Michał Grzelak [this message]
2026-07-02 18:26 ` [PATCH i-g-t v5 5/7] tools/vbt_decode: parse & dump VS/PE-O tables for Snps Michał Grzelak
2026-07-02 18:26 ` [PATCH i-g-t v5 6/7] tools/vbt_decode: parse & dump VS/PE-O tables for Combo Michał Grzelak
2026-07-02 18:26 ` [PATCH i-g-t v5 7/7] tools/vbt_decode: change VBT#57 Combo's layout Michał Grzelak
2026-07-02 20:42 ` ✓ Xe.CI.BAT: success for Vswing / Pre-emphasis Override decoding (rev4) Patchwork
2026-07-02 21:30 ` ✓ i915.CI.BAT: " Patchwork
2026-07-03 14:33 ` ✗ Xe.CI.FULL: failure " Patchwork
2026-07-03 17:44 ` ✗ i915.CI.Full: " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260702182619.3973788-5-michal.grzelak@intel.com \
    --to=michal.grzelak@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=jani.nikula@intel.com \
    --cc=suraj.kandpal@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox