Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* Re: Linux 3.2-rc1
       [not found] ` <20111108145510.GA5142@elliptictech.com>
@ 2011-11-08 20:23   ` Linus Torvalds
  2011-11-09  7:40     ` Takashi Iwai
  0 siblings, 1 reply; 4+ messages in thread
From: Linus Torvalds @ 2011-11-08 20:23 UTC (permalink / raw)
  To: Nick Bowler, Takashi Iwai, alsa-devel, Keith Packard, dri-devel
  Cc: Linux Kernel Mailing List

Hmm, I don't know what caused this to trigger, but I'm adding both the
i915 people and the HDA people to the cc, and they can fight to the
death about this in the HDMI Thunderdome.

Guys: One.. Two.. Three.. FIGHT!

                 Linus

On Tue, Nov 8, 2011 at 6:55 AM, Nick Bowler <nbowler@elliptictech.com> wrote:
>
> Mode switches are very noisy on an Intel G45 in 3.2-rc1:
>
>  HDMI hot plug event: Codec=3 Pin=3 Presence_Detect=1 ELD_Valid=1
>  HDMI status: Codec=3 Pin=3 Presence_Detect=1 ELD_Valid=1
>  HDMI: detected monitor W2253 at connection type HDMI
>  HDMI: available speakers: FL/FR
>  HDMI: supports coding type LPCM: channels = 2, rates = 32000 44100 48000, bits = 16 20 24
>
> These lines get printed every single switch; previously only a single
> line was printed once at boot (the "HDMI status" line).
>
> Cheers,
> --
> Nick Bowler, Elliptic Technologies (http://www.elliptictech.com/)
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Linux 3.2-rc1
  2011-11-08 20:23   ` Linux 3.2-rc1 Linus Torvalds
@ 2011-11-09  7:40     ` Takashi Iwai
  2011-11-09 12:03       ` Wu Fengguang
  2011-11-10 11:57       ` Wu Fengguang
  0 siblings, 2 replies; 4+ messages in thread
From: Takashi Iwai @ 2011-11-09  7:40 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Keith Packard, alsa-devel, Nick Bowler, dri-devel,
	Linux Kernel Mailing List, Wu Fengguang

At Tue, 8 Nov 2011 12:23:30 -0800,
Linus Torvalds wrote:
> 
> Hmm, I don't know what caused this to trigger, but I'm adding both the
> i915 people and the HDA people to the cc, and they can fight to the
> death about this in the HDMI Thunderdome.

It must be the new addition of ELD-passing code.

Fengguang, can the drm or i915 driver check whether ELD is changed or
not?  Writing ELD at each time even when unchanged confuses the audio
side, as if the monitor is hotplugged.

> 
> Guys: One.. Two.. Three.. FIGHT!

Round two!


Takashi

>                  Linus
> 
> On Tue, Nov 8, 2011 at 6:55 AM, Nick Bowler <nbowler@elliptictech.com> wrote:
> >
> > Mode switches are very noisy on an Intel G45 in 3.2-rc1:
> >
> >  HDMI hot plug event: Codec=3 Pin=3 Presence_Detect=1 ELD_Valid=1
> >  HDMI status: Codec=3 Pin=3 Presence_Detect=1 ELD_Valid=1
> >  HDMI: detected monitor W2253 at connection type HDMI
> >  HDMI: available speakers: FL/FR
> >  HDMI: supports coding type LPCM: channels = 2, rates = 32000 44100 48000, bits = 16 20 24
> >
> > These lines get printed every single switch; previously only a single
> > line was printed once at boot (the "HDMI status" line).
> >
> > Cheers,
> > --
> > Nick Bowler, Elliptic Technologies (http://www.elliptictech.com/)
> >
> 
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Linux 3.2-rc1
  2011-11-09  7:40     ` Takashi Iwai
@ 2011-11-09 12:03       ` Wu Fengguang
  2011-11-10 11:57       ` Wu Fengguang
  1 sibling, 0 replies; 4+ messages in thread
