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 6/7] tools/vbt_decode: parse & dump VS/PE-O tables for Combo
Date: Thu,  2 Jul 2026 20:26:18 +0200	[thread overview]
Message-ID: <20260702182619.3973788-7-michal.grzelak@intel.com> (raw)
In-Reply-To: <20260702182619.3973788-1-michal.grzelak@intel.com>

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.

v4->v5
- show all Combo's columns

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 | 53 ++++++++++++++++++++++++++++++++++++++++
 2 files changed, 55 insertions(+)

diff --git a/lib/intel_chipset.h b/lib/intel_chipset.h
index 1f02932e4a..bdeaf038b5 100644
--- a/lib/intel_chipset.h
+++ b/lib/intel_chipset.h
@@ -203,6 +203,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 8d54b113ad..f557d85e91 100644
--- a/tools/intel_vbt_decode.c
+++ b/tools/intel_vbt_decode.c
@@ -3483,6 +3483,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)
 {
@@ -3540,6 +3546,51 @@ static void dump_cx0_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+1, 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];
+			int rcomp_scalar = tables[offset + 5];
+			int rterm_select = tables[offset + 6];
+			int tap3_disable = tables[offset + 7];
+			int tap2_disable = tables[offset + 8];
+			int cursor_program = tables[offset + 9];
+			int coeff_polarity = tables[offset + 10];
+
+			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, ", dw4_post_cursor_1);
+			printf("rcomp_scalar: 0x%08x, ", rcomp_scalar);
+			printf("rterm_select: 0x%08x, ", rterm_select);
+			printf("tap3_disable: 0x%08x, ", tap3_disable);
+			printf("tap2_disable: 0x%08x, ", tap2_disable);
+			printf("cursor_program: 0x%08x, ", cursor_program);
+			printf("coeff_polarity: 0x%08x\n", coeff_polarity);
+
+			offset += vspeo->num_columns;
+		}
+	}
+}
+
 static int
 vswing_preemph_num_rows(int devid)
 {
@@ -3567,6 +3618,8 @@ static void dump_vswing_preemphasis(struct context *context,
 		   IS_LUNARLAKE(devid) ||
 		   IS_METEORLAKE(devid)) {
 		dump_cx0_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


  parent reply	other threads:[~2026-07-02 18:28 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 ` [PATCH i-g-t v5 4/7] tools/vbt_decode: parse & dump VS/PE-O tables for LT Michał Grzelak
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 ` Michał Grzelak [this message]
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-7-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