In HDMI protocol, Extended Display Identification Data (EDID) is a data structure provided by a digital display to describe its capabilities to a video source (e.g. graphics card or set-top box).  The EDID includes manufacturer name and serial number, product type, phosphor or filter type, timings supported by the display, display size, luminance data and pixel mapping data.

For applications like HDMI CEC, it is required to know port number of HDMI port number of the TV/monitor connected. This post focus on how to get the HDMI port detail from the HDMI-EDID data. EDID structure versions range from v1.0 to v1.4; all these define upwards-compatible 128-byte structures. HDMI port information are avilabe in the EIA/CEA-861 extension block from Version 3 (from the −861B spec). This Version 3 includes four new optional types of data blocks: Video Data Blocks containing the aforementioned Short Video Descripter (SVD), Audio Data Blocks containing Short Audio Descriptors (SAD), Speaker Allocation Data Blocks containing information about the speaker configuration of the display device, and Vendor Specific Data Blocks which can contain information specific to a given vendor’s use.

The HDMI port information can be obtained from the“Vendor Specific data Blocks” as below.

A “Vendor Specific Data Block” (if any) contains as its first three bytes the vendor’s IEEE 24-bit registration number, LSB first. For HDMI, it is always 00-0C-03 for HDMI Licensing, LLC. It is followed by a two byte source physical address, LSB first. The source physical address provides the CEC physical address for upstream CEC devices

Below are few examples of EDID data and corresponding port number.

For Port ID 1 in SONY TV

edid[000] = 00 ff ff ff ff ff ff 00 4d d9 03 9d 01 01 01 01
edid[010] = 01 19 01 03 80 5f 36 78 0a 0d c9 a0 57 47 98 27
edid[020] = 12 48 4c 21 08 00 81 80 a9 c0 71 4f b3 00 01 01
edid[030] = 01 01 01 01 01 01 02 3a 80 18 71 38 2d 40 58 2c
edid[040] = 45 00 b8 17 32 00 00 1e 01 1d 00 72 51 d0 1e 20
edid[050] = 6e 28 55 00 b8 17 32 00 00 1e 00 00 00 fc 00 53
edid[060] = 4f 4e 59 20 54 56 20 20 2a 30 30 0a 00 00 00 fd
edid[070] = 00 30 3e 0e 46 0f 00 0a 20 20 20 20 20 20 01 b9
edid[080] = 02 03 3e f0 53 1f 10 14 05 13 04 20 22 3c 3e 12
edid[090] = 16 03 07 11 15 02 06 01 29 0d 7f 07 15 07 50 3d
edid[0a0] = 07 bc 83 0f 00 00 74 03 0c 00 10 00 b8 2d 2f d0
edid[0b0] = 0a 01 40 00 7f 20 30 70 80 90 76 e2 00 fb 02 3a
edid[0c0] = 80 d0 72 38 2d 40 10 2c 45 80 b8 17 32 00 00 1e

For Port ID 3 in SONY TV

edid[000] = 00 ff ff ff ff ff ff 00 4d d9 03 9d 01 01 01 01
edid[010] = 01 19 01 03 80 5f 36 78 0a 0d c9 a0 57 47 98 27
edid[020] = 12 48 4c 21 08 00 81 80 a9 c0 71 4f b3 00 01 01
edid[030] = 01 01 01 01 01 01 02 3a 80 18 71 38 2d 40 58 2c
edid[040] = 45 00 b8 17 32 00 00 1e 01 1d 00 72 51 d0 1e 20
edid[050] = 6e 28 55 00 b8 17 32 00 00 1e 00 00 00 fc 00 53
edid[060] = 4f 4e 59 20 54 56 20 20 2a 30 30 0a 00 00 00 fd
edid[070] = 00 30 3e 0e 46 0f 00 0a 20 20 20 20 20 20 01 b9
edid[080] = 02 03 3e f0 53 1f 10 14 05 13 04 20 22 3c 3e 12
edid[090] = 16 03 07 11 15 02 06 01 29 0d 7f 07 15 07 50 3d
edid[0a0] = 07 bc 83 0f 00 00 74 03 0c 00 30 00 b8 2d 2f d0
edid[0b0] = 0a 01 40 00 7f 20 30 70 80 90 76 e2 00 fb 02 3a
edid[0c0] = 80 d0 72 38 2d 40 10 2c 45 80 b8 17 32 00 00 1e

For Port ID 1 in Samsung Monitor

edid[000] = 00 ff ff ff ff ff ff 00 4c 2d 4e 0c 39 54 4d 30
edid[010] = 0f 1a 01 03 80 3d 23 78 2a 5f b1 a2 57 4f a2 28
edid[020] = 0f 50 54 bf ef 80 71 4f 81 00 81 c0 81 80 95 00
edid[030] = a9 c0 b3 00 01 01 04 74 00 30 f2 70 5a 80 b0 58
edid[040] = 8a 00 60 59 21 00 00 1e 00 00 00 fd 00 18 4b 1e
edid[050] = 5a 1e 00 0a 20 20 20 20 20 20 00 00 00 fc 00 55
edid[060] = 32 38 45 35 39 30 0a 20 20 20 20 20 00 00 00 ff
edid[070] = 00 48 54 50 48 34 30 30 30 33 38 0a 20 20 01 1e
edid[080] = 02 03 24 f0 49 5f 10 04 1f 13 03 12 20 22 23 09
edid[090] = 07 07 83 01 00 00 6d 03 0c 00 10 00 80 3c 20 10
edid[0a0] = 60 01 02 03 02 3a 80 18 71 38 2d 40 58 2c 45 00
edid[0b0] = 60 59 21 00 00 1e 02 3a 80 d0 72 38 2d 40 10 2c
edid[0c0] = 45 80 60 59 21 00 00 1e 01 1d 00 72 51 d0 1e 20
edid[0d0] = 6e 28 55 00 60 59 21 00 00 1e 56 5e 00 a0 a0 a0
edid[0e0] = 29 50 30 20 35 00 60 59 21 00 00 1a 00 00 00 00
edid[0f0] = 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 67

For Port ID 2 in Samsung Monitor

edid[000] = 00 ff ff ff ff ff ff 00 4c 2d 4e 0c 39 54 4d 30
edid[010] = 0f 1a 01 03 80 3d 23 78 2a 5f b1 a2 57 4f a2 28
edid[020] = 0f 50 54 bf ef 80 71 4f 81 00 81 c0 81 80 95 00
edid[030] = a9 c0 b3 00 01 01 08 e8 00 30 f2 70 5a 80 b0 58
edid[040] = 8a 00 60 59 21 00 00 1e 00 00 00 fd 00 18 4b 1e
edid[050] = 87 3c 00 0a 20 20 20 20 20 20 00 00 00 fc 00 55
edid[060] = 32 38 45 35 39 30 0a 20 20 20 20 20 00 00 00 ff
edid[070] = 00 48 54 50 48 34 30 30 30 33 38 0a 20 20 01 5d
edid[080] = 02 03 34 f0 4d 61 12 03 13 04 20 22 1f 10 5f 60
edid[090] = 5d 5e 23 09 07 07 83 01 00 00 6d 03 0c 00 20 00
edid[0a0] = 80 3c 20 10 60 01 02 03 67 d8 5d c4 01 78 80 03
edid[0b0] = e3 0f 01 04 02 3a 80 18 71 38 2d 40 58 2c 45 00
edid[0c0] = 60 59 21 00 00 1e 02 3a 80 d0 72 38 2d 40 10 2c
edid[0d0] = 45 80 60 59 21 00 00 1e 01 1d 00 72 51 d0 1e 20
edid[0e0] = 6e 28 55 00 60 59 21 00 00 1e 56 5e 00 a0 a0 a0
edid[0f0] = 29 50 30 20 35 00 60 59 21 00 00 1a 00 00 00 74

So, the MSB in the highlighted text gives you the port number of the HDMI data. It can take value from 1 to F (16 HDMI ports maximum)