From: Wu Fengguang @ 2011-11-09 12:03 UTC (permalink / raw)
  To: Takashi Iwai
  Cc: Linus Torvalds, Nick Bowler, alsa-devel@alsa-project.org,
	Keith Packard, dri-devel@lists.freedesktop.org,
	Linux Kernel Mailing List

On Wed, Nov 09, 2011 at 03:40:19PM +0800, Takashi Iwai wrote:
> At Tue, 8 Nov 2011 12:23:30 -0800,
> Linus Torvalds wrote:
> > 
> > Hmm, I don't know what caused this to trigger, but I'm adding both the
> > i915 people and the HDA people to the cc, and they can fight to the
> > death about this in the HDMI Thunderdome.
> 
> It must be the new addition of ELD-passing code.

Yes, it's my fault.

> Fengguang, can the drm or i915 driver check whether ELD is changed or
> not?  Writing ELD at each time even when unchanged confuses the audio
> side, as if the monitor is hotplugged.

It's sure possible to mask out the extra events.
I'll work out a patch tomorrow.

> > Guys: One.. Two.. Three.. FIGHT!
> 
> Round two!

Three to fight!

Thanks,
Fengguang

> > On Tue, Nov 8, 2011 at 6:55 AM, Nick Bowler <nbowler@elliptictech.com> wrote:
> > >
> > > Mode switches are very noisy on an Intel G45 in 3.2-rc1:
> > >
> > >  HDMI hot plug event: Codec=3 Pin=3 Presence_Detect=1 ELD_Valid=1
> > >  HDMI status: Codec=3 Pin=3 Presence_Detect=1 ELD_Valid=1
> > >  HDMI: detected monitor W2253 at connection type HDMI
> > >  HDMI: available speakers: FL/FR
> > >  HDMI: supports coding type LPCM: channels = 2, rates = 32000 44100 48000, bits = 16 20 24
> > >
> > > These lines get printed every single switch; previously only a single
> > > line was printed once at boot (the "HDMI status" line).
> > >
> > > Cheers,
> > > --
> > > Nick Bowler, Elliptic Technologies (http://www.elliptictech.com/)
> > >
> > 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Linux 3.2-rc1
  2011-11-09  7:40     ` Takashi Iwai
  2011-11-09 12:03       ` Wu Fengguang
@ 2011-11-10 11:57       ` Wu Fengguang
  1 sibling, 0 replies; 4+ messages in thread
From: Wu Fengguang @ 2011-11-10 11:57 UTC (permalink / raw)
  To: Nick Bowler
  Cc: alsa-devel@alsa-project.org, Takashi Iwai, Keith Packard,
	dri-devel@lists.freedesktop.org, Linux Kernel Mailing List,
	Linus Torvalds

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

Hi Nick,

On Wed, Nov 09, 2011 at 03:40:19PM +0800, Takashi Iwai wrote:
> At Tue, 8 Nov 2011 12:23:30 -0800,
> Linus Torvalds wrote:
> > 
> > Hmm, I don't know what caused this to trigger, but I'm adding both the
> > i915 people and the HDA people to the cc, and they can fight to the
> > death about this in the HDMI Thunderdome.
> 
> It must be the new addition of ELD-passing code.
> 
> Fengguang, can the drm or i915 driver check whether ELD is changed or
> not?  Writing ELD at each time even when unchanged confuses the audio
> side, as if the monitor is hotplugged.

The attached patch is tested OK to prevent extra hot plug events.

However it has one side effect: when HDMI monitor is hot removed,
the ELD keeps remain valid. I need to find a way to test for the
presence of the monitor and handle that case as well. When all done,
I'll submit the patches together for review.

Thanks,
Fengguang

[-- Attachment #2: no-extra-eld-passing --]
[-- Type: text/plain, Size: 2661 bytes --]

Subject: drm/i915: don't trigger hotplug events on unchanged ELD
Date: Thu Nov 10 17:48:49 CST 2011

The ELD may or may not change when switching the video mode.
If unchanged, don't trigger hot plug events to HDMI audio driver.

This avoids disturbing the user with repeated printks.

Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
---
 drivers/gpu/drm/i915/intel_display.c |   51 ++++++++++++++++++++++---
 1 file changed, 46 insertions(+), 5 deletions(-)

--- linux.orig/drivers/gpu/drm/i915/intel_display.c	2011-11-10 17:23:04.000000000 +0800
+++ linux/drivers/gpu/drm/i915/intel_display.c	2011-11-10 17:59:25.000000000 +0800
@@ -5811,6 +5811,35 @@ static int intel_crtc_mode_set(struct dr
 	return ret;
 }
 
+static bool intel_eld_uptodate(struct drm_connector *connector,
+			       int reg_eldv, uint32_t bits_eldv,
+			       int reg_elda, uint32_t bits_elda,
+			       int reg_edid)
+{
+	struct drm_i915_private *dev_priv = connector->dev->dev_private;
+	uint8_t *eld = connector->eld;
+	uint32_t i;
+
+	i = I915_READ(reg_eldv);
+	i &= bits_eldv;
+
+	if (!eld[0])
+		return !i;
+
+	if (!i)
+		return false;
+
+	i = I915_READ(reg_elda);
+	i &= ~bits_elda;
+	I915_WRITE(reg_elda, i);
+
+	for (i = 0; i < eld[2]; i++)
+		if (I915_READ(reg_edid) != *((uint32_t *)eld + i))
+			return false;
+
+	return true;
+}
+
 static void g4x_write_eld(struct drm_connector *connector,
 			  struct drm_crtc *crtc)
 {
@@ -5827,6 +5856,12 @@ static void g4x_write_eld(struct drm_con
 	else
 		eldv = G4X_ELDV_DEVCTG;
 
+	if (intel_eld_uptodate(connector,
+			       G4X_AUD_CNTL_ST, eldv,
+			       G4X_AUD_CNTL_ST, G4X_ELD_ADDR,
+			       G4X_HDMIW_HDMIEDID))
+		return;
+
 	i = I915_READ(G4X_AUD_CNTL_ST);
 	i &= ~(eldv | G4X_ELD_ADDR);
 	len = (i >> 9) & 0x1f;		/* ELD buffer size */
@@ -5886,6 +5921,17 @@ static void ironlake_write_eld(struct dr
 		eldv = GEN5_ELD_VALIDB << ((i - 1) * 4);
 	}
 
+	if (intel_pipe_has_type(crtc, INTEL_OUTPUT_DISPLAYPORT)) {
+		DRM_DEBUG_DRIVER("ELD: DisplayPort detected\n");
+		eld[5] |= (1 << 2);	/* Conn_Type, 0x1 = DisplayPort */
+	}
+
+	if (intel_eld_uptodate(connector,
+			       aud_cntrl_st2, eldv,
+			       aud_cntl_st, GEN5_ELD_ADDRESS,
+			       hdmiw_hdmiedid))
+		return;
+
 	i = I915_READ(aud_cntrl_st2);
 	i &= ~eldv;
 	I915_WRITE(aud_cntrl_st2, i);
@@ -5893,11 +5939,6 @@ static void ironlake_write_eld(struct dr
 	if (!eld[0])
 		return;
 
-	if (intel_pipe_has_type(crtc, INTEL_OUTPUT_DISPLAYPORT)) {
-		DRM_DEBUG_DRIVER("ELD: DisplayPort detected\n");
-		eld[5] |= (1 << 2);	/* Conn_Type, 0x1 = DisplayPort */
-	}
-
 	i = I915_READ(aud_cntl_st);
 	i &= ~GEN5_ELD_ADDRESS;
 	I915_WRITE(aud_cntl_st, i);

[-- Attachment #3: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-11-10 11:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <CA+55aFzytqbGcOzWvYAo-EnJCeK5mFqdCF5OjMTeM5UBfeyCXw@mail.gmail.com>
     [not found] ` <20111108145510.GA5142@elliptictech.com>
2011-11-08 20:23   ` Linux 3.2-rc1 Linus Torvalds
2011-11-09  7:40     ` Takashi Iwai
2011-11-09 12:03       ` Wu Fengguang
2011-11-10 11:57       ` Wu Fengguang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox