Skip to contentSkip to conversation

video: Check EDID for HDMI connection

PATCH In review [email protected] 2 participants 4 messages Mar 26, 2014 – Apr 14, 2014 Framebuffer layer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 video: Check EDID for HDMI connection

From: David Ung <[email protected]>

Check EDID Vendor Specific Data Block bytes to see if the connection is HDMI and set FB_MISC_HDMI.

---
 drivers/video/fbmon.c | 9 ++++++++-
 include/linux/fb.h    | 1 +
 2 files changed, 9 insertions(+), 1 deletion(-)
drivers/video/fbmon.c +8 -1
index 6103fa6..3ac6367 100644
@@ -1012,13 +1012,20 @@ void fb_edid_add_monspecs(unsigned char *edid, struct fb_monspecs *specs)
 	while (pos < edid[2]) {
 		u8 len = edid[pos] & 0x1f, type = (edid[pos] >> 5) & 7;
 		pr_debug("Data block %u of %u bytes\n", type, len);
-		if (type = 2)
+		if (type = 2) {
 			for (i = pos; i < pos + len; i++) {
 				u8 idx = edid[pos + i] & 0x7f;
 				svd[svd_n++] = idx;
 				pr_debug("N%sative mode #%d\n",
 					 edid[pos + i] & 0x80 ? "" : "on-n", idx);
 			}
+		} else if (type = 3 && len >= 3) {
+			/* Check Vendor Specific Data Block.  For HDMI,
+			   it is always 00-0C-03 for HDMI Licensing, LLC. */
+			if (edid[pos + 1] = 3 && edid[pos + 2] = 0xc &&
+			    edid[pos + 3] = 0)
+				specs->misc |= FB_MISC_HDMI;
+		}
 		pos += len + 1;
 	}
 
include/linux/fb.h +1 -0
index d49c60f..427d49d 100644
@@ -47,6 +47,7 @@ struct device_node;
 
 #define FB_MISC_PRIM_COLOR	1
 #define FB_MISC_1ST_DETAIL	2	/* First Detailed Timing is preferred */
+#define FB_MISC_HDMI		4
 struct fb_chroma {
 	__u32 redx;	/* in fraction of 1024 */
 	__u32 greenx;
Signature · 9 lines
1.8.3.2


-----------------------------------------------------------------------------------
This email message is for the sole use of the intended recipient(s) and may contain
confidential information.  Any unauthorized review, use, disclosure or distribution
is prohibited.  If you are not the intended recipient, please contact the sender by
reply email and destroy all copies of the original message.
-----------------------------------------------------------------------------------
#1 lore raw

Hi,

Quoted 8 lines · On 27/03/14 00:35, [email protected] wrote:

From: David Ung <[email protected]>

Check EDID Vendor Specific Data Block bytes to see if the connection is HDMI and set FB_MISC_HDMI.

---

Patch looks fine, but how do you use the flag? Shouldn't things like detecting if the monitor supports audio be done with some more detailed bits in the EDID data (not that I remember much from the HDMI spec).

Tomi

#2 lore raw
In reply to [email protected]
Quoted 10 lines · Tomi Valkeinen

* PGP Signed by an unknown key

Hi,

Quoted 5 lines · On 27/03/14 00:35, [email protected] wrote:

From: David Ung <[email protected]>

Check EDID Vendor Specific Data Block bytes to see if the connection is HDMI and set FB_MISC_HDMI.

Quoted 7 lines
Quoted 3 lines

---

Patch looks fine, but how do you use the flag? Shouldn't things like detecting if the monitor supports audio be done with some more detailed bits in the EDID data (not that I remember much from the HDMI spec).

The Tegra HDMI driver uses FB_MISC_HDMI to select the type of connection it has hdmi/dvi and setup the avi info frames.
agree that we could use the EDID data to determine the audio format support and sampling rates, but currently that's not being used. I think determining the audio format and sample rate support could be added in a separate and future patch.

Quoted 7 lines

Tomi

* Unknown Key
* 0xBC961EF5

-----------------------------------------------------------------------------------
This email message is for the sole use of the intended recipient(s) and may contain confidential information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message.
-----------------------------------------------------------------------------------

#3 lore raw
In reply to [email protected]
Quoted 21 lines · Christopher Freeman
Quoted 10 lines · Tomi Valkeinen

* PGP Signed by an unknown key

Hi,

Quoted 5 lines · On 27/03/14 00:35, [email protected] wrote:

From: David Ung <[email protected]>

Check EDID Vendor Specific Data Block bytes to see if the connection is HDMI and set FB_MISC_HDMI.

Quoted 7 lines
Quoted 3 lines

---

Patch looks fine, but how do you use the flag? Shouldn't things like detecting if the monitor supports audio be done with some more detailed bits in the EDID data (not that I remember much from the HDMI spec).

Quoted 6 lines

The Tegra HDMI driver uses FB_MISC_HDMI to select the type of connection it has hdmi/dvi and setup the avi info frames.
agree that we could use the EDID data to determine the audio format support and sampling rates, but currently that's not being used. I think determining the audio format and sample rate support could be added in a separate and future patch.

Yep. I don't see any harm with the patch, even if it's not perfect =). So I'm queuing it for 3.16.

Tomi