<div dir="ltr">Hi<div class="gmail_extra"><br><div class="gmail_quote">On Sun, Nov 6, 2016 at 1:23 AM, Pandiyan, Dhinakaran <span dir="ltr"><<a href="mailto:dhinakaran.pandiyan@intel.com" target="_blank">dhinakaran.pandiyan@intel.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="gmail-">On Sat, 2016-11-05 at 21:40 +0200, Jani Nikula wrote:<br>
> On Fri, 04 Nov 2016, "Pandiyan, Dhinakaran" <<a href="mailto:dhinakaran.pandiyan@intel.com">dhinakaran.pandiyan@intel.com</a><wbr>> wrote:<br>
> > On Fri, 2016-11-04 at 17:48 +0200, Jani Nikula wrote:<br>
> >> On Wed, 26 Oct 2016, Dhinakaran Pandiyan <<a href="mailto:dhinakaran.pandiyan@intel.com">dhinakaran.pandiyan@intel.com</a><wbr>> wrote:<br>
> >> > Enabling DP audio stall fix is necessary to play audio over DP HBR2. So,<br>
> >> > let's set this bit right before enabling the audio codec. Playing audio<br>
> >> > without setting this bit results in pipe FIFO underruns.<br>
> >> ><br>
> >> > This workaround is applicable only for audio sample rates up to 96kHz. For<br>
> >> > frequencies above 96kHz, this is insufficient and cdclk should be increased<br>
> >> > to at least 432 MHz, just like BDW. Since, the audio driver does not<br>
> >> > support sample rates > 48 kHz, we are safe with this fix for now.<br>
> >><br>
> >> Do we still need this patch now that these two have been pushed?<br>
> >><br>
> >> b30ce9e0552a drm/i915/dp: BDW cdclk fix for DP audio<br>
> >> 9c7540241885 drm/i915/dp: Extend BDW DP audio workaround to GEN9 platforms<br>
> >><br>
> >> BR,<br>
> >> Jani.<br>
> >><br>
> >><br>
> >><br>
> ><br>
> > No, we are good afaik. This patch would have helped us to make use of a<br>
> > lower cdclk (337.5 MHz), with constraints on audio bit rate. Operating<br>
> > at 432 MHz, like we do now, rules out the need for this patch.<br>
><br>
> Hmm, what about 5.4 Gbps link with 1 or 2 lanes?<br>
><br>
> BR,<br>
> Jani.<br>
><br>
<br>
</span>Good point, I think it will depend on the audio sampling rate. But, I<br>
have to figure out a way to play high sampling rate audio (> 96 KHz) and<br>
test 5.4 Gbps with 1 or 2 lanes.<br>
<br>
The other option is to play safe and apply this patch with even lesser<br>
restrictions, say link rate >= 2.7 Gbps.<br>
<br>
<br>
-DK<br></blockquote><div><br></div><div>as we are currently talking about high samplerates in this context. I wanted to post a perhaps related issue. On my Apollo Lake (J4205) I have two outputs. One DVI and one HDMI 2.0 via internal DP. Via DVI the following works without issues, via DP it fails. As the original commit mentions HBR, I think there is still something missing. We submit TrueHD, DTS-HD via 192 khz and 16 bit format while setting AES0=2</div><div><br></div><div>You can easily reproduce with (you obviously need a DTS-HD, TrueHD capable AVR attached to your HDMI 2.0 (DP) out):</div><div><br></div>#TrueHD<br>aplay -D 'hdmi:CARD=PCH,DEV=0,AES0=2' -c8 -fs16_le -r192000 testi.truehd.anssi1.ff.60s.spdif<br>#DTS-HD<br>aplay -D 'hdmi:CARD=PCH,DEV=0,AES0=2' -c8 -fs16_le -r192000 testi.dtshd.anssi1.ma-71-24.spdif<div>Samples: <a href="http://www.avenard.org/files/media/mediatest/audiotest/HDAUDIO/Passthrough/">http://www.avenard.org/files/media/mediatest/audiotest/HDAUDIO/Passthrough/</a><br></div><div><br></div><div>For the old HDMI 1.x chips it was fixed via: <a href="https://bugs.freedesktop.org/show_bug.cgi?id=49055">https://bugs.freedesktop.org/show_bug.cgi?id=49055</a></div><div><br></div><div>Is this also planned for DP within that patch series?</div><div><br></div><div>Best regards</div><div>Peter </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div class="gmail-HOEnZb"><div class="gmail-h5"><br>
> ><br>
> > -DK<br>
> ><br>
> >> ><br>
> >> > v2: Inlined the code change within hsw_audio_codec_enable() (Jani)<br>
> >> >     Fixed the port clock typo<br>
> >> >     Added TODO comment<br>
> >> > Signed-off-by: Dhinakaran Pandiyan <<a href="mailto:dhinakaran.pandiyan@intel.com">dhinakaran.pandiyan@intel.com</a><wbr>><br>
> >> > ---<br>
> >> >  drivers/gpu/drm/i915/i915_reg.<wbr>h    |  5 +++++<br>
> >> >  drivers/gpu/drm/i915/intel_<wbr>audio.c | 30 +++++++++++++++++++++++++++++-<br>
> >> >  2 files changed, 34 insertions(+), 1 deletion(-)<br>
> >> ><br>
> >> > diff --git a/drivers/gpu/drm/i915/i915_<wbr>reg.h b/drivers/gpu/drm/i915/i915_<wbr>reg.h<br>
> >> > index 00efaa1..76dac48 100644<br>
> >> > --- a/drivers/gpu/drm/i915/i915_<wbr>reg.h<br>
> >> > +++ b/drivers/gpu/drm/i915/i915_<wbr>reg.h<br>
> >> > @@ -6236,6 +6236,11 @@ enum {<br>
> >> >  #define SLICE_ECO_CHICKEN0                      _MMIO(0x7308)<br>
> >> >  #define   PIXEL_MASK_CAMMING_DISABLE            (1 << 14)<br>
> >> ><br>
> >> > +#define _CHICKEN_TRANS_A        0x420C0<br>
> >> > +#define _CHICKEN_TRANS_B        0x420C4<br>
> >> > +#define CHICKEN_TRANS(tran) _MMIO_TRANS(tran, _CHICKEN_TRANS_A, _CHICKEN_TRANS_B)<br>
> >> > +#define SPARE_13        (1<<13)<br>
> >> > +<br>
> >> >  /* WaCatErrorRejectionIssue */<br>
> >> >  #define GEN7_SQ_CHICKEN_MBCUNIT_CONFIG          _MMIO(0x9030)<br>
> >> >  #define  GEN7_SQ_CHICKEN_MBCUNIT_<wbr>SQINTMOB       (1<<11)<br>
> >> > diff --git a/drivers/gpu/drm/i915/intel_<wbr>audio.c b/drivers/gpu/drm/i915/intel_<wbr>audio.c<br>
> >> > index 7093cfb..894f11e 100644<br>
> >> > --- a/drivers/gpu/drm/i915/intel_<wbr>audio.c<br>
> >> > +++ b/drivers/gpu/drm/i915/intel_<wbr>audio.c<br>
> >> > @@ -283,6 +283,8 @@ static void hsw_audio_codec_disable(struct intel_encoder *encoder)<br>
> >> >  {<br>
> >> >          struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);<br>
> >> >          struct intel_crtc *intel_crtc = to_intel_crtc(encoder->base.<wbr>crtc);<br>
> >> > +        struct intel_crtc_state *crtc_config =  intel_crtc->config;<br>
> >> > +        enum transcoder cpu_transcoder = crtc_config->cpu_transcoder;<br>
> >> >          enum pipe pipe = intel_crtc->pipe;<br>
> >> >          uint32_t tmp;<br>
> >> ><br>
> >> > @@ -290,13 +292,21 @@ static void hsw_audio_codec_disable(struct intel_encoder *encoder)<br>
> >> ><br>
> >> >          mutex_lock(&dev_priv->av_<wbr>mutex);<br>
> >> ><br>
> >> > +        /*Disable DP audio stall fix for HBR2*/<br>
> >> > +        if (IS_GEN9(dev_priv) && intel_crtc_has_dp_encoder(<wbr>crtc_config) &&<br>
> >> > +            crtc_config->port_clock >= 540000) {<br>
> >> > +                tmp = I915_READ(CHICKEN_TRANS(cpu_<wbr>transcoder));<br>
> >> > +                tmp &= ~SPARE_13;<br>
> >> > +                I915_WRITE(CHICKEN_TRANS(cpu_<wbr>transcoder), tmp);<br>
> >> > +        }<br>
> >> > +<br>
> >> >          /* Disable timestamps */<br>
> >> >          tmp = I915_READ(HSW_AUD_CFG(pipe));<br>
> >> >          tmp &= ~AUD_CONFIG_N_VALUE_INDEX;<br>
> >> >          tmp |= AUD_CONFIG_N_PROG_ENABLE;<br>
> >> >          tmp &= ~AUD_CONFIG_UPPER_N_MASK;<br>
> >> >          tmp &= ~AUD_CONFIG_LOWER_N_MASK;<br>
> >> > -        if (intel_crtc_has_dp_encoder(<wbr>intel_crtc->config))<br>
> >> > +        if (intel_crtc_has_dp_encoder(<wbr>crtc_config))<br>
> >> >                  tmp |= AUD_CONFIG_N_VALUE_INDEX;<br>
> >> >          I915_WRITE(HSW_AUD_CFG(pipe), tmp);<br>
> >> ><br>
> >> > @@ -315,6 +325,8 @@ static void hsw_audio_codec_enable(struct drm_connector *connector,<br>
> >> >  {<br>
> >> >          struct drm_i915_private *dev_priv = to_i915(connector->dev);<br>
> >> >          struct intel_crtc *intel_crtc = to_intel_crtc(intel_encoder-><wbr>base.crtc);<br>
> >> > +        struct intel_crtc_state *crtc_config =  intel_crtc->config;<br>
> >> > +        enum transcoder cpu_transcoder = crtc_config->cpu_transcoder;<br>
> >> >          enum pipe pipe = intel_crtc->pipe;<br>
> >> >          enum port port = intel_encoder->port;<br>
> >> >          const uint8_t *eld = connector->eld;<br>
> >> > @@ -326,6 +338,22 @@ static void hsw_audio_codec_enable(struct drm_connector *connector,<br>
> >> ><br>
> >> >          mutex_lock(&dev_priv->av_<wbr>mutex);<br>
> >> ><br>
> >> > +        /* Enable DP audio stall fix for HBR2<br>
> >> > +         *<br>
> >> > +         * TODO: This workaround is applicable only for audio sample rates up<br>
> >> > +         * to 96kHz. For frequencies above 96kHz, this is insufficient and<br>
> >> > +         * cdclk should be increased to at least 432 MHz, just like BDW. Since,<br>
> >> > +         * the audio driver does not support sample rates > 48 kHz, we are safe<br>
> >> > +         * with this fix for now.<br>
> >> > +         */<br>
> >> > +<br>
> >> > +        if (IS_GEN9(dev_priv) && intel_crtc_has_dp_encoder(<wbr>crtc_config) &&<br>
> >> > +            crtc_config->port_clock >= 540000) {<br>
> >> > +                tmp = I915_READ(CHICKEN_TRANS(cpu_<wbr>transcoder));<br>
> >> > +                tmp |= SPARE_13;<br>
> >> > +                I915_WRITE(CHICKEN_TRANS(cpu_<wbr>transcoder), tmp);<br>
> >> > +        }<br>
> >> > +<br>
> >> >          /* Enable audio presence detect, invalidate ELD */<br>
> >> >          tmp = I915_READ(HSW_AUD_PIN_ELD_CP_<wbr>VLD);<br>
> >> >          tmp |= AUDIO_OUTPUT_ENABLE(pipe);<br>
> >><br>
> ><br>
><br>
<br>
</div></div><div class="gmail-HOEnZb"><div class="gmail-h5">______________________________<wbr>_________________<br>
Intel-gfx mailing list<br>
<a href="mailto:Intel-gfx@lists.freedesktop.org">Intel-gfx@lists.freedesktop.<wbr>org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/intel-gfx" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/intel-gfx</a><br>
</div></div></blockquote></div><br></div></div>