summaryrefslogtreecommitdiff
path: root/lib/igt_edid.h
diff options
context:
space:
mode:
authorSimon Ser <simon.ser@intel.com>2019-07-02 11:26:21 +0300
committerSimon Ser <simon.ser@intel.com>2019-07-05 16:06:40 +0300
commit4a8461f0bea8edbaa9f18a6e554dd36be7bdb3ee (patch)
treeb92b58fa5d0aedc7a3495ff93e29d19e9aa79c4b /lib/igt_edid.h
parent80538412017a23465e817edf78f71557ef566983 (diff)
lib/igt_edid: add hdmi_vsdb
The HDMI Vendor-Specific Data Block, defined as an opaque blob in the EDID spec, is described in the HDMI 1.4 spec. Most of the extension fields are optional, so it doesn't translate well to a C struct. For now callers need to manually fill the hdmi_vsdb.data field. Signed-off-by: Simon Ser <simon.ser@intel.com> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Diffstat (limited to 'lib/igt_edid.h')
-rw-r--r--lib/igt_edid.h50
1 files changed, 47 insertions, 3 deletions
diff --git a/lib/igt_edid.h b/lib/igt_edid.h
index 6fcb50a3..7907baee 100644
--- a/lib/igt_edid.h
+++ b/lib/igt_edid.h
@@ -191,11 +191,52 @@ struct cea_sad {
uint8_t bitrate;
} __attribute__((packed));
+enum hdmi_vsdb_flags1 {
+ HDMI_VSDB_DVI_DUAL = 1 << 0,
+ HDMI_VSDB_DC_Y444 = 1 << 3, /* supports YCbCr 4:4:4 */
+ HDMI_VSDB_DC_30BIT = 1 << 4, /* 30 bits per pixel */
+ HDMI_VSDB_DC_36BIT = 1 << 5, /* 36 bits per pixel */
+ HDMI_VSDB_DC_48BIT = 1 << 6, /* 48 bits per pixel */
+ HDMI_VSDB_SUPPORTS_AI = 1 << 7, /* supports ACP, ISRC1 or ISRC2 packets */
+};
+
+enum hdmi_vsdb_flags2 {
+ HDMI_VSDB_CNC_GRAPHICS = 1 << 0,
+ HDMI_VSDB_CNC_PHOTO = 1 << 1,
+ HDMI_VSDB_CNC_CINEMA = 1 << 2,
+ HDMI_VSDB_CNC_GAME = 1 << 3,
+ HDMI_VSDB_VIDEO_PRESENT = 1 << 5,
+ HDMI_VSDB_INTERLACED_LATENCY_PRESENT = 1 << 6,
+ HDMI_VSDB_LATENCY_PRESENT = 1 << 7,
+};
+
+/* HDMI's IEEE Registration Identifier */
+extern const uint8_t hdmi_ieee_oui[3];
+
+/* HDMI Vendor-Specific Data Block (defined in the HDMI spec) */
+struct hdmi_vsdb {
+ uint8_t src_phy_addr[2]; /* source physical address */
+
+ /* Extension fields */
+ uint8_t flags1; /* enum hdmi_vsdb_flags1 */
+ uint8_t max_tdms_clock; /* multiply by 5MHz */
+ uint8_t flags2; /* enum hdmi_vsdb_flags2 */
+ char data[]; /* latency, misc, VIC, 3D */
+} __attribute__((packed));
+
+#define HDMI_VSDB_MIN_SIZE 2 /* just the source physical address */
+#define HDMI_VSDB_MAX_SIZE 28
+#define CEA_VSDB_HEADER_SIZE 3 /* IEEE OUI */
+#define CEA_VSDB_HDMI_MIN_SIZE (CEA_VSDB_HEADER_SIZE + HDMI_VSDB_MIN_SIZE)
+#define CEA_VSDB_HDMI_MAX_SIZE (CEA_VSDB_HEADER_SIZE + HDMI_VSDB_MAX_SIZE)
+
/* Vendor-Specific Data Block */
struct cea_vsdb {
- uint8_t ieee_oui[3];
- char data[];
-};
+ uint8_t ieee_oui[3]; /* 24-bit IEEE Registration Identifier, LSB */
+ union {
+ struct hdmi_vsdb hdmi;
+ } data;
+} __attribute__((packed));
enum cea_speaker_alloc_item {
CEA_SPEAKER_FRONT_LEFT_RIGHT = 1 << 0,
@@ -315,6 +356,9 @@ 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_vsdb(struct edid_cea_data_block *block,
const struct cea_vsdb *vsdb, size_t vsdb_size);
+size_t edid_cea_data_block_set_hdmi_vsdb(struct edid_cea_data_block *block,
+ const struct hdmi_vsdb *hdmi,
+ size_t hdmi_size);
size_t edid_cea_data_block_set_speaker_alloc(struct edid_cea_data_block *block,
const struct cea_speaker_alloc *speakers);
void edid_ext_set_cea(struct edid_ext *ext, size_t data_blocks_size,