Skip to contentSkip to conversation

drm/edid: Use struct cea_db when parsing HDMI VSDB

PATCH In review Joshua Peisach 3 participants 11 messages Jan 18 – Jan 22

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/edid: Use struct cea_db when parsing HDMI VSDB

drm_parse_hdmi_vsdb_video is one of the parsers that still do not use the cea_db struct, and currently passes a u8 pointer.

Set the correct struct type and update references to the data accordingly. This also makes the same change to drm_parse_hdmi_deep_color_info as necessary.

---
 drivers/gpu/drm/drm_edid.c | 26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)
drivers/gpu/drm/drm_edid.c +13 -13
index 26bb7710a..15bd99e65 100644
@@ -6290,7 +6290,7 @@ static void drm_parse_hdmi_forum_scds(struct drm_connector *connector,
 }
 
 static void drm_parse_hdmi_deep_color_info(struct drm_connector *connector,
-					   const u8 *hdmi)
+					   const struct cea_db *db)
 {
 	struct drm_display_info *info = &connector->display_info;
 	unsigned int dc_bpc = 0;
@@ -6298,24 +6298,24 @@ static void drm_parse_hdmi_deep_color_info(struct drm_connector *connector,
 	/* HDMI supports at least 8 bpc */
 	info->bpc = 8;
 
-	if (cea_db_payload_len(hdmi) < 6)
+	if (cea_db_payload_len(db) < 6)
 		return;
 
-	if (hdmi[6] & DRM_EDID_HDMI_DC_30) {
+	if (db->data[6] & DRM_EDID_HDMI_DC_30) {
 		dc_bpc = 10;
 		info->edid_hdmi_rgb444_dc_modes |= DRM_EDID_HDMI_DC_30;
 		drm_dbg_kms(connector->dev, "[CONNECTOR:%d:%s] HDMI sink does deep color 30.\n",
 			    connector->base.id, connector->name);
 	}
 
-	if (hdmi[6] & DRM_EDID_HDMI_DC_36) {
+	if (db->data[6] & DRM_EDID_HDMI_DC_36) {
 		dc_bpc = 12;
 		info->edid_hdmi_rgb444_dc_modes |= DRM_EDID_HDMI_DC_36;
 		drm_dbg_kms(connector->dev, "[CONNECTOR:%d:%s] HDMI sink does deep color 36.\n",
 			    connector->base.id, connector->name);
 	}
 
-	if (hdmi[6] & DRM_EDID_HDMI_DC_48) {
+	if (db->data[6] & DRM_EDID_HDMI_DC_48) {
 		dc_bpc = 16;
 		info->edid_hdmi_rgb444_dc_modes |= DRM_EDID_HDMI_DC_48;
 		drm_dbg_kms(connector->dev, "[CONNECTOR:%d:%s] HDMI sink does deep color 48.\n",
@@ -6333,7 +6333,7 @@ static void drm_parse_hdmi_deep_color_info(struct drm_connector *connector,
 	info->bpc = dc_bpc;
 
 	/* YCRCB444 is optional according to spec. */
-	if (hdmi[6] & DRM_EDID_HDMI_DC_Y444) {
+	if (db->data[6] & DRM_EDID_HDMI_DC_Y444) {
 		info->edid_hdmi_ycbcr444_dc_modes = info->edid_hdmi_rgb444_dc_modes;
 		drm_dbg_kms(connector->dev, "[CONNECTOR:%d:%s] HDMI sink does YCRCB444 in deep color.\n",
 			    connector->base.id, connector->name);
@@ -6343,7 +6343,7 @@ static void drm_parse_hdmi_deep_color_info(struct drm_connector *connector,
 	 * Spec says that if any deep color mode is supported at all,
 	 * then deep color 36 bit must be supported.
 	 */
-	if (!(hdmi[6] & DRM_EDID_HDMI_DC_36)) {
+	if (!(db->data[6] & DRM_EDID_HDMI_DC_36)) {
 		drm_dbg_kms(connector->dev, "[CONNECTOR:%d:%s] HDMI sink should do DC_36, but does not!\n",
 			    connector->base.id, connector->name);
 	}
@@ -6351,19 +6351,19 @@ static void drm_parse_hdmi_deep_color_info(struct drm_connector *connector,
 
 /* HDMI Vendor-Specific Data Block (HDMI VSDB, H14b-VSDB) */
 static void
-drm_parse_hdmi_vsdb_video(struct drm_connector *connector, const u8 *db)
+drm_parse_hdmi_vsdb_video(struct drm_connector *connector, const struct cea_db *db)
 {
 	struct drm_display_info *info = &connector->display_info;
 	u8 len = cea_db_payload_len(db);
 
 	info->is_hdmi = true;
 
-	info->source_physical_address = (db[4] << 8) | db[5];
+	info->source_physical_address = (db->data[4] << 8) | db->data[5];
 
 	if (len >= 6)
-		info->dvi_dual = db[6] & 1;
+		info->dvi_dual = db->data[6] & 1;
 	if (len >= 7)
-		info->max_tmds_clock = db[7] * 5000;
+		info->max_tmds_clock = db->data[7] * 5000;
 
 	/*
 	 * Try to infer whether the sink supports HDMI infoframes.
@@ -6371,7 +6371,7 @@ drm_parse_hdmi_vsdb_video(struct drm_connector *connector, const u8 *db)
 	 * HDMI infoframe support was first added in HDMI 1.4. Assume the sink
 	 * supports infoframes if HDMI_Video_present is set.
 	 */
-	if (len >= 8 && db[8] & BIT(5))
+	if (len >= 8 && db->data[8] & BIT(5))
 		info->has_hdmi_infoframe = true;
 
 	drm_dbg_kms(connector->dev, "[CONNECTOR:%d:%s] HDMI: DVI dual %d, max TMDS clock %d kHz\n",
@@ -6443,7 +6443,7 @@ static void drm_parse_cea_ext(struct drm_connector *connector,
 		const u8 *data = (const u8 *)db;
 
 		if (cea_db_is_hdmi_vsdb(db))
-			drm_parse_hdmi_vsdb_video(connector, data);
+			drm_parse_hdmi_vsdb_video(connector, db);
 		else if (cea_db_is_hdmi_forum_vsdb(db) ||
 			 cea_db_is_hdmi_forum_scdb(db))
 			drm_parse_hdmi_forum_scds(connector, data);
Signature · 1 line
2.51.0
#1 lore raw
Quoted 26 lines · Joshua Peisach

drm_parse_hdmi_vsdb_video is one of the parsers that still do not use the cea_db struct, and currently passes a u8 pointer.

Set the correct struct type and update references to the data accordingly. This also makes the same change to drm_parse_hdmi_deep_color_info as necessary.

---
 drivers/gpu/drm/drm_edid.c | 26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)
drivers/gpu/drm/drm_edid.c +1 -1
index 26bb7710a..15bd99e65 100644
@@ -6290,7 +6290,7 @@ static void drm_parse_hdmi_forum_scds(struct drm_connector *connector,
 }
 
 static void drm_parse_hdmi_deep_color_info(struct drm_connector *connector,
-					   const u8 *hdmi)
+					   const struct cea_db *db)
 {
 	struct drm_display_info *info = &connector->display_info;
 	unsigned int dc_bpc = 0;

drivers/gpu/drm/drm_edid.c static void drm_parse_hdmi_deep_color_info(struct drm_connector *connector, · line 6304

Quoted 9 lines
drivers/gpu/drm/drm_edid.c +2 -2
@@ -6298,24 +6298,24 @@ static void drm_parse_hdmi_deep_color_info(struct drm_connector *connector,
 	/* HDMI supports at least 8 bpc */
 	info->bpc = 8;
 
-	if (cea_db_payload_len(hdmi) < 6)
+	if (cea_db_payload_len(db) < 6)
 		return;
 
-	if (hdmi[6] & DRM_EDID_HDMI_DC_30) {
+	if (db->data[6] & DRM_EDID_HDMI_DC_30) {

That's not the same thing, but off-by-one now. Ditto everywhere that changes from u8* to db->data[].

The main problem with the change (even with fixed offsets) is that the *specs* typically use indexing from the beginning of the data block, not from the beginning of payload data.

We've discussed this before with Ville (Cc'd) but I'm not sure if we reached a conclusion.

BR,
Jani.

Quoted 79 lines
drivers/gpu/drm/drm_edid.c +10 -10
 		dc_bpc = 10;
 		info->edid_hdmi_rgb444_dc_modes |= DRM_EDID_HDMI_DC_30;
 		drm_dbg_kms(connector->dev, "[CONNECTOR:%d:%s] HDMI sink does deep color 30.\n",
 			    connector->base.id, connector->name);
 	}
 
-	if (hdmi[6] & DRM_EDID_HDMI_DC_36) {
+	if (db->data[6] & DRM_EDID_HDMI_DC_36) {
 		dc_bpc = 12;
 		info->edid_hdmi_rgb444_dc_modes |= DRM_EDID_HDMI_DC_36;
 		drm_dbg_kms(connector->dev, "[CONNECTOR:%d:%s] HDMI sink does deep color 36.\n",
 			    connector->base.id, connector->name);
 	}
 
-	if (hdmi[6] & DRM_EDID_HDMI_DC_48) {
+	if (db->data[6] & DRM_EDID_HDMI_DC_48) {
 		dc_bpc = 16;
 		info->edid_hdmi_rgb444_dc_modes |= DRM_EDID_HDMI_DC_48;
 		drm_dbg_kms(connector->dev, "[CONNECTOR:%d:%s] HDMI sink does deep color 48.\n",
@@ -6333,7 +6333,7 @@ static void drm_parse_hdmi_deep_color_info(struct drm_connector *connector,
 	info->bpc = dc_bpc;
 
 	/* YCRCB444 is optional according to spec. */
-	if (hdmi[6] & DRM_EDID_HDMI_DC_Y444) {
+	if (db->data[6] & DRM_EDID_HDMI_DC_Y444) {
 		info->edid_hdmi_ycbcr444_dc_modes = info->edid_hdmi_rgb444_dc_modes;
 		drm_dbg_kms(connector->dev, "[CONNECTOR:%d:%s] HDMI sink does YCRCB444 in deep color.\n",
 			    connector->base.id, connector->name);
@@ -6343,7 +6343,7 @@ static void drm_parse_hdmi_deep_color_info(struct drm_connector *connector,
 	 * Spec says that if any deep color mode is supported at all,
 	 * then deep color 36 bit must be supported.
 	 */
-	if (!(hdmi[6] & DRM_EDID_HDMI_DC_36)) {
+	if (!(db->data[6] & DRM_EDID_HDMI_DC_36)) {
 		drm_dbg_kms(connector->dev, "[CONNECTOR:%d:%s] HDMI sink should do DC_36, but does not!\n",
 			    connector->base.id, connector->name);
 	}
@@ -6351,19 +6351,19 @@ static void drm_parse_hdmi_deep_color_info(struct drm_connector *connector,
 
 /* HDMI Vendor-Specific Data Block (HDMI VSDB, H14b-VSDB) */
 static void
-drm_parse_hdmi_vsdb_video(struct drm_connector *connector, const u8 *db)
+drm_parse_hdmi_vsdb_video(struct drm_connector *connector, const struct cea_db *db)
 {
 	struct drm_display_info *info = &connector->display_info;
 	u8 len = cea_db_payload_len(db);
 
 	info->is_hdmi = true;
 
-	info->source_physical_address = (db[4] << 8) | db[5];
+	info->source_physical_address = (db->data[4] << 8) | db->data[5];
 
 	if (len >= 6)
-		info->dvi_dual = db[6] & 1;
+		info->dvi_dual = db->data[6] & 1;
 	if (len >= 7)
-		info->max_tmds_clock = db[7] * 5000;
+		info->max_tmds_clock = db->data[7] * 5000;
 
 	/*
 	 * Try to infer whether the sink supports HDMI infoframes.
@@ -6371,7 +6371,7 @@ drm_parse_hdmi_vsdb_video(struct drm_connector *connector, const u8 *db)
 	 * HDMI infoframe support was first added in HDMI 1.4. Assume the sink
 	 * supports infoframes if HDMI_Video_present is set.
 	 */
-	if (len >= 8 && db[8] & BIT(5))
+	if (len >= 8 && db->data[8] & BIT(5))
 		info->has_hdmi_infoframe = true;
 
 	drm_dbg_kms(connector->dev, "[CONNECTOR:%d:%s] HDMI: DVI dual %d, max TMDS clock %d kHz\n",
@@ -6443,7 +6443,7 @@ static void drm_parse_cea_ext(struct drm_connector *connector,
 		const u8 *data = (const u8 *)db;
 
 		if (cea_db_is_hdmi_vsdb(db))
-			drm_parse_hdmi_vsdb_video(connector, data);
+			drm_parse_hdmi_vsdb_video(connector, db);
 		else if (cea_db_is_hdmi_forum_vsdb(db) ||
 			 cea_db_is_hdmi_forum_scdb(db))
 			drm_parse_hdmi_forum_scds(connector, data);
Signature · 1 line
Jani Nikula, Intel
#2 lore raw
Quoted 44 lines · Jani Nikula
Quoted 26 lines · On Sat, 17 Jan 2026, Joshua Peisach <[email protected]…

drm_parse_hdmi_vsdb_video is one of the parsers that still do not use the cea_db struct, and currently passes a u8 pointer.

Set the correct struct type and update references to the data accordingly. This also makes the same change to drm_parse_hdmi_deep_color_info as necessary.

---
drivers/gpu/drm/drm_edid.c | 26 +++++++++++++-------------

1 file changed, 13 insertions(+), 13 deletions(-)
drivers/gpu/drm/drm_edid.c +1 -1
index 26bb7710a..15bd99e65 100644
@@ -6290,7 +6290,7 @@ static void drm_parse_hdmi_forum_scds(struct drm_connector *connector,
 }
 
 static void drm_parse_hdmi_deep_color_info(struct drm_connector *connector,
-					   const u8 *hdmi)
+					   const struct cea_db *db)
 {
 	struct drm_display_info *info = &connector->display_info;
 	unsigned int dc_bpc = 0;

drivers/gpu/drm/drm_edid.c static void drm_parse_hdmi_deep_color_info(struct drm_connector *connector, · line 6304

Quoted 9 lines
drivers/gpu/drm/drm_edid.c +2 -2
@@ -6298,24 +6298,24 @@ static void drm_parse_hdmi_deep_color_info(struct drm_connector *connector,
 	/* HDMI supports at least 8 bpc */
 	info->bpc = 8;
 
-	if (cea_db_payload_len(hdmi) < 6)
+	if (cea_db_payload_len(db) < 6)
 		return;
 
-	if (hdmi[6] & DRM_EDID_HDMI_DC_30) {
+	if (db->data[6] & DRM_EDID_HDMI_DC_30) {

That's not the same thing, but off-by-one now. Ditto everywhere that changes from u8* to db->data[].

Quoted 7 lines

The main problem with the change (even with fixed offsets) is that the *specs* typically use indexing from the beginning of the data block, not from the beginning of payload data.

We've discussed this before with Ville (Cc'd) but I'm not sure if we reached a conclusion.

Okay, I'll thought the pointer was to the literal same information.

Keep me posted about the indexing of the specs, I will probably submit a v2.

Thanks,
-Josh

Quoted 86 lines

BR,
Jani.

Quoted 79 lines
drivers/gpu/drm/drm_edid.c +4 -4
 		dc_bpc = 10;
 		info->edid_hdmi_rgb444_dc_modes |= DRM_EDID_HDMI_DC_30;
 		drm_dbg_kms(connector->dev, "[CONNECTOR:%d:%s] HDMI sink does deep color 30.\n",
 			    connector->base.id, connector->name);
 	}
 
-	if (hdmi[6] & DRM_EDID_HDMI_DC_36) {
+	if (db->data[6] & DRM_EDID_HDMI_DC_36) {
 		dc_bpc = 12;
 		info->edid_hdmi_rgb444_dc_modes |= DRM_EDID_HDMI_DC_36;
 		drm_dbg_kms(connector->dev, "[CONNECTOR:%d:%s] HDMI sink does deep color 36.\n",
 			    connector->base.id, connector->name);
 	}
 
-	if (hdmi[6] & DRM_EDID_HDMI_DC_48) {
+	if (db->data[6] & DRM_EDID_HDMI_DC_48) {
 		dc_bpc = 16;
 		info->edid_hdmi_rgb444_dc_modes |= DRM_EDID_HDMI_DC_48;
 		drm_dbg_kms(connector->dev, "[CONNECTOR:%d:%s] HDMI sink does deep color 48.\n",
@@ -6333,7 +6333,7 @@ static void drm_parse_hdmi_deep_color_info(struct drm_connector *connector,
 	info->bpc = dc_bpc;
 
 	/* YCRCB444 is optional according to spec. */
-	if (hdmi[6] & DRM_EDID_HDMI_DC_Y444) {
+	if (db->data[6] & DRM_EDID_HDMI_DC_Y444) {
 		info->edid_hdmi_ycbcr444_dc_modes = info->edid_hdmi_rgb444_dc_modes;
 		drm_dbg_kms(connector->dev, "[CONNECTOR:%d:%s] HDMI sink does YCRCB444 in deep color.\n",
 			    connector->base.id, connector->name);
@@ -6343,7 +6343,7 @@ static void drm_parse_hdmi_deep_color_info(struct drm_connector *connector,
 	 * Spec says that if any deep color mode is supported at all,
 	 * then deep color 36 bit must be supported.
 	 */
-	if (!(hdmi[6] & DRM_EDID_HDMI_DC_36)) {
+	if (!(db->data[6] & DRM_EDID_HDMI_DC_36)) {
 		drm_dbg_kms(connector->dev, "[CONNECTOR:%d:%s] HDMI sink should do DC_36, but does not!\n",
 			    connector->base.id, connector->name);
 	}
@@ -6351,19 +6351,19 @@ static void drm_parse_hdmi_deep_color_info(struct drm_connector *connector,
 
 /* HDMI Vendor-Specific Data Block (HDMI VSDB, H14b-VSDB) */

static void

drivers/gpu/drm/drm_edid.c +1 -1
-drm_parse_hdmi_vsdb_video(struct drm_connector *connector, const u8 *db)
+drm_parse_hdmi_vsdb_video(struct drm_connector *connector, const struct cea_db *db)
{
	struct drm_display_info *info = &connector->display_info;
	u8 len = cea_db_payload_len(db);

	info->is_hdmi = true;
drivers/gpu/drm/drm_edid.c +1 -1
-	info->source_physical_address = (db[4] << 8) | db[5];
+	info->source_physical_address = (db->data[4] << 8) | db->data[5];
	if (len >= 6)
drivers/gpu/drm/drm_edid.c +1 -1
-		info->dvi_dual = db[6] & 1;
+		info->dvi_dual = db->data[6] & 1;
	if (len >= 7)
drivers/gpu/drm/drm_edid.c +1 -1
-		info->max_tmds_clock = db[7] * 5000;
+		info->max_tmds_clock = db->data[7] * 5000;
	/*
	 * Try to infer whether the sink supports HDMI infoframes.
drivers/gpu/drm/drm_edid.c +2 -2
@@ -6371,7 +6371,7 @@ drm_parse_hdmi_vsdb_video(struct drm_connector *connector, const u8 *db)
 	 * HDMI infoframe support was first added in HDMI 1.4. Assume the sink
 	 * supports infoframes if HDMI_Video_present is set.
 	 */
-	if (len >= 8 && db[8] & BIT(5))
+	if (len >= 8 && db->data[8] & BIT(5))
 		info->has_hdmi_infoframe = true;
 
 	drm_dbg_kms(connector->dev, "[CONNECTOR:%d:%s] HDMI: DVI dual %d, max TMDS clock %d kHz\n",
@@ -6443,7 +6443,7 @@ static void drm_parse_cea_ext(struct drm_connector *connector,
 		const u8 *data = (const u8 *)db;
 
 		if (cea_db_is_hdmi_vsdb(db))
-			drm_parse_hdmi_vsdb_video(connector, data);
+			drm_parse_hdmi_vsdb_video(connector, db);
 		else if (cea_db_is_hdmi_forum_vsdb(db) ||
 			 cea_db_is_hdmi_forum_scdb(db))
 			drm_parse_hdmi_forum_scds(connector, data);
Signature · 1 line
Jani Nikula, Intel
#3 lore raw
In reply to Jani Nikula
Quoted 40 lines · Jani Nikula
Quoted 26 lines · Joshua Peisach

drm_parse_hdmi_vsdb_video is one of the parsers that still do not use the cea_db struct, and currently passes a u8 pointer.

Set the correct struct type and update references to the data accordingly. This also makes the same change to drm_parse_hdmi_deep_color_info as necessary.

---
 drivers/gpu/drm/drm_edid.c | 26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)
drivers/gpu/drm/drm_edid.c +1 -1
index 26bb7710a..15bd99e65 100644
@@ -6290,7 +6290,7 @@ static void drm_parse_hdmi_forum_scds(struct drm_connector *connector,
 }
 
 static void drm_parse_hdmi_deep_color_info(struct drm_connector *connector,
-					   const u8 *hdmi)
+					   const struct cea_db *db)
 {
 	struct drm_display_info *info = &connector->display_info;
 	unsigned int dc_bpc = 0;

drivers/gpu/drm/drm_edid.c static void drm_parse_hdmi_deep_color_info(struct drm_connector *connector, · line 6304

Quoted 9 lines
drivers/gpu/drm/drm_edid.c +2 -2
@@ -6298,24 +6298,24 @@ static void drm_parse_hdmi_deep_color_info(struct drm_connector *connector,
 	/* HDMI supports at least 8 bpc */
 	info->bpc = 8;
 
-	if (cea_db_payload_len(hdmi) < 6)
+	if (cea_db_payload_len(db) < 6)
 		return;
 
-	if (hdmi[6] & DRM_EDID_HDMI_DC_30) {
+	if (db->data[6] & DRM_EDID_HDMI_DC_30) {

That's not the same thing, but off-by-one now. Ditto everywhere that changes from u8* to db->data[].

Quoted 6 lines

The main problem with the change (even with fixed offsets) is that the *specs* typically use indexing from the beginning of the data block, not from the beginning of payload data.

We've discussed this before with Ville (Cc'd) but I'm not sure if we reached a conclusion.

I guess we could give up on the index matching the spec byte#. Looks like the HDMI VSDB parsing is the only place where we actually have the two match, and everwhere else it's already inconsistent.

Also maybe we should add something to also exclude the extended tag from the payload, for the blocks that use the extended tag...

Signature · 2 lines
Ville Syrjälä
Intel
#4 lore raw
Quoted 52 lines · Ville Syrjälä
Quoted 40 lines · Jani Nikula
Quoted 26 lines · Joshua Peisach

drm_parse_hdmi_vsdb_video is one of the parsers that still do not use the cea_db struct, and currently passes a u8 pointer.

Set the correct struct type and update references to the data accordingly. This also makes the same change to drm_parse_hdmi_deep_color_info as necessary.

---
drivers/gpu/drm/drm_edid.c | 26 +++++++++++++-------------

1 file changed, 13 insertions(+), 13 deletions(-)
drivers/gpu/drm/drm_edid.c +1 -1
index 26bb7710a..15bd99e65 100644
@@ -6290,7 +6290,7 @@ static void drm_parse_hdmi_forum_scds(struct drm_connector *connector,
 }
 
 static void drm_parse_hdmi_deep_color_info(struct drm_connector *connector,
-					   const u8 *hdmi)
+					   const struct cea_db *db)
 {
 	struct drm_display_info *info = &connector->display_info;
 	unsigned int dc_bpc = 0;

drivers/gpu/drm/drm_edid.c static void drm_parse_hdmi_deep_color_info(struct drm_connector *connector, · line 6304

Quoted 9 lines
drivers/gpu/drm/drm_edid.c +2 -2
@@ -6298,24 +6298,24 @@ static void drm_parse_hdmi_deep_color_info(struct drm_connector *connector,
 	/* HDMI supports at least 8 bpc */
 	info->bpc = 8;
 
-	if (cea_db_payload_len(hdmi) < 6)
+	if (cea_db_payload_len(db) < 6)
 		return;
 
-	if (hdmi[6] & DRM_EDID_HDMI_DC_30) {
+	if (db->data[6] & DRM_EDID_HDMI_DC_30) {

That's not the same thing, but off-by-one now. Ditto everywhere that changes from u8* to db->data[].

Quoted 6 lines

The main problem with the change (even with fixed offsets) is that the *specs* typically use indexing from the beginning of the data block, not from the beginning of payload data.

We've discussed this before with Ville (Cc'd) but I'm not sure if we reached a conclusion.

Quoted 12 lines

I guess we could give up on the index matching the spec byte#. Looks like the HDMI VSDB parsing is the only place where we actually have the two match, and everwhere else it's already inconsistent.

Also maybe we should add something to also exclude the extended tag from the payload, for the blocks that use the extended tag...

Signature · 2 lines
Ville Syrjälä
Intel

I personally believe it is important to match the spec for consistency and reference. Unless I am looking at the wrong thing, bit 6 should have the correct index.

Also I think cea_db in the context of the function calls here are just the data blocks. Unless you mean that by having the struct's first member being the tag_length if offsetting everything, but I don't think it is? Let me know if I'm wrong :)

-Josh

#5 lore raw
Quoted 65 lines · On Tue, Jan 20, 2026 at 11:37:59AM -0500, [email protected] wrote:
Quoted 52 lines · Ville Syrjälä
Quoted 40 lines · Jani Nikula
Quoted 26 lines · Joshua Peisach

drm_parse_hdmi_vsdb_video is one of the parsers that still do not use the cea_db struct, and currently passes a u8 pointer.

Set the correct struct type and update references to the data accordingly. This also makes the same change to drm_parse_hdmi_deep_color_info as necessary.

---
drivers/gpu/drm/drm_edid.c | 26 +++++++++++++-------------

1 file changed, 13 insertions(+), 13 deletions(-)
drivers/gpu/drm/drm_edid.c +1 -1
index 26bb7710a..15bd99e65 100644
@@ -6290,7 +6290,7 @@ static void drm_parse_hdmi_forum_scds(struct drm_connector *connector,
 }
 
 static void drm_parse_hdmi_deep_color_info(struct drm_connector *connector,
-					   const u8 *hdmi)
+					   const struct cea_db *db)
 {
 	struct drm_display_info *info = &connector->display_info;
 	unsigned int dc_bpc = 0;

drivers/gpu/drm/drm_edid.c static void drm_parse_hdmi_deep_color_info(struct drm_connector *connector, · line 6304

Quoted 9 lines
drivers/gpu/drm/drm_edid.c +2 -2
@@ -6298,24 +6298,24 @@ static void drm_parse_hdmi_deep_color_info(struct drm_connector *connector,
 	/* HDMI supports at least 8 bpc */
 	info->bpc = 8;
 
-	if (cea_db_payload_len(hdmi) < 6)
+	if (cea_db_payload_len(db) < 6)
 		return;
 
-	if (hdmi[6] & DRM_EDID_HDMI_DC_30) {
+	if (db->data[6] & DRM_EDID_HDMI_DC_30) {

That's not the same thing, but off-by-one now. Ditto everywhere that changes from u8* to db->data[].

Quoted 6 lines

The main problem with the change (even with fixed offsets) is that the *specs* typically use indexing from the beginning of the data block, not from the beginning of payload data.

We've discussed this before with Ville (Cc'd) but I'm not sure if we reached a conclusion.

Quoted 12 lines

I guess we could give up on the index matching the spec byte#. Looks like the HDMI VSDB parsing is the only place where we actually have the two match, and everwhere else it's already inconsistent.

Also maybe we should add something to also exclude the extended tag from the payload, for the blocks that use the extended tag...

Signature · 2 lines
Ville Syrjälä
Intel
Quoted 8 lines

I personally believe it is important to match the spec for consistency and reference. Unless I am looking at the wrong thing, bit 6 should have the correct index.

Also I think cea_db in the context of the function calls here are just the data blocks. Unless you mean that by having the struct's first member being the tag_length if offsetting everything, but I don't think it is? Let me know if I'm wrong :)

The tag+length byte is:
byte# 1 in the CTA spec
byte# 0 in the HDMI spec

There's no super nice way to use the byte# as the index for both. Also the length checks end up looking somewhat confusing when comparing them with the corresponding index.

Signature · 2 lines
Ville Syrjälä
Intel
#6 lore raw
Quoted 79 lines · Ville Syrjälä
Quoted 65 lines · On Tue, Jan 20, 2026 at 11:37:59AM -0500, [email protected]…
Quoted 52 lines · Ville Syrjälä
Quoted 40 lines · Jani Nikula
Quoted 26 lines · Joshua Peisach

drm_parse_hdmi_vsdb_video is one of the parsers that still do not use the cea_db struct, and currently passes a u8 pointer.

Set the correct struct type and update references to the data accordingly. This also makes the same change to drm_parse_hdmi_deep_color_info as necessary.

---
drivers/gpu/drm/drm_edid.c | 26 +++++++++++++-------------

1 file changed, 13 insertions(+), 13 deletions(-)
drivers/gpu/drm/drm_edid.c +1 -1
index 26bb7710a..15bd99e65 100644
@@ -6290,7 +6290,7 @@ static void drm_parse_hdmi_forum_scds(struct drm_connector *connector,
 }
 
 static void drm_parse_hdmi_deep_color_info(struct drm_connector *connector,
-					   const u8 *hdmi)
+					   const struct cea_db *db)
 {
 	struct drm_display_info *info = &connector->display_info;
 	unsigned int dc_bpc = 0;

drivers/gpu/drm/drm_edid.c static void drm_parse_hdmi_deep_color_info(struct drm_connector *connector, · line 6304

Quoted 9 lines
drivers/gpu/drm/drm_edid.c +2 -2
@@ -6298,24 +6298,24 @@ static void drm_parse_hdmi_deep_color_info(struct drm_connector *connector,
 	/* HDMI supports at least 8 bpc */
 	info->bpc = 8;
 
-	if (cea_db_payload_len(hdmi) < 6)
+	if (cea_db_payload_len(db) < 6)
 		return;
 
-	if (hdmi[6] & DRM_EDID_HDMI_DC_30) {
+	if (db->data[6] & DRM_EDID_HDMI_DC_30) {

That's not the same thing, but off-by-one now. Ditto everywhere that changes from u8* to db->data[].

Quoted 6 lines

The main problem with the change (even with fixed offsets) is that the *specs* typically use indexing from the beginning of the data block, not from the beginning of payload data.

We've discussed this before with Ville (Cc'd) but I'm not sure if we reached a conclusion.

Quoted 12 lines

I guess we could give up on the index matching the spec byte#. Looks like the HDMI VSDB parsing is the only place where we actually have the two match, and everwhere else it's already inconsistent.

Also maybe we should add something to also exclude the extended tag from the payload, for the blocks that use the extended tag...

Signature · 2 lines
Ville Syrjälä
Intel
Quoted 8 lines

I personally believe it is important to match the spec for consistency and reference. Unless I am looking at the wrong thing, bit 6 should have the correct index.

Also I think cea_db in the context of the function calls here are just the data blocks. Unless you mean that by having the struct's first member being the tag_length if offsetting everything, but I don't think it is? Let me know if I'm wrong :)

Quoted 11 lines

The tag+length byte is:
byte# 1 in the CTA spec
byte# 0 in the HDMI spec

There's no super nice way to use the byte# as the index for both. Also the length checks end up looking somewhat confusing when comparing them with the corresponding index.

Signature · 2 lines
Ville Syrjälä
Intel

The name of the functions specifically say HDMI, so I think that's the system to use: there are functions that say CTA in the name, like parse_cta_y420cmdb - so that is CTA, and these functions follow HDMI.

Maybe in a v2 patch, drop a comment clarifying this? At the top of the drm_parse_hdmi_vsdb_video function it does say HDMI.

-Josh

#7 lore raw
Quoted 87 lines · On Tue, Jan 20, 2026 at 12:46:59PM -0500, [email protected] wrote:
Quoted 87 lines · Ville Syrjälä
Quoted 65 lines · On Tue, Jan 20, 2026 at 11:37:59AM -0500, [email protected]…
Quoted 52 lines · Ville Syrjälä
Quoted 40 lines · Jani Nikula
Quoted 26 lines · Joshua Peisach

drm_parse_hdmi_vsdb_video is one of the parsers that still do not use the cea_db struct, and currently passes a u8 pointer.

Set the correct struct type and update references to the data accordingly. This also makes the same change to drm_parse_hdmi_deep_color_info as necessary.

---
drivers/gpu/drm/drm_edid.c | 26 +++++++++++++-------------

1 file changed, 13 insertions(+), 13 deletions(-)
drivers/gpu/drm/drm_edid.c +1 -1
index 26bb7710a..15bd99e65 100644
@@ -6290,7 +6290,7 @@ static void drm_parse_hdmi_forum_scds(struct drm_connector *connector,
 }
 
 static void drm_parse_hdmi_deep_color_info(struct drm_connector *connector,
-					   const u8 *hdmi)
+					   const struct cea_db *db)
 {
 	struct drm_display_info *info = &connector->display_info;
 	unsigned int dc_bpc = 0;

drivers/gpu/drm/drm_edid.c static void drm_parse_hdmi_deep_color_info(struct drm_connector *connector, · line 6304

Quoted 9 lines
drivers/gpu/drm/drm_edid.c +2 -2
@@ -6298,24 +6298,24 @@ static void drm_parse_hdmi_deep_color_info(struct drm_connector *connector,
 	/* HDMI supports at least 8 bpc */
 	info->bpc = 8;
 
-	if (cea_db_payload_len(hdmi) < 6)
+	if (cea_db_payload_len(db) < 6)
 		return;
 
-	if (hdmi[6] & DRM_EDID_HDMI_DC_30) {
+	if (db->data[6] & DRM_EDID_HDMI_DC_30) {

That's not the same thing, but off-by-one now. Ditto everywhere that changes from u8* to db->data[].

Quoted 6 lines

The main problem with the change (even with fixed offsets) is that the *specs* typically use indexing from the beginning of the data block, not from the beginning of payload data.

We've discussed this before with Ville (Cc'd) but I'm not sure if we reached a conclusion.

Quoted 12 lines

I guess we could give up on the index matching the spec byte#. Looks like the HDMI VSDB parsing is the only place where we actually have the two match, and everwhere else it's already inconsistent.

Also maybe we should add something to also exclude the extended tag from the payload, for the blocks that use the extended tag...

Signature · 2 lines
Ville Syrjälä
Intel
Quoted 8 lines

I personally believe it is important to match the spec for consistency and reference. Unless I am looking at the wrong thing, bit 6 should have the correct index.

Also I think cea_db in the context of the function calls here are just the data blocks. Unless you mean that by having the struct's first member being the tag_length if offsetting everything, but I don't think it is? Let me know if I'm wrong :)

The tag+length byte is:
byte# 1 in the CTA spec
byte# 0 in the HDMI spec

There's no super nice way to use the byte# as the index for both. Also the length checks end up looking somewhat confusing when comparing them with the corresponding index.

Quoted 7 lines
Quoted 3 lines
Signature · 2 lines
Ville Syrjälä
Intel

The name of the functions specifically say HDMI, so I think that's the system to use: there are functions that say CTA in the name, like parse_cta_y420cmdb - so that is CTA, and these functions follow HDMI.

I'm saying that there is no really sane way to deal with the CTA byte# convention. So I think it's probably best to just go for a single consistent approach for both CTA and HDMI. That way people at least won't get confused by the different convetion between the functions. And the length checks wouldn't look incorrect.

Another option might be to add some kind of hdmi_db_byte() and cta_db_byte() helpers and use those instead of the bare index. But the length checks would still look off, unless we also hide those in some kind of helpers. Not sure what those would look like though. Also some blocks can eg. contain multiple descriptors of some size, and for those the spec defines the byte# relative to the individual descriptor rather than the whole block.

Signature · 2 lines
Ville Syrjälä
Intel
#8 lore raw
Quoted 100 lines · Ville Syrjälä
Quoted 87 lines · On Tue, Jan 20, 2026 at 12:46:59PM -0500, [email protected]…
Quoted 87 lines · On Jan 20, 2026, at 12:03 PM, Ville Syrjälä <[email protected]…
Quoted 65 lines · On Tue, Jan 20, 2026 at 11:37:59AM -0500, [email protected]…
Quoted 52 lines · Ville Syrjälä
Quoted 40 lines · Jani Nikula
Quoted 26 lines · Joshua Peisach

drm_parse_hdmi_vsdb_video is one of the parsers that still do not use the cea_db struct, and currently passes a u8 pointer.

Set the correct struct type and update references to the data accordingly. This also makes the same change to drm_parse_hdmi_deep_color_info as necessary.

---
drivers/gpu/drm/drm_edid.c | 26 +++++++++++++-------------

1 file changed, 13 insertions(+), 13 deletions(-)
drivers/gpu/drm/drm_edid.c +1 -1
index 26bb7710a..15bd99e65 100644
@@ -6290,7 +6290,7 @@ static void drm_parse_hdmi_forum_scds(struct drm_connector *connector,
 }
 
 static void drm_parse_hdmi_deep_color_info(struct drm_connector *connector,
-					   const u8 *hdmi)
+					   const struct cea_db *db)
 {
 	struct drm_display_info *info = &connector->display_info;
 	unsigned int dc_bpc = 0;

drivers/gpu/drm/drm_edid.c static void drm_parse_hdmi_deep_color_info(struct drm_connector *connector, · line 6304

Quoted 9 lines
drivers/gpu/drm/drm_edid.c +2 -2
@@ -6298,24 +6298,24 @@ static void drm_parse_hdmi_deep_color_info(struct drm_connector *connector,
 	/* HDMI supports at least 8 bpc */
 	info->bpc = 8;
 
-	if (cea_db_payload_len(hdmi) < 6)
+	if (cea_db_payload_len(db) < 6)
 		return;
 
-	if (hdmi[6] & DRM_EDID_HDMI_DC_30) {
+	if (db->data[6] & DRM_EDID_HDMI_DC_30) {

That's not the same thing, but off-by-one now. Ditto everywhere that changes from u8* to db->data[].

Quoted 6 lines

The main problem with the change (even with fixed offsets) is that the *specs* typically use indexing from the beginning of the data block, not from the beginning of payload data.

We've discussed this before with Ville (Cc'd) but I'm not sure if we reached a conclusion.

Quoted 12 lines

I guess we could give up on the index matching the spec byte#. Looks like the HDMI VSDB parsing is the only place where we actually have the two match, and everwhere else it's already inconsistent.

Also maybe we should add something to also exclude the extended tag from the payload, for the blocks that use the extended tag...

Signature · 2 lines
Ville Syrjälä
Intel
Quoted 8 lines

I personally believe it is important to match the spec for consistency and reference. Unless I am looking at the wrong thing, bit 6 should have the correct index.

Also I think cea_db in the context of the function calls here are just the data blocks. Unless you mean that by having the struct's first member being the tag_length if offsetting everything, but I don't think it is? Let me know if I'm wrong :)

The tag+length byte is:
byte# 1 in the CTA spec
byte# 0 in the HDMI spec

There's no super nice way to use the byte# as the index for both. Also the length checks end up looking somewhat confusing when comparing them with the corresponding index.

Quoted 7 lines
Quoted 3 lines
Signature · 2 lines
Ville Syrjälä
Intel

The name of the functions specifically say HDMI, so I think that's the system to use: there are functions that say CTA in the name, like parse_cta_y420cmdb - so that is CTA, and these functions follow HDMI.

Quoted 6 lines

I'm saying that there is no really sane way to deal with the CTA byte# convention. So I think it's probably best to just go for a single consistent approach for both CTA and HDMI. That way people at least won't get confused by the different convetion between the functions. And the length checks wouldn't look incorrect.

I agree. I can't think of anything though, other than to assume CTA.

The other parsers that already use struct cea_db refer to the data using the CTA spec (starting at 1). Maybe just go with that?

But yes, as Jani said, the db->data indexing is off by one. Is fixing that fine for a v2 patch or should I put this aside?

-Josh

Quoted 11 lines

Another option might be to add some kind of hdmi_db_byte() and cta_db_byte() helpers and use those instead of the bare index. But the length checks would still look off, unless we also hide those in some kind of helpers. Not sure what those would look like though. Also some blocks can eg. contain multiple descriptors of some size, and for those the spec defines the byte# relative to the individual descriptor rather than the whole block.

Signature · 2 lines
Ville Syrjälä
Intel
#9 lore raw
Quoted 107 lines · On Tue, Jan 20, 2026 at 03:01:14PM -0500, [email protected] wrote:
Quoted 100 lines · Ville Syrjälä
Quoted 87 lines · On Tue, Jan 20, 2026 at 12:46:59PM -0500, [email protected]…
Quoted 87 lines · On Jan 20, 2026, at 12:03 PM, Ville Syrjälä <[email protected]…
Quoted 65 lines · On Tue, Jan 20, 2026 at 11:37:59AM -0500, [email protected]…
Quoted 52 lines · Ville Syrjälä
Quoted 40 lines · Jani Nikula
Quoted 26 lines · Joshua Peisach

drm_parse_hdmi_vsdb_video is one of the parsers that still do not use the cea_db struct, and currently passes a u8 pointer.

Set the correct struct type and update references to the data accordingly. This also makes the same change to drm_parse_hdmi_deep_color_info as necessary.

---
drivers/gpu/drm/drm_edid.c | 26 +++++++++++++-------------

1 file changed, 13 insertions(+), 13 deletions(-)
drivers/gpu/drm/drm_edid.c +1 -1
index 26bb7710a..15bd99e65 100644
@@ -6290,7 +6290,7 @@ static void drm_parse_hdmi_forum_scds(struct drm_connector *connector,
 }
 
 static void drm_parse_hdmi_deep_color_info(struct drm_connector *connector,
-					   const u8 *hdmi)
+					   const struct cea_db *db)
 {
 	struct drm_display_info *info = &connector->display_info;
 	unsigned int dc_bpc = 0;

drivers/gpu/drm/drm_edid.c static void drm_parse_hdmi_deep_color_info(struct drm_connector *connector, · line 6304

Quoted 9 lines
drivers/gpu/drm/drm_edid.c +2 -2
@@ -6298,24 +6298,24 @@ static void drm_parse_hdmi_deep_color_info(struct drm_connector *connector,
 	/* HDMI supports at least 8 bpc */
 	info->bpc = 8;
 
-	if (cea_db_payload_len(hdmi) < 6)
+	if (cea_db_payload_len(db) < 6)
 		return;
 
-	if (hdmi[6] & DRM_EDID_HDMI_DC_30) {
+	if (db->data[6] & DRM_EDID_HDMI_DC_30) {

That's not the same thing, but off-by-one now. Ditto everywhere that changes from u8* to db->data[].

Quoted 6 lines

The main problem with the change (even with fixed offsets) is that the *specs* typically use indexing from the beginning of the data block, not from the beginning of payload data.

We've discussed this before with Ville (Cc'd) but I'm not sure if we reached a conclusion.

Quoted 12 lines

I guess we could give up on the index matching the spec byte#. Looks like the HDMI VSDB parsing is the only place where we actually have the two match, and everwhere else it's already inconsistent.

Also maybe we should add something to also exclude the extended tag from the payload, for the blocks that use the extended tag...

Signature · 2 lines
Ville Syrjälä
Intel
Quoted 8 lines

I personally believe it is important to match the spec for consistency and reference. Unless I am looking at the wrong thing, bit 6 should have the correct index.

Also I think cea_db in the context of the function calls here are just the data blocks. Unless you mean that by having the struct's first member being the tag_length if offsetting everything, but I don't think it is? Let me know if I'm wrong :)

The tag+length byte is:
byte# 1 in the CTA spec
byte# 0 in the HDMI spec

There's no super nice way to use the byte# as the index for both. Also the length checks end up looking somewhat confusing when comparing them with the corresponding index.

Quoted 7 lines
Quoted 3 lines
Signature · 2 lines
Ville Syrjälä
Intel

The name of the functions specifically say HDMI, so I think that's the system to use: there are functions that say CTA in the name, like parse_cta_y420cmdb - so that is CTA, and these functions follow HDMI.

Quoted 6 lines

I'm saying that there is no really sane way to deal with the CTA byte# convention. So I think it's probably best to just go for a single consistent approach for both CTA and HDMI. That way people at least won't get confused by the different convetion between the functions. And the length checks wouldn't look incorrect.

Quoted 4 lines

I agree. I can't think of anything though, other than to assume CTA.

The other parsers that already use struct cea_db refer to the data using the CTA spec (starting at 1). Maybe just go with that?

Nothing is indexed using the CTA byte#. To do that we'd have to do something like 'u8 *db = start_of_db - 1'.

I can more or less see these variants:
1. relative to the start of the data block
(eg. drm_parse_hdr_metadata_block(), drm_parse_vcdb())
2. relative to the start of the payload
(eg. parse_cta_vdb())
3. relative to the first byte past the extended tag (y420* stuff)

And I'm suggesting that perhaps everything should use either 2 or 3 depending on whether the extended tag is present.

Signature · 2 lines
Ville Syrjälä
Intel
#10 lore raw
Quoted 124 lines · Ville Syrjälä
Quoted 107 lines · On Tue, Jan 20, 2026 at 03:01:14PM -0500, [email protected] wrote:
Quoted 100 lines · Ville Syrjälä
Quoted 87 lines · On Tue, Jan 20, 2026 at 12:46:59PM -0500, [email protected]…
Quoted 87 lines · On Jan 20, 2026, at 12:03 PM, Ville Syrjälä <[email protected]…
Quoted 65 lines · On Tue, Jan 20, 2026 at 11:37:59AM -0500, [email protected]…
Quoted 52 lines · Ville Syrjälä
Quoted 40 lines · Jani Nikula
Quoted 26 lines · Joshua Peisach

drm_parse_hdmi_vsdb_video is one of the parsers that still do not use the cea_db struct, and currently passes a u8 pointer.

Set the correct struct type and update references to the data accordingly. This also makes the same change to drm_parse_hdmi_deep_color_info as necessary.

---
drivers/gpu/drm/drm_edid.c | 26 +++++++++++++-------------

1 file changed, 13 insertions(+), 13 deletions(-)
drivers/gpu/drm/drm_edid.c +1 -1
index 26bb7710a..15bd99e65 100644
@@ -6290,7 +6290,7 @@ static void drm_parse_hdmi_forum_scds(struct drm_connector *connector,
 }
 
 static void drm_parse_hdmi_deep_color_info(struct drm_connector *connector,
-					   const u8 *hdmi)
+					   const struct cea_db *db)
 {
 	struct drm_display_info *info = &connector->display_info;
 	unsigned int dc_bpc = 0;

drivers/gpu/drm/drm_edid.c static void drm_parse_hdmi_deep_color_info(struct drm_connector *connector, · line 6304

Quoted 9 lines
drivers/gpu/drm/drm_edid.c +2 -2
@@ -6298,24 +6298,24 @@ static void drm_parse_hdmi_deep_color_info(struct drm_connector *connector,
 	/* HDMI supports at least 8 bpc */
 	info->bpc = 8;
 
-	if (cea_db_payload_len(hdmi) < 6)
+	if (cea_db_payload_len(db) < 6)
 		return;
 
-	if (hdmi[6] & DRM_EDID_HDMI_DC_30) {
+	if (db->data[6] & DRM_EDID_HDMI_DC_30) {

That's not the same thing, but off-by-one now. Ditto everywhere that changes from u8* to db->data[].

Quoted 6 lines

The main problem with the change (even with fixed offsets) is that the *specs* typically use indexing from the beginning of the data block, not from the beginning of payload data.

We've discussed this before with Ville (Cc'd) but I'm not sure if we reached a conclusion.

Quoted 12 lines

I guess we could give up on the index matching the spec byte#. Looks like the HDMI VSDB parsing is the only place where we actually have the two match, and everwhere else it's already inconsistent.

Also maybe we should add something to also exclude the extended tag from the payload, for the blocks that use the extended tag...

Signature · 2 lines
Ville Syrjälä
Intel
Quoted 8 lines

I personally believe it is important to match the spec for consistency and reference. Unless I am looking at the wrong thing, bit 6 should have the correct index.

Also I think cea_db in the context of the function calls here are just the data blocks. Unless you mean that by having the struct's first member being the tag_length if offsetting everything, but I don't think it is? Let me know if I'm wrong :)

The tag+length byte is:
byte# 1 in the CTA spec
byte# 0 in the HDMI spec

There's no super nice way to use the byte# as the index for both. Also the length checks end up looking somewhat confusing when comparing them with the corresponding index.

Quoted 7 lines
Quoted 3 lines
Signature · 2 lines
Ville Syrjälä
Intel

The name of the functions specifically say HDMI, so I think that's the system to use: there are functions that say CTA in the name, like parse_cta_y420cmdb - so that is CTA, and these functions follow HDMI.

Quoted 6 lines

I'm saying that there is no really sane way to deal with the CTA byte# convention. So I think it's probably best to just go for a single consistent approach for both CTA and HDMI. That way people at least won't get confused by the different convetion between the functions. And the length checks wouldn't look incorrect.

Quoted 4 lines

I agree. I can't think of anything though, other than to assume CTA.

The other parsers that already use struct cea_db refer to the data using the CTA spec (starting at 1). Maybe just go with that?

Nothing is indexed using the CTA byte#. To do that we'd have to do something like 'u8 *db = start_of_db - 1'.

I can more or less see these variants:
1. relative to the start of the data block
(eg. drm_parse_hdr_metadata_block(), drm_parse_vcdb())
2. relative to the start of the payload
(eg. parse_cta_vdb())
3. relative to the first byte past the extended tag (y420* stuff)

Quoted 2 lines

And I'm suggesting that perhaps everything should use either 2 or 3 depending on whether the extended tag is present.

Makes sense to me.

However, as for "drm_parse_hdmi_vsdb_video", that is not specific to CTA. So I guess keep the function names and just correct the indexes?

--
Josh