diff mbox

[v2,2/6] host1x: hdmi: Detect whether display is connected with HDMI or DVI

Message ID 1377704922-2824-3-git-send-email-mperttunen@nvidia.com (mailing list archive)
State New, archived
Headers show

Commit Message

Mikko Perttunen Aug. 28, 2013, 3:48 p.m. UTC
Use EDID data to determine whether the display supports HDMI or just DVI.
This used to be hardcoded to be HDMI, which broke support for DVI displays
that couldn't understand the interspersed audio/other data.

If the EDID data isn't available, default to DVI, which should be a safer
choice.

Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>
---
 drivers/gpu/host1x/drm/hdmi.c | 8 ++++++++
 1 file changed, 8 insertions(+)

Comments

Stephen Warren Sept. 4, 2013, 6:40 p.m. UTC | #1
On 08/28/2013 09:48 AM, Mikko Perttunen wrote:
> Use EDID data to determine whether the display supports HDMI or just DVI.
> This used to be hardcoded to be HDMI, which broke support for DVI displays
> that couldn't understand the interspersed audio/other data.
> 
> If the EDID data isn't available, default to DVI, which should be a safer
> choice.

This seems like a bug-fix that might even be worth CC: stable?
Thierry Reding Sept. 4, 2013, 9:59 p.m. UTC | #2
On Wed, Sep 04, 2013 at 12:40:58PM -0600, Stephen Warren wrote:
> On 08/28/2013 09:48 AM, Mikko Perttunen wrote:
> > Use EDID data to determine whether the display supports HDMI or just DVI.
> > This used to be hardcoded to be HDMI, which broke support for DVI displays
> > that couldn't understand the interspersed audio/other data.
> > 
> > If the EDID data isn't available, default to DVI, which should be a safer
> > choice.
> 
> This seems like a bug-fix that might even be worth CC: stable?

Possibly. The patch reaches deeply into some DRM structures, which I'd
like to avoid. I'll have another look to see if it can be done in a
slightly different way.

Thierry
diff mbox

Patch

diff --git a/drivers/gpu/host1x/drm/hdmi.c b/drivers/gpu/host1x/drm/hdmi.c
index d81fac8..140339b 100644
--- a/drivers/gpu/host1x/drm/hdmi.c
+++ b/drivers/gpu/host1x/drm/hdmi.c
@@ -702,6 +702,14 @@  static int tegra_output_hdmi_enable(struct tegra_output *output)
 	unsigned long value;
 	int retries = 1000;
 	int err;
+	struct drm_property_blob *edid_blob = output->connector.edid_blob_ptr;
+
+	if (edid_blob && edid_blob->data &&
+		drm_detect_hdmi_monitor((struct edid *)edid_blob->data)) {
+		hdmi->dvi = false;
+	} else {
+		hdmi->dvi = true;
+	}
 
 	pclk = mode->clock * 1000;
 	h_sync_width = mode->hsync_end - mode->hsync_start;