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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Clint Taylor <clinton.a.taylor@xxxxxxxxx>

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.

V2: Fix HTMLDOCS warnings for struct drm_hdmi_cec_spa

Signed-off-by: Clint Taylor <clinton.a.taylor@xxxxxxxxx>
---
 drivers/gpu/drm/drm_edid.c  | 10 ++++++++++
 include/drm/drm_connector.h | 20 ++++++++++++++++++++
 2 files changed, 30 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..0df3511 100644
--- a/include/drm/drm_connector.h
+++ b/include/drm/drm_connector.h
@@ -127,6 +127,21 @@ 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 {
+	/** @a: sink's Source Physical Address A field */
+	u8 a;
+	/** @b: sink's Source Physical Address B field */
+	u8 b;
+	/** @c: sink's Source Physical Address C field */
+	u8 c;
+	/** @d: sink's Source Physical Address D field */
+	u8 d;
+};
 
 /**
  * struct drm_hdmi_info - runtime information about the connected HDMI sink
@@ -263,6 +278,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

_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux