Pass pipe to LPE audio
Subsystems (3)
cover Pass pipe to LPE audio
Hi,
this is a patch series to pass the pipe over LPE audio notification, based on Pierre's latest patchset ("[RFC PATCH 0/5] DisplayPort Audio on Cherrytrail").
Takashi
===
Takashi Iwai (3):
drm/i915: Avoid MST pipe handling for LPE audio drm/i915: Pass pipe to LPE audio notification
ALSA: x86: Use config base depending on the pipe
drivers/gpu/drm/i915/i915_drv.h | 2 +- drivers/gpu/drm/i915/intel_audio.c | 27 ++++++++++++++------------- drivers/gpu/drm/i915/intel_lpe_audio.c | 3 ++- include/drm/intel_lpe_audio.h | 1 + sound/x86/intel_hdmi_lpe_audio.c | 32 +++++++++++++++++++++----------- 5 files changed, 39 insertions(+), 26 deletions(-)
Signature · 6 lines
2.11.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
RFC PATCH 1/3 drm/i915: Avoid MST pipe handling for LPE audio
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.
--- drivers/gpu/drm/i915/intel_audio.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-)
drivers/gpu/drm/i915/intel_audio.c +11 -10
@@ -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 ); }
Signature · 6 lines
2.11.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [alsa-devel] [PATCH RFC 1/3] drm/i915: Avoid MST pipe handling for LPE audio
Quoted 22 lines · Takashi Iwai
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 <[email protected]>Signed-off-by Takashi Iwai <[email protected]>--- drivers/gpu/drm/i915/intel_audio.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-)drivers/gpu/drm/i915/intel_audio.c +0
-3@@ -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 ;
drivers/gpu/drm/i915/intel_audio.c void intel_audio_codec_enable(struct intel_encoder *intel_encoder, · line 634
Quoted 10 lines
drivers/gpu/drm/i915/intel_audio.c +6
-2- -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?
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [alsa-devel] [PATCH RFC 1/3] drm/i915: Avoid MST pipe handling for LPE audio
Quoted 29 lines · Pierre-Louis Bossart
Quoted 25 lines · Takashi Iwai
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 <[email protected]>Signed-off-by Takashi Iwai <[email protected]>--- drivers/gpu/drm/i915/intel_audio.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-)drivers/gpu/drm/i915/intel_audio.c +2
-4@@ -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 */
Quoted 8 lines
drivers/gpu/drm/i915/intel_audio.c void intel_audio_codec_enable(struct intel_encoder *intel_encoder, · line 634
Quoted 6 lines
drivers/gpu/drm/i915/intel_audio.c +4
-0+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
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
RFC PATCH 2/3 drm/i915: Pass pipe to LPE audio notification
In reply to Takashi IwaiThe LPE audio configuration depends on the pipe, thus we need to pass the currently used pipe. It's now embedded in struct intel_hdmi_lpe_audio_eld as well as port id.
--- drivers/gpu/drm/i915/i915_drv.h | 2 +- drivers/gpu/drm/i915/intel_audio.c | 6 +++--- drivers/gpu/drm/i915/intel_lpe_audio.c | 3 ++- include/drm/intel_lpe_audio.h | 1 + 4 files changed, 7 insertions(+), 5 deletions(-)
drivers/gpu/drm/i915/i915_drv.h +1 -1
@@ -3400,7 +3400,7 @@ int intel_lpe_audio_init(struct drm_i915_private *dev_priv);void intel_lpe_audio_teardown (struct drm_i915_private *dev_priv);void intel_lpe_audio_irq_handler (struct drm_i915_private *dev_priv);void intel_lpe_audio_notify (struct drm_i915_private *dev_priv, -void *eld,int port,int tmds_clk_speed, +void *eld,int port,int pipe,int tmds_clk_speed,bool dp_output,int link_rate);/* intel_i2c.c */
drivers/gpu/drm/i915/intel_audio.c +3 -3
@@ -634,12 +634,12 @@ void intel_audio_codec_enable(struct intel_encoder *intel_encoder,switch (intel_encoder->type) {case INTEL_OUTPUT_HDMI : -intel_lpe_audio_notify (dev_priv, connector->eld, port, +intel_lpe_audio_notify (dev_priv, connector->eld, port, pipe, crtc_state->port_clock, false,0 );break ;case INTEL_OUTPUT_DP : -intel_lpe_audio_notify (dev_priv, connector->eld, port, +intel_lpe_audio_notify (dev_priv, connector->eld, port, pipe, adjusted_mode->crtc_clock, true, crtc_state->port_clock);break ;
@@ -680,7 +680,7 @@ void intel_audio_codec_disable(struct intel_encoder *intel_encoder) (int) port, (int) pipe); } -intel_lpe_audio_notify (dev_priv,NULL , port,0 , false,0 ); +intel_lpe_audio_notify (dev_priv,NULL , port, pipe,0 , false,0 ); }/**
drivers/gpu/drm/i915/intel_lpe_audio.c +2 -1
@@ -341,7 +341,7 @@ void intel_lpe_audio_teardown(struct drm_i915_private *dev_priv)* Notify lpe audio driver of eld change. */ void intel_lpe_audio_notify (struct drm_i915_private *dev_priv, -void *eld,int port,int tmds_clk_speed, +void *eld,int port,int pipe,int tmds_clk_speed,bool dp_output,int link_rate) {unsigned long irq_flags;
@@ -359,6 +359,7 @@ void intel_lpe_audio_notify(struct drm_i915_private *dev_priv,memcpy (pdata->eld.eld_data, eld,HDMI_MAX_ELD_BYTES ); pdata->eld.port_id = port; + pdata->eld.pipe_id = pipe; pdata->hdmi_connected = true; pdata->dp_output = dp_output;
include/drm/intel_lpe_audio.h +1 -0
@@ -31,6 +31,7 @@struct intel_hdmi_lpe_audio_eld {int port_id; +int pipe_id;unsigned char eld_data[HDMI_MAX_ELD_BYTES ]; };
Signature · 6 lines
2.11.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
RFC PATCH 3/3 ALSA: x86: Use config base depending on the pipe
In reply to Takashi IwaiNow the pipe that is being used is passed over i915 notification, we can re-setup the had_config_offset depending on it at the hotplug. This allows, at least, the stream transfer on the second DP working on Dell Wyse 3040 box here (although it's still not audible by other reasons).
--- sound/x86/intel_hdmi_lpe_audio.c | 32 +++++++++++++++++++++----------- 1 file changed, 21 insertions(+), 11 deletions(-)
sound/x86/intel_hdmi_lpe_audio.c +21 -11
@@ -463,6 +463,22 @@ static void notify_audio_lpe(void *audio_ptr) }else if (eld !=NULL ) { +switch (eld->pipe_id) { +case 0 : + ctx->had_config_offset =AUDIO_HDMI_CONFIG_A ; +break ; +case 1 : + ctx->had_config_offset =AUDIO_HDMI_CONFIG_B ; +break ; +case 2 : + ctx->had_config_offset =AUDIO_HDMI_CONFIG_C ; +break ; +default : +dev_dbg (&hlpe_pdev->dev,"Invalid pipe %d\n" , + eld->pipe_id); +break ; + } +hdmi_set_eld (eld->eld_data);mid_hdmi_audio_signal_event (HAD_EVENT_HOT_PLUG );
@@ -560,21 +576,15 @@ static int hdmi_lpe_audio_probe(struct platform_device *pdev) ctx->mmio_start = mmio_start; ctx->tmds_clock_speed =DIS_SAMPLE_RATE_148_5 ; -if (pci_dev_present (cherryview_ids)) { +if (pci_dev_present (cherryview_ids))dev_dbg (&hlpe_pdev->dev,"%s: Cherrytrail LPE - Detected\n" , __func__); -//ctx->had_config_offset = AUDIO_HDMI_CONFIG_C; -/* FIXME: hard-coding to CONFIG_A enables DP audio on CHT, -* how do I find out which config to use ? -* the pipe is -1 (invalid) when the notify function is called, -* so not sure how to go about this -*/ - ctx->had_config_offset =AUDIO_HDMI_CONFIG_A ; - }else { +else dev_dbg (&hlpe_pdev->dev,"%s: Baytrail LPE - Assume\n" , __func__); - ctx->had_config_offset =AUDIO_HDMI_CONFIG_A ; - } + +/* assume pipe A as default */ + ctx->had_config_offset =AUDIO_HDMI_CONFIG_A ; pdata = pdev->dev.platform_data;
Signature · 6 lines
2.11.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx