From 0d31a4da4f91b912a773ac19af6096aec23b5bd5 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Wed, 15 May 2019 10:29:16 +0300 Subject: lib/igt_edid: add support for Vendor Specific Data blocks For some reason HDMI audio won't work unless you cast a magic IEEE Registration Identifier alongside with its appropriate Components of Source Physical Address. The easiest way to do this is to capture a wild HDMI EDID, study it, and blindly copy bytes because you don't understand anything about their possible meaning (if any). This commit also changes the SAD API exposed by igt_edid, to allow for both a SAD block and a VSD block to be included in the same CEA block. Signed-off-by: Simon Ser Reviewed-by: Arkadiusz Hiler --- lib/igt_edid.h | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) (limited to 'lib/igt_edid.h') diff --git a/lib/igt_edid.h b/lib/igt_edid.h index 3668d733..7edd7e38 100644 --- a/lib/igt_edid.h +++ b/lib/igt_edid.h @@ -189,6 +189,12 @@ struct cea_sad { uint8_t bitrate; } __attribute__((packed)); +/* Vendor Specific Data */ +struct cea_vsd { + uint8_t ieee_oui[3]; + char data[]; +}; + enum edid_cea_data_type { EDID_CEA_DATA_AUDIO = 1, EDID_CEA_DATA_VIDEO = 2, @@ -200,9 +206,17 @@ struct edid_cea_data_block { uint8_t type_len; /* type is from enum edid_cea_data_type */ union { struct cea_sad sads[0]; + struct cea_vsd vsds[0]; } data; } __attribute__((packed)); +enum edid_cea_flag { + EDID_CEA_YCBCR422 = 1 << 4, + EDID_CEA_YCBCR444 = 1 << 5, + EDID_CEA_BASIC_AUDIO = 1 << 6, + EDID_CEA_UNDERSCAN = 1 << 7, +}; + struct edid_cea { uint8_t revision; uint8_t dtd_start; @@ -275,8 +289,13 @@ void detailed_timing_set_string(struct detailed_timing *dt, void cea_sad_init_pcm(struct cea_sad *sad, int channels, uint8_t sampling_rates, uint8_t sample_sizes); -void edid_ext_set_cea_sad(struct edid_ext *ext, const struct cea_sad *sads, - size_t sads_len); void edid_ext_update_cea_checksum(struct edid_ext *ext); +const struct cea_vsd *cea_vsd_get_hdmi_default(size_t *size); +size_t edid_cea_data_block_set_sad(struct edid_cea_data_block *block, + const struct cea_sad *sads, size_t sads_len); +size_t edid_cea_data_block_set_vsd(struct edid_cea_data_block *block, + const struct cea_vsd *vsd, size_t vsd_size); +void edid_ext_set_cea(struct edid_ext *ext, size_t data_blocks_size, + uint8_t flags); #endif -- cgit v1.2.3