[Intel-gfx] [PATCH V4 2/2] drm/i915: start adding dp mst audio

Takashi Iwai tiwai at suse.de
Fri Dec 11 06:05:08 PST 2015


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

---
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);
 	}


More information about the Intel-gfx mailing list