[Intel-gfx] [PATCH i-g-t 2/2] tools/intel_vbt_decode: Decode HDMI max data rate

Ville Syrjala ville.syrjala at linux.intel.com
Mon Oct 30 14:58:30 UTC 2017


From: Ville Syrjälä <ville.syrjala at linux.intel.com>

Decode the HDMI max data rate from the VBT.

Cc: Jani Nikula <jani.nikula at intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
---
 tools/intel_vbt_decode.c | 22 +++++++++++++++++++++-
 tools/intel_vbt_defs.h   |  4 ++++
 2 files changed, 25 insertions(+), 1 deletion(-)

diff --git a/tools/intel_vbt_decode.c b/tools/intel_vbt_decode.c
index 9d90c69dbc9c..93a090f73d54 100644
--- a/tools/intel_vbt_decode.c
+++ b/tools/intel_vbt_decode.c
@@ -398,6 +398,26 @@ static const char *mipi_bridge_type(uint8_t type)
 	}
 }
 
+static void dump_hmdi_max_data_rate(uint8_t hdmi_max_data_rate)
+{
+	static const uint16_t max_data_rate[] = {
+		[HDMI_MAX_DATA_RATE_PLATFORM] = 0,
+		[HDMI_MAX_DATA_RATE_297] = 297,
+		[HDMI_MAX_DATA_RATE_165] = 165,
+	};
+
+	if (hdmi_max_data_rate >= ARRAY_SIZE(max_data_rate))
+		printf("\t\tHDMI max data rate: <unknown> (0x%02x)\n",
+		       hdmi_max_data_rate);
+	else if (hdmi_max_data_rate == HDMI_MAX_DATA_RATE_PLATFORM)
+		printf("\t\tHDMI max data rate: <platform max> (0x%02x)\n",
+		       hdmi_max_data_rate);
+	else
+		printf("\t\tHDMI max data rate: %d MHz (0x%02x)\n",
+		       max_data_rate[hdmi_max_data_rate],
+		       hdmi_max_data_rate);
+}
+
 static void dump_child_device(struct context *context,
 			      const struct child_device_config *child)
 {
@@ -418,7 +438,7 @@ static void dump_child_device(struct context *context,
 		printf("\t\tDP onboard redriver: 0x%02x\n", child->dp_onboard_redriver);
 		printf("\t\tDP ondock redriver: 0x%02x\n", child->dp_ondock_redriver);
 		printf("\t\tHDMI level shifter value: 0x%02x\n", child->hdmi_level_shifter_value);
-		printf("\t\tHDMI max data rate: 0x%02x\n", child->hdmi_max_data_rate);
+		dump_hmdi_max_data_rate(child->hdmi_max_data_rate);
 		printf("\t\tOffset to DTD buffer for edidless CHILD: 0x%02x\n", child->dtd_buf_ptr);
 		printf("\t\tEdidless EFP: %s\n", YESNO(child->edidless_efp));
 		printf("\t\tCompression enable: %s\n", YESNO(child->compression_enable));
diff --git a/tools/intel_vbt_defs.h b/tools/intel_vbt_defs.h
index 3c3c421e2e43..e3d7745a9151 100644
--- a/tools/intel_vbt_defs.h
+++ b/tools/intel_vbt_defs.h
@@ -304,6 +304,10 @@ struct bdb_general_features {
 #define DVO_PORT_MIPIC		23				/* 171 */
 #define DVO_PORT_MIPID		24				/* 171 */
 
+#define HDMI_MAX_DATA_RATE_PLATFORM	0			/* 204 */
+#define HDMI_MAX_DATA_RATE_297		1			/* 204 */
+#define HDMI_MAX_DATA_RATE_165		2			/* 204 */
+
 #define LEGACY_CHILD_DEVICE_CONFIG_SIZE		33
 
 /* DDC Bus DDI Type 155+ */
-- 
2.13.6



More information about the Intel-gfx mailing list