mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mikko Perttunen <mperttunen@nvidia.com>
To: <thierry.reding@gmail.com>
Cc: <tbergstrom@nvidia.com>, <dri-devel@lists.freedesktop.org>,
	<linux-tegra@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	Mikko Perttunen <mperttunen@nvidia.com>
Subject: [PATCH 2/5] host1x: hdmi: Detect whether display is connected with HDMI or DVI
Date: Wed, 28 Aug 2013 13:40:56 +0300	[thread overview]
Message-ID: <1377686459-16634-3-git-send-email-mperttunen@nvidia.com> (raw)
In-Reply-To: <1377686459-16634-1-git-send-email-mperttunen@nvidia.com>

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(+)

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;
-- 
1.8.1.5


  parent reply	other threads:[~2013-08-28 10:41 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-28 10:40 [PATCH 0/5] HDMI support for Tegra114 Dalmore Mikko Perttunen
2013-08-28 10:40 ` [PATCH 1/5] host1x: hdmi: Add Tegra114 support Mikko Perttunen
2013-08-28 10:40 ` Mikko Perttunen [this message]
2013-08-28 12:07   ` [PATCH 2/5] host1x: hdmi: Detect whether display is connected with HDMI or DVI Thierry Reding
2013-08-28 12:34     ` Mikko Perttunen
2013-08-28 13:16       ` Thierry Reding
2013-08-28 10:40 ` [PATCH 3/5] clk: tegra114: Initialize clocks needed for HDMI Mikko Perttunen
2013-08-28 10:40 ` [PATCH 4/5] ARM: tegra: Add host1x, dc and hdmi to Tegra114 device tree Mikko Perttunen
2013-08-28 12:25   ` Thierry Reding
2013-08-28 12:41     ` Mikko Perttunen
2013-08-28 13:18       ` Thierry Reding
2013-08-29  6:52         ` Terje Bergström
2013-08-28 10:40 ` [PATCH 5/5] ARM: tegra: Add hdmi to Tegra114 Dalmore " Mikko Perttunen
2013-08-28 12:30   ` Thierry Reding
2013-08-28 12:49     ` Mikko Perttunen
2013-08-28 13:25       ` Thierry Reding

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1377686459-16634-3-git-send-email-mperttunen@nvidia.com \
    --to=mperttunen@nvidia.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=tbergstrom@nvidia.com \
    --cc=thierry.reding@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®