From patchwork Thu Aug 4 10:44:50 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jose Abreu X-Patchwork-Id: 9264661 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 84A766048B for ; Fri, 5 Aug 2016 00:37:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7716C27FAC for ; Fri, 5 Aug 2016 00:37:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6B6A328401; Fri, 5 Aug 2016 00:37:43 +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]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9270427FAC for ; Fri, 5 Aug 2016 00:37:42 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id AE3C96EAA8; Fri, 5 Aug 2016 00:37:17 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from smtprelay.synopsys.com (smtprelay.synopsys.com [198.182.47.9]) by gabe.freedesktop.org (Postfix) with ESMTPS id BA3ED6E93B for ; Thu, 4 Aug 2016 10:45:24 +0000 (UTC) Received: from dc8secmta1.synopsys.com (dc8secmta1.synopsys.com [10.13.218.200]) by smtprelay.synopsys.com (Postfix) with ESMTP id 76F6924E12B7; Thu, 4 Aug 2016 03:45:24 -0700 (PDT) Received: from dc8secmta1.internal.synopsys.com (dc8secmta1.internal.synopsys.com [127.0.0.1]) by dc8secmta1.internal.synopsys.com (Service) with ESMTP id 69D9227113; Thu, 4 Aug 2016 03:45:24 -0700 (PDT) Received: from mailhost.synopsys.com (mailhost1.synopsys.com [10.12.238.239]) by dc8secmta1.internal.synopsys.com (Service) with ESMTP id 1B41227102; Thu, 4 Aug 2016 03:45:24 -0700 (PDT) Received: from mailhost.synopsys.com (localhost [127.0.0.1]) by mailhost.synopsys.com (Postfix) with ESMTP id EF212234; Thu, 4 Aug 2016 03:45:23 -0700 (PDT) Received: from synopsys-Macmini.mshome.net (joabreu-e7440.internal.synopsys.com [10.107.19.32]) by mailhost.synopsys.com (Postfix) with ESMTP id 8A89D223; Thu, 4 Aug 2016 03:45:21 -0700 (PDT) From: Jose Abreu To: dri-devel@lists.freedesktop.org Subject: [PATCH 2/3 v3] drm: bridge/dw-hdmi: Enable ISCR1, ISCR2 and ACP packets Date: Thu, 4 Aug 2016 11:44:50 +0100 Message-Id: <24dfd753e075c70d7b9b429b2d5f42ce9b1562a1.1470306826.git.joabreu@synopsys.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: References: In-Reply-To: References: X-Mailman-Approved-At: Fri, 05 Aug 2016 00:36:43 +0000 Cc: Jose Abreu , Fabio Estevam , Daniel Vetter , Carlos Palminha , linux-kernel@vger.kernel.org, Russell King , Thierry Reding , Vladimir Zapolskiy 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 Currently ISCR and ACP packets are not being sent causing HDMI compliance tests like CTS 7-19 HDMI 1.4b to fail. With this pacth the mentioned packets are activated when needed. Verified using HDMI compliance equipment. Signed-off-by: Jose Abreu Cc: Carlos Palminha Cc: Archit Taneja Cc: David Airlie Cc: Russell King Cc: Fabio Estevam Cc: Daniel Vetter Cc: Takashi Iwai Cc: Vladimir Zapolskiy Cc: Thierry Reding Cc: dri-devel@lists.freedesktop.org Cc: linux-kernel@vger.kernel.org --- This patch was only introduced in v3. drivers/gpu/drm/bridge/dw-hdmi.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/drivers/gpu/drm/bridge/dw-hdmi.c b/drivers/gpu/drm/bridge/dw-hdmi.c index b5fac27..9122a20 100644 --- a/drivers/gpu/drm/bridge/dw-hdmi.c +++ b/drivers/gpu/drm/bridge/dw-hdmi.c @@ -127,6 +127,7 @@ struct dw_hdmi { void __iomem *regs; bool sink_is_hdmi; bool sink_has_audio; + bool sink_supports_ai; struct mutex mutex; /* for state below and previous_mode */ enum drm_connector_force force; /* mutex-protected force state */ @@ -216,6 +217,21 @@ static void hdmi_set_cts_n(struct dw_hdmi *hdmi, unsigned int cts, hdmi_writeb(hdmi, (n >> 8) & 0xff, HDMI_AUD_N2); hdmi_writeb(hdmi, n & 0xff, HDMI_AUD_N1); + /* Set ISCR1, ISCR2, and ACP packets to automatic scheduling */ + if (hdmi->sink_supports_ai) { + dev_dbg(hdmi->dev, "sink supports AI packets\n"); + hdmi_writeb(hdmi, 0x06, HDMI_FC_ISCR1_0); + hdmi_writeb(hdmi, 0x03, HDMI_FC_DATAUTO0); + hdmi_writeb(hdmi, 0x01, HDMI_FC_DATAUTO1); + hdmi_writeb(hdmi, 0x11, HDMI_FC_DATAUTO2); + } else { + dev_dbg(hdmi->dev, "sink does not support AI packets\n"); + hdmi_writeb(hdmi, 0x00, HDMI_FC_ISCR1_0); + hdmi_writeb(hdmi, 0x00, HDMI_FC_DATAUTO0); + hdmi_writeb(hdmi, 0x00, HDMI_FC_DATAUTO1); + hdmi_writeb(hdmi, 0x00, HDMI_FC_DATAUTO2); + } + /* Set Frame Composer Audio Sample sampling frequency */ if (hdmi->dev_type == DWC_HDMI) { u8 val = 0x0; @@ -1474,8 +1490,13 @@ static int dw_hdmi_connector_get_modes(struct drm_connector *connector) /* Store the ELD */ drm_edid_to_eld(connector, edid); kfree(edid); + + hdmi->sink_supports_ai = connector->eld[5] & (0x1 << 1); } else { dev_dbg(hdmi->dev, "failed to get edid\n"); + hdmi->sink_is_hdmi = false; + hdmi->sink_has_audio = false; + hdmi->sink_supports_ai = false; } return ret;