diff mbox

[V4,2/2] drm/i915: start adding dp mst audio

Message ID s5hwpsljd2j.wl-tiwai@suse.de (mailing list archive)
State New, archived
Headers show

Commit Message

Takashi Iwai Dec. 11, 2015, 2:05 p.m. UTC
On Fri, 11 Dec 2015 07:07:53 +0100,
Libin Yang wrote:
> 
> Add Takashi and ALSA mail list.
> 
> On 12/10/2015 05:02 PM, Daniel Vetter wrote:
> > On Tue, Dec 08, 2015 at 04:01:20PM +0800, Libin Yang wrote:
> >> Hi all,
> >>
> >> Any comments on the patches?
> >
> > Sorry, simply fell through the cracks since Ander is on vacation. Takashi
> > is working on some cleanup patches to have a port->encoder mapping for the
> > audio side of i915. His patch cleans up all the existing audio code in
> > i915, but please work together with him to align mst code with the new
> > style.
> >
> > Both patches queued for next.
> 
> Yes, I have seen Takashi's patches. I will check the patches.

The patch like below should work; it sets/clears the reverse mapping
dynamically for the MST encoder.

At least, now I could get a proper ELD from a docking station.  But
the audio itself doesn't seem working yet, missing something...

FWIW, the fixed patches are found in my test/hdmi-jack branch.
It contains my previous get_eld patchset, HD-audio side changes,
Libin's this patchset, plus Libin's HD-audio MST patchset and some
fixes.


Takashi

---

Comments

Takashi Iwai Dec. 13, 2015, 8:27 a.m. UTC | #1
On Fri, 11 Dec 2015 15:05:08 +0100,
Takashi Iwai wrote:
> 
> On Fri, 11 Dec 2015 07:07:53 +0100,
> Libin Yang wrote:
> > 
> > Add Takashi and ALSA mail list.
> > 
> > On 12/10/2015 05:02 PM, Daniel Vetter wrote:
> > > On Tue, Dec 08, 2015 at 04:01:20PM +0800, Libin Yang wrote:
> > >> Hi all,
> > >>
> > >> Any comments on the patches?
> > >
> > > Sorry, simply fell through the cracks since Ander is on vacation. Takashi
> > > is working on some cleanup patches to have a port->encoder mapping for the
> > > audio side of i915. His patch cleans up all the existing audio code in
> > > i915, but please work together with him to align mst code with the new
> > > style.
> > >
> > > Both patches queued for next.
> > 
> > Yes, I have seen Takashi's patches. I will check the patches.
> 
> The patch like below should work; it sets/clears the reverse mapping
> dynamically for the MST encoder.

This might be too shortsighted and broken -- if multiple devices are
hook on the same port...

Now I wonder which graphics part actually corresponds to the HD-audio
widget.  So far, we supposed that each pin widget 0x05-0x07
corresponds to the digital port B-D in the fixed manner.  If so, how
is the case where two devices on the same port?  In the codec level,
we get an unsolicited event on the same pin but check with the
different device index.  What would be a unique index instead that can
be passed via the component ops?

Then, another question is which audio converter widget is used and how
is set up, if multiple devices were on the same pin.

Libin, do you have any git branch where MST really works?  I should
test it at first to confirm that it actually works on my test system.


thanks,

Takashi
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/intel_dp_mst.c b/drivers/gpu/drm/i915/intel_dp_mst.c
index 8b608c2cd070..87dad62fd10b 100644
--- a/drivers/gpu/drm/i915/intel_dp_mst.c
+++ b/drivers/gpu/drm/i915/intel_dp_mst.c
@@ -108,6 +108,7 @@  static void intel_mst_disable_dp(struct intel_encoder *encoder)
 	struct drm_i915_private *dev_priv = dev->dev_private;
 	struct drm_crtc *crtc = encoder->base.crtc;
 	struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
+	enum port port = intel_dig_port->port;
 
 	int ret;
 
@@ -122,6 +123,9 @@  static void intel_mst_disable_dp(struct intel_encoder *encoder)
 	if (intel_crtc->config->has_audio) {
 		intel_audio_codec_disable(encoder);
 		intel_display_power_put(dev_priv, POWER_DOMAIN_AUDIO);
+		mutex_lock(&dev_priv->av_mutex);
+		dev_priv->dig_port_map[port] = NULL;
+		mutex_unlock(&dev_priv->av_mutex);
 	}
 }
 
@@ -236,6 +240,9 @@  static void intel_mst_enable_dp(struct intel_encoder *encoder)
 	if (crtc->config->has_audio) {
 		DRM_DEBUG_DRIVER("Enabling DP audio on pipe %c\n",
 				 pipe_name(crtc->pipe));
+		mutex_lock(&dev_priv->av_mutex);
+		dev_priv->dig_port_map[port] = encoder;
+		mutex_unlock(&dev_priv->av_mutex);
 		intel_display_power_get(dev_priv, POWER_DOMAIN_AUDIO);
 		intel_audio_codec_enable(encoder);
 	}