From patchwork Mon May 15 22:27:14 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Clint Taylor X-Patchwork-Id: 9728135 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 9FC2A60231 for ; Mon, 15 May 2017 22:27:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8AA0B2843B for ; Mon, 15 May 2017 22:27:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7D3CB28481; Mon, 15 May 2017 22:27:20 +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 17F1E2843B for ; Mon, 15 May 2017 22:27:20 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0EE7F89F1B; Mon, 15 May 2017 22:27:18 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by gabe.freedesktop.org (Postfix) with ESMTPS id AFF3389F1B for ; Mon, 15 May 2017 22:27:16 +0000 (UTC) Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 May 2017 15:27:16 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.38,346,1491289200"; d="scan'208";a="87729299" Received: from cataylo2-ubuntu64-14.jf.intel.com ([10.7.199.155]) by orsmga004.jf.intel.com with ESMTP; 15 May 2017 15:27:16 -0700 From: clinton.a.taylor@intel.com To: dri-devel@lists.freedesktop.org Subject: [PATCH] drm/cec: Add Source Physical address decode to drm_display_info Date: Mon, 15 May 2017 15:27:14 -0700 Message-Id: <1494887234-27111-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. Signed-off-by: Clint Taylor --- 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,