public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Simon Ser <simon.ser@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: martin.peres@intel.com
Subject: [igt-dev] [PATCH i-g-t 2/3] lib/igt_edid: add support for Speaker Allocation Data blocks
Date: Mon, 27 May 2019 15:03:06 +0300	[thread overview]
Message-ID: <20190527120307.14354-3-simon.ser@intel.com> (raw)
In-Reply-To: <20190527120307.14354-1-simon.ser@intel.com>

Speaker Allocation Data blocks describe which speakers are present in the
display device.

This block is required to make DisplayPort audio work.

Signed-off-by: Simon Ser <simon.ser@intel.com>
---
 lib/igt_edid.c | 12 ++++++++++++
 lib/igt_edid.h | 18 ++++++++++++++++++
 2 files changed, 30 insertions(+)

diff --git a/lib/igt_edid.c b/lib/igt_edid.c
index fbdb0c06b8d7..e71136f48e14 100644
--- a/lib/igt_edid.c
+++ b/lib/igt_edid.c
@@ -348,6 +348,18 @@ size_t edid_cea_data_block_set_vsd(struct edid_cea_data_block *block,
 	return sizeof(struct edid_cea_data_block) + vsd_size;
 }
 
+size_t edid_cea_data_block_set_speaker_alloc(struct edid_cea_data_block *block,
+					     const struct cea_speaker_alloc *speakers)
+{
+	size_t size;
+
+	size = sizeof(struct cea_speaker_alloc);
+	edid_cea_data_block_init(block, EDID_CEA_DATA_SPEAKER_ALLOC, size);
+	memcpy(block->data.speakers, speakers, size);
+
+	return sizeof(struct edid_cea_data_block) + size;
+}
+
 void edid_ext_set_cea(struct edid_ext *ext, size_t data_blocks_size,
 		      uint8_t flags)
 {
diff --git a/lib/igt_edid.h b/lib/igt_edid.h
index 7edd7e38f41e..39d1842d32df 100644
--- a/lib/igt_edid.h
+++ b/lib/igt_edid.h
@@ -195,6 +195,21 @@ struct cea_vsd {
 	char data[];
 };
 
+enum cea_speaker_alloc_item {
+	CEA_SPEAKER_FRONT_LEFT_RIGHT = 1 << 0,
+	CEA_SPEAKER_LFE = 1 << 1,
+	CEA_SPEAKER_FRONT_CENTER = 1 << 2,
+	CEA_SPEAKER_REAR_LEFT_RIGHT = 1 << 3,
+	CEA_SPEAKER_REAR_CENTER = 1 << 4,
+	CEA_SPEAKER_FRONT_LEFT_RIGHT_CENTER = 1 << 5,
+	CEA_SPEAKER_REAR_LEFT_RIGHT_CENTER = 1 << 6,
+};
+
+struct cea_speaker_alloc {
+	uint8_t speakers; /* enum cea_speaker_alloc_item */
+	uint8_t reserved[2];
+} __attribute__((packed));
+
 enum edid_cea_data_type {
 	EDID_CEA_DATA_AUDIO = 1,
 	EDID_CEA_DATA_VIDEO = 2,
@@ -207,6 +222,7 @@ struct edid_cea_data_block {
 	union {
 		struct cea_sad sads[0];
 		struct cea_vsd vsds[0];
+		struct cea_speaker_alloc speakers[0];
 	} data;
 } __attribute__((packed));
 
@@ -295,6 +311,8 @@ 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);
+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,
 		      uint8_t flags);
 
-- 
2.21.0

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

  parent reply	other threads:[~2019-05-27 12:03 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-27 12:03 [igt-dev] [PATCH i-g-t 0/3] Unify HDMI audio EDID generation Simon Ser
2019-05-27 12:03 ` [igt-dev] [PATCH i-g-t 1/3] lib/tests/igt_edid: introduce EDID sanity checks Simon Ser
2019-06-03 13:11   ` Martin Peres
2019-05-27 12:03 ` Simon Ser [this message]
2019-06-03 13:13   ` [igt-dev] [PATCH i-g-t 2/3] lib/igt_edid: add support for Speaker Allocation Data blocks Martin Peres
2019-06-03 13:28     ` Ser, Simon
2019-06-03 13:34       ` Martin Peres
2019-05-27 12:03 ` [igt-dev] [PATCH i-g-t 3/3] lib/igt_kms: introduce igt_kms_get_hdmi_audio_edid Simon Ser
2019-06-03 13:18   ` Martin Peres
2019-05-27 12:57 ` [igt-dev] ✓ Fi.CI.BAT: success for Unify HDMI audio EDID generation Patchwork
2019-05-27 23:35 ` [igt-dev] ✓ Fi.CI.IGT: " 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=20190527120307.14354-3-simon.ser@intel.com \
    --to=simon.ser@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=martin.peres@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