From patchwork Tue May 16 15:29:10 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Clint Taylor X-Patchwork-Id: 9729283 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 56537602B4 for ; Tue, 16 May 2017 15:29:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 462A728A01 for ; Tue, 16 May 2017 15:29:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3932628A17; Tue, 16 May 2017 15:29:23 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 3461428A01 for ; Tue, 16 May 2017 15:29:20 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 888616E310; Tue, 16 May 2017 15:29:19 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by gabe.freedesktop.org (Postfix) with ESMTPS id 129076E310 for ; Tue, 16 May 2017 15:29:18 +0000 (UTC) Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga105.fm.intel.com with ESMTP; 16 May 2017 08:29:14 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.38,349,1491289200"; d="scan'208";a="88021912" Received: from cataylo2-ubuntu64-14.jf.intel.com ([10.7.199.155]) by orsmga004.jf.intel.com with ESMTP; 16 May 2017 08:29:14 -0700 From: clinton.a.taylor@intel.com To: dri-devel@lists.freedesktop.org Subject: [PATCH V2] drm/cec: Add Source Physical address decode to drm_display_info Date: Tue, 16 May 2017 08:29:10 -0700 Message-Id: <1494948550-4170-1-git-send-email-clinton.a.taylor@intel.com> X-Mailer: git-send-email 1.9.1 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Clint Taylor 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 --- 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,