linux-tegra.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thierry Reding <thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Mikko Perttunen <mperttunen-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
Cc: Terje Bergstrom
	<tbergstrom-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>,
	"dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org"
	<dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>,
	"linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [PATCH 2/5] host1x: hdmi: Detect whether display is connected with HDMI or DVI
Date: Wed, 28 Aug 2013 15:16:09 +0200	[thread overview]
Message-ID: <20130828131608.GA604@ulmo> (raw)
In-Reply-To: <521DEE6D.4050503-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 2808 bytes --]

On Wed, Aug 28, 2013 at 03:34:53PM +0300, Mikko Perttunen wrote:
> On 08/28/2013 03:07 PM, Thierry Reding wrote:
> >* PGP Signed by an unknown key
> >
> >On Wed, Aug 28, 2013 at 01:40:56PM +0300, 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.
> >>
> >>Signed-off-by: Mikko Perttunen <mperttunen-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
> >>---
> >>  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;
> >
> >Odd, now that I see that code I remember that there was a similar patch
> >a few months back, but it was never applied for some reason:
> >
> >	http://lists.freedesktop.org/archives/dri-devel/2013-January/033509.html
> >
> >That was already reviewed by me and Jon Mayo, so I'll go ahead and apply
> >that one instead.
> >
> >Thierry
> >
> >* Unknown Key
> >* 0x7F3EB3A1
> >
> 
> That patch seems to cause a warning for me:
> drivers/gpu/host1x/drm/hdmi.c: In function ‘tegra_output_hdmi_enable’:
> drivers/gpu/host1x/drm/hdmi.c:706:2: warning: passing argument 1 of
> ‘drm_detect_hdmi_monitor’ discards ‘const’ qualifier from pointer
> target type [enabled by default]
> include/drm/drm_crtc.h:1037:13: note: expected ‘struct edid *’ but
> argument is of type ‘const struct edid *’

Given the discussion about this back in January, I think the best way,
at least for now, is to keep a copy of the EDID data so that it can
actually be modified.

But looking at the problem more closely, I don't think the patch from
January is quite correct. The problem is that it uses the EDID stored
within the struct tegra_output. That's problematic because that field
is not updated when EDID is probed via DDC. That would make the patch
that you proposed more correct.

Thierry

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

  parent reply	other threads:[~2013-08-28 13:16 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
     [not found] ` <1377686459-16634-1-git-send-email-mperttunen-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2013-08-28 10:40   ` [PATCH 2/5] host1x: hdmi: Detect whether display is connected with HDMI or DVI Mikko Perttunen
2013-08-28 12:07     ` Thierry Reding
2013-08-28 12:34       ` Mikko Perttunen
     [not found]         ` <521DEE6D.4050503-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2013-08-28 13:16           ` Thierry Reding [this message]
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
     [not found]     ` <1377686459-16634-5-git-send-email-mperttunen-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2013-08-28 12:25       ` Thierry Reding
2013-08-28 12:41         ` Mikko Perttunen
     [not found]           ` <521DEFFF.90507-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
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
     [not found]     ` <1377686459-16634-6-git-send-email-mperttunen-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2013-08-28 12:30       ` Thierry Reding
2013-08-28 12:49         ` Mikko Perttunen
     [not found]           ` <521DF1E9.7050504-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
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=20130828131608.GA604@ulmo \
    --to=thierry.reding-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=mperttunen-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org \
    --cc=tbergstrom-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org \
    /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;
as well as URLs for NNTP newsgroup(s).