Skip to contentSkip to conversation

drm/i915: pass ELD to HDMI/DP audio driver

PATCH Superseded Wu Fengguang 10 participants 66 messages Sep 2, 2011 – Nov 15, 2011 4 messages not in the archive Page 2 of 2

Subsystems (4)
lore
Share & tools
lore
#64 lore raw
In reply to Takashi Iwai
Quoted 9 lines · Takashi Iwai

At Fri, 11 Nov 2011 19:12:57 +0800,

Quoted 7 lines · Wu Fengguang

(snip)

Quoted 5 lines
Quoted 4 lines
Quoted 2 lines

One note that we don't rely on PD bit because not all (non-Intel) hardware report it correctly.

Oops. Do you imply ELDV is reliable on all platforms? ;-)

Quoted 8 lines
Quoted 4 lines
Quoted 2 lines

Oh hell, no :)
The driver tries to probe explicitly via GET_PIN_SENSE HD-audio verb.

Yeah the below "HDMI status:..." line. Can we rely on it then?

I guess yes. At least, it worked with Nvidia and ATI, too, so far. The point is that the value passed in the codec unsol event is unreliable for some chips.

Yeah, for example the below "HDMI hot plug event". When device is hot removed, Presence_Detect and ELD_Valid both goes 0, but the driver has to clear them one by one. As I choose to disable SDVO_AUDIO_ENABLE first, we see the strange "Presence_Detect=0 ELD_Valid=1" combination below.

Quoted 41 lines
Quoted 41 lines
Quoted 41 lines
Quoted 40 lines
Quoted 11 lines
Quoted 9 lines
[   91.777028] [drm:ironlake_write_eld], ELD on pipe B 
[   91.778561] HDMI hot plug event: Codec=3 Pin=6 Presence_Detect=0 ELD_Valid=1
[   91.783078] HDMI status: Codec=3 Pin=6 Presence_Detect=0 ELD_Valid=0
[   91.783083] [drm:ironlake_write_eld], Audio directed to unknown port
[   91.783095] [drm:output_poll_execute], [CONNECTOR:12:HDMI-A-2] status updated from 1 to 2

The HDA spec even mentioned doing some timeout mechanism for the "Presence_Detect=1 ELD_Valid=0" state. Well it may help some corner cases, but perhaps not an urgent feature.

Yeah, this sounds like the workaround for such a case.

Yeah, your mentioned DVI case may be always in state

        "Presence_Detect=1 ELD_Valid=0"

where audio playback should be denied.

And there might be the error case that the 2nd event is lost or not generated at all for changing

        "Presence_Detect=1 ELD_Valid=0"
to
        "Presence_Detect=1 ELD_Valid=1"
Quoted 4 lines
Quoted 4 lines
Quoted 3 lines

We might end up with some delayed probe with a dedicated work_struct (because it's bad to have a too long delay in unsol event handler
that run on a single workq).

Quoted 8 lines
Quoted 3 lines

Understand. What if the graphics driver can delay the ELD writing (I can try that), so that the audio driver only need to wait for something like 10ms?

Or, we can introduce a dirty flag, and set it when ELD is changed, but don't prase ELD contents yet. First upon the next access, the driver updates the status, and clear the dirty flag. We may put a small delay at this update, too.

It should work fine for "cat /proc/asound/card0/eld*" and other interfaces, however it could still delay the printks' significantly.

Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

Well, this reminds me of another question -- do we need these printks unconditionally?

Maybe not. How about the attached patch to remove them all?

I'm fine with it (better after debugging the ELD problems :)

OK, when all the ELD/hotplug stuff calms down.

Thanks,
Fengguang

#65 lore raw
In reply to Takashi Iwai

(snip)

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 6 lines
Quoted 2 lines

And I'm not sure whether HDMI audio is played
while DPMS is off. I haven't tested it.

It will go silence on DPMS. I noticed this while doing long term HDMI audio playback tests. This should better be fixed in future on the graphics side.

Quoted 7 lines
Quoted 5 lines
Quoted 2 lines

Hm, but I wonder what could be done alternatively. Hopefully there is a register for video-only control...

There may be some mode that can keep video off while still keep minimal signals to play HDMI sound?

Let's hope :)

Looks very possible, here is the clue of hardware support:

TRANS_DP_CTL - Transcoder DisplayPort Control

bit 26: Transcoder DP Audio Only Mode

Thanks,
Fengguang

#66 lore raw

At Sat, 12 Nov 2011 10:27:26 +0800,

Quoted 15 lines · Wu Fengguang

(snip)

Quoted 13 lines
Quoted 12 lines
Quoted 9 lines
Quoted 6 lines
Quoted 2 lines

And I'm not sure whether HDMI audio is played
while DPMS is off. I haven't tested it.

It will go silence on DPMS. I noticed this while doing long term HDMI audio playback tests. This should better be fixed in future on the graphics side.

Hm, but I wonder what could be done alternatively. Hopefully there is a register for video-only control...

There may be some mode that can keep video off while still keep minimal signals to play HDMI sound?

Quoted 7 lines
Quoted 1 line

Let's hope :)

Looks very possible, here is the clue of hardware support:

TRANS_DP_CTL - Transcoder DisplayPort Control

bit 26: Transcoder DP Audio Only Mode

Good to know! But what about HDMI?

thanks,

Takashi

#67 lore raw
Quoted 19 lines · Takashi Iwai

At Sat, 12 Nov 2011 10:27:26 +0800,

Quoted 17 lines · Wu Fengguang

(snip)

Quoted 14 lines
Quoted 7 lines
Quoted 7 lines
Quoted 6 lines
Quoted 2 lines

And I'm not sure whether HDMI audio is played
while DPMS is off. I haven't tested it.

It will go silence on DPMS. I noticed this while doing long term HDMI audio playback tests. This should better be fixed in future on the graphics side.

Quoted 5 lines
Quoted 2 lines

Hm, but I wonder what could be done alternatively. Hopefully there is a register for video-only control...

There may be some mode that can keep video off while still keep minimal signals to play HDMI sound?

Let's hope :)

Quoted 7 lines
Quoted 5 lines

Looks very possible, here is the clue of hardware support:

TRANS_DP_CTL - Transcoder DisplayPort Control

bit 26: Transcoder DP Audio Only Mode

Good to know! But what about HDMI?

I'm not sure.. There are no corresponding TRANS_HDMI_CTL registers...

Thanks,
Fengguang

#68 lore raw
Quoted 18 lines

-----Original Message-----
From: intel-gfx- [email protected] [mailto:intel-gfx- [email protected]] On Behalf Of Wu Fengguang
Sent: Monday, November 14, 2011 6:56 PM
To: Takashi Iwai
Cc: Wang, Zhenyu Z; [email protected]; Barnes, Jesse; Jeremy Bush; Christopher White; Bossart, Pierre-louis
Subject: Re: [Intel-gfx] [PATCH v5] drm/i915: pass ELD to HDMI/DP audio driver

Quoted 3 lines · Takashi Iwai

At Sat, 12 Nov 2011 10:27:26 +0800,

Quoted 1 line · Wu Fengguang
Quoted 17 lines
Quoted 5 lines
Quoted 5 lines

(snip)

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 2 lines

And I'm not sure whether HDMI audio is played
while DPMS is off. I haven't tested it.

It will go silence on DPMS. I noticed this while doing long

term HDMI

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

audio playback tests. This should better be fixed in future on

the

Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 7 lines
Quoted 4 lines
Quoted 1 line

graphics side.

Hm, but I wonder what could be done alternatively. Hopefully there is a register for video-only control...

There may be some mode that can keep video off while still keep minimal signals to play HDMI sound?

Let's hope :)

You can turn off only the plane (but don't turn off the pipe & port) to achieve this.

Not much of power saving compared to DPMS though.

Quoted 11 lines
Quoted 8 lines
Quoted 6 lines

Looks very possible, here is the clue of hardware support:

TRANS_DP_CTL - Transcoder DisplayPort Control

bit 26: Transcoder DP Audio Only Mode

Good to know! But what about HDMI?

I'm not sure.. There are no corresponding TRANS_HDMI_CTL registers...

Bit 26 of TRANS_DP_CTL does not work. Also there is no such bit for HDMI.

Quoted 6 lines

Thanks,
Fengguang
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

Thanks,
Vijay