diff mbox

[RFC,1/3] drm/i915: Avoid MST pipe handling for LPE audio

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

Commit Message

Takashi Iwai Jan. 27, 2017, 10:36 a.m. UTC
The pipe gets cleared to -1 for non-MST before the ELD audio
notification due to the MST audio support.  This makes sense for
HD-audio that received the MST handling, but it's useless for LPE
audio.  Handle the MST pipe hack conditionally only for HD-audio.

Reported-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
 drivers/gpu/drm/i915/intel_audio.c | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

Comments

Pierre-Louis Bossart Jan. 27, 2017, 2:15 p.m. UTC | #1
On 01/27/2017 04:36 AM, Takashi Iwai wrote:
> The pipe gets cleared to -1 for non-MST before the ELD audio
> notification due to the MST audio support.  This makes sense for
> HD-audio that received the MST handling, but it's useless for LPE
> audio.  Handle the MST pipe hack conditionally only for HD-audio.
>
> Reported-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
> Signed-off-by: Takashi Iwai <tiwai@suse.de>
> ---
>   drivers/gpu/drm/i915/intel_audio.c | 21 +++++++++++----------
>   1 file changed, 11 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_audio.c b/drivers/gpu/drm/i915/intel_audio.c
> index 1645ce42b898..d4e6d1136cfe 100644
> --- a/drivers/gpu/drm/i915/intel_audio.c
> +++ b/drivers/gpu/drm/i915/intel_audio.c
> @@ -624,13 +624,14 @@ void intel_audio_codec_enable(struct intel_encoder *intel_encoder,
>   	dev_priv->av_enc_map[pipe] = intel_encoder;
>   	mutex_unlock(&dev_priv->av_mutex);
>   
> -	/* audio drivers expect pipe = -1 to indicate Non-MST cases */
> -	if (intel_encoder->type != INTEL_OUTPUT_DP_MST)
> -		pipe = -1;
> -
> -	if (acomp && acomp->audio_ops && acomp->audio_ops->pin_eld_notify)
> +	if (acomp && acomp->audio_ops && acomp->audio_ops->pin_eld_notify) {
> +		/* audio drivers expect pipe = -1 to indicate Non-MST cases */
> +		if (intel_encoder->type != INTEL_OUTPUT_DP_MST)
> +			pipe = -1;
>   		acomp->audio_ops->pin_eld_notify(acomp->audio_ops->audio_ptr,
>   						 (int) port, (int) pipe);
> +	}
> +
Cool. I missed this part, couldn't figure out where the -1 was coming from.
So do you get audio working on both of the DP ports now?
Takashi Iwai Jan. 27, 2017, 2:17 p.m. UTC | #2
On Fri, 27 Jan 2017 15:15:14 +0100,
Pierre-Louis Bossart wrote:
> 
> 
> 
> On 01/27/2017 04:36 AM, Takashi Iwai wrote:
> > The pipe gets cleared to -1 for non-MST before the ELD audio
> > notification due to the MST audio support.  This makes sense for
> > HD-audio that received the MST handling, but it's useless for LPE
> > audio.  Handle the MST pipe hack conditionally only for HD-audio.
> >
> > Reported-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
> > Signed-off-by: Takashi Iwai <tiwai@suse.de>
> > ---
> >   drivers/gpu/drm/i915/intel_audio.c | 21 +++++++++++----------
> >   1 file changed, 11 insertions(+), 10 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/i915/intel_audio.c b/drivers/gpu/drm/i915/intel_audio.c
> > index 1645ce42b898..d4e6d1136cfe 100644
> > --- a/drivers/gpu/drm/i915/intel_audio.c
> > +++ b/drivers/gpu/drm/i915/intel_audio.c
> > @@ -624,13 +624,14 @@ void intel_audio_codec_enable(struct intel_encoder *intel_encoder,
> >   	dev_priv->av_enc_map[pipe] = intel_encoder;
> >   	mutex_unlock(&dev_priv->av_mutex);
> >   -	/* audio drivers expect pipe = -1 to indicate Non-MST cases */
> > -	if (intel_encoder->type != INTEL_OUTPUT_DP_MST)
> > -		pipe = -1;
> > -
> > -	if (acomp && acomp->audio_ops && acomp->audio_ops->pin_eld_notify)
> > +	if (acomp && acomp->audio_ops && acomp->audio_ops->pin_eld_notify) {
> > +		/* audio drivers expect pipe = -1 to indicate Non-MST cases */
> > +		if (intel_encoder->type != INTEL_OUTPUT_DP_MST)
> > +			pipe = -1;
> >   		acomp->audio_ops->pin_eld_notify(acomp->audio_ops->audio_ptr,
> >   						 (int) port, (int) pipe);
> > +	}
> > +
> Cool. I missed this part, couldn't figure out where the -1 was coming from.
> So do you get audio working on both of the DP ports now?

DP1 is working now.
DP3 starts streaming, but no audio came out yet :-<


Takashi
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/intel_audio.c b/drivers/gpu/drm/i915/intel_audio.c
index 1645ce42b898..d4e6d1136cfe 100644
--- a/drivers/gpu/drm/i915/intel_audio.c
+++ b/drivers/gpu/drm/i915/intel_audio.c
@@ -624,13 +624,14 @@  void intel_audio_codec_enable(struct intel_encoder *intel_encoder,
 	dev_priv->av_enc_map[pipe] = intel_encoder;
 	mutex_unlock(&dev_priv->av_mutex);
 
-	/* audio drivers expect pipe = -1 to indicate Non-MST cases */
-	if (intel_encoder->type != INTEL_OUTPUT_DP_MST)
-		pipe = -1;
-
-	if (acomp && acomp->audio_ops && acomp->audio_ops->pin_eld_notify)
+	if (acomp && acomp->audio_ops && acomp->audio_ops->pin_eld_notify) {
+		/* audio drivers expect pipe = -1 to indicate Non-MST cases */
+		if (intel_encoder->type != INTEL_OUTPUT_DP_MST)
+			pipe = -1;
 		acomp->audio_ops->pin_eld_notify(acomp->audio_ops->audio_ptr,
 						 (int) port, (int) pipe);
+	}
+
 	switch (intel_encoder->type) {
 	case INTEL_OUTPUT_HDMI:
 		intel_lpe_audio_notify(dev_priv, connector->eld, port,
@@ -671,13 +672,13 @@  void intel_audio_codec_disable(struct intel_encoder *intel_encoder)
 	dev_priv->av_enc_map[pipe] = NULL;
 	mutex_unlock(&dev_priv->av_mutex);
 
-	/* audio drivers expect pipe = -1 to indicate Non-MST cases */
-	if (intel_encoder->type != INTEL_OUTPUT_DP_MST)
-		pipe = -1;
-
-	if (acomp && acomp->audio_ops && acomp->audio_ops->pin_eld_notify)
+	if (acomp && acomp->audio_ops && acomp->audio_ops->pin_eld_notify) {
+		/* audio drivers expect pipe = -1 to indicate Non-MST cases */
+		if (intel_encoder->type != INTEL_OUTPUT_DP_MST)
+			pipe = -1;
 		acomp->audio_ops->pin_eld_notify(acomp->audio_ops->audio_ptr,
 						 (int) port, (int) pipe);
+	}
 
 	intel_lpe_audio_notify(dev_priv, NULL, port, 0, false, 0);
 }