[PATCH] drm/cec: Add Source Physical address decode to drm_display_info

clinton.a.taylor at intel.com clinton.a.taylor at intel.com
Mon May 15 22:27:14 UTC 2017


From: Clint Taylor <clinton.a.taylor at intel.com>

During VSDB decode bytes 4 and 5 contain the source physical address for
use the HDMI CEC. Make this data available as part of drm_display_info.

Signed-off-by: Clint Taylor <clinton.a.taylor at intel.com>
---
 drivers/gpu/drm/drm_edid.c  | 10 ++++++++++
 include/drm/drm_connector.h | 16 ++++++++++++++++
 2 files changed, 26 insertions(+)

diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
index 2e55599..e64605b 100644
--- a/drivers/gpu/drm/drm_edid.c
+++ b/drivers/gpu/drm/drm_edid.c
@@ -3938,6 +3938,16 @@ static void drm_parse_hdmi_deep_color_info(struct drm_connector *connector,
 	struct drm_display_info *info = &connector->display_info;
 	u8 len = cea_db_payload_len(db);
 
+	if (len >= 4) {
+		info->src_phy_addr.a = (db[4] & 0xF0) >> 4;
+		info->src_phy_addr.b = db[4] & 0x0F;
+		info->src_phy_addr.c = (db[5] & 0xF0) >> 4;
+		info->src_phy_addr.d = db[5] & 0x0F;
+
+		DRM_DEBUG_KMS("HDMI SPA = %01x.%01x.%01x.%01x\n",
+				info->src_phy_addr.a, info->src_phy_addr.b,
+				info->src_phy_addr.c, info->src_phy_addr.d);
+	}
 	if (len >= 6)
 		info->dvi_dual = db[6] & 1;
 	if (len >= 7)
diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
index 9c15993..4e2ee21 100644
--- a/include/drm/drm_connector.h
+++ b/include/drm/drm_connector.h
@@ -127,6 +127,17 @@ struct drm_scdc {
 	struct drm_scrambling scrambling;
 };
 
+/**
+ * struct drm_hdmi_cec_spa
+ *
+ * Provides the Source Physical address from an HDMI VSDB EDID
+ */
+struct drm_hdmi_cec_spa {
+	u8 a;
+	u8 b;
+	u8 c;
+	u8 d;
+};
 
 /**
  * struct drm_hdmi_info - runtime information about the connected HDMI sink
@@ -263,6 +274,11 @@ struct drm_display_info {
 	 * @hdmi: advance features of a HDMI sink.
 	 */
 	struct drm_hdmi_info hdmi;
+
+	/**
+	 * @src_phy_addr: HDMI CEC Source Physical Address
+	 */
+	struct drm_hdmi_cec_spa src_phy_addr;
 };
 
 int drm_display_info_set_bus_formats(struct drm_display_info *info,
-- 
1.9.1



More information about the dri-devel mailing list