[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <24dfd753e075c70d7b9b429b2d5f42ce9b1562a1.1470306826.git.joabreu@synopsys.com>
Date: Thu, 4 Aug 2016 11:44:50 +0100
From: Jose Abreu <Jose.Abreu@...opsys.com>
To: dri-devel@...ts.freedesktop.org
Cc: Jose Abreu <Jose.Abreu@...opsys.com>,
Carlos Palminha <CARLOS.PALMINHA@...opsys.com>,
Archit Taneja <architt@...eaurora.org>,
David Airlie <airlied@...ux.ie>,
Russell King <rmk+kernel@....linux.org.uk>,
Fabio Estevam <fabio.estevam@...escale.com>,
Daniel Vetter <daniel.vetter@...ll.ch>,
Takashi Iwai <tiwai@...e.de>,
Vladimir Zapolskiy <vladimir_zapolskiy@...tor.com>,
Thierry Reding <treding@...dia.com>,
linux-kernel@...r.kernel.org
Subject: [PATCH 2/3 v3] drm: bridge/dw-hdmi: Enable ISCR1, ISCR2 and ACP packets
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 <joabreu@...opsys.com>
Cc: Carlos Palminha <palminha@...opsys.com>
Cc: Archit Taneja <architt@...eaurora.org>
Cc: David Airlie <airlied@...ux.ie>
Cc: Russell King <rmk+kernel@....linux.org.uk>
Cc: Fabio Estevam <fabio.estevam@...escale.com>
Cc: Daniel Vetter <daniel.vetter@...ll.ch>
Cc: Takashi Iwai <tiwai@...e.de>
Cc: Vladimir Zapolskiy <vladimir_zapolskiy@...tor.com>
Cc: Thierry Reding <treding@...dia.com>
Cc: dri-devel@...ts.freedesktop.org
Cc: linux-kernel@...r.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;
--
2.1.4
Powered by blists - more mailing lists