[PATCH 2/3 v3] drm: bridge/dw-hdmi: Enable ISCR1, ISCR2 and ACP packets
Jose Abreu
Jose.Abreu at synopsys.com
Thu Aug 4 10:44:50 UTC 2016
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 at synopsys.com>
Cc: Carlos Palminha <palminha at synopsys.com>
Cc: Archit Taneja <architt at codeaurora.org>
Cc: David Airlie <airlied at linux.ie>
Cc: Russell King <rmk+kernel at arm.linux.org.uk>
Cc: Fabio Estevam <fabio.estevam at freescale.com>
Cc: Daniel Vetter <daniel.vetter at ffwll.ch>
Cc: Takashi Iwai <tiwai at suse.de>
Cc: Vladimir Zapolskiy <vladimir_zapolskiy at mentor.com>
Cc: Thierry Reding <treding at nvidia.com>
Cc: dri-devel at lists.freedesktop.org
Cc: linux-kernel at 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;
--
2.1.4
More information about the dri-devel
mailing list