<div dir="ltr">Forgot to CC the list, sorry.</div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jan 4, 2017 at 11:42 AM, Peter Frühberger <span dir="ltr"><<a href="mailto:fritsch@kodi.tv" target="_blank">fritsch@kodi.tv</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi Jani,<div>thanks for your reply</div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On Wed, Jan 4, 2017 at 10:34 AM, Jani Nikula <span dir="ltr"><<a href="mailto:jani.nikula@intel.com" target="_blank">jani.nikula@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"><div class="m_-1206728804480770734gmail-HOEnZb"><div class="m_-1206728804480770734gmail-h5">On Wed, 04 Jan 2017, Peter Frühberger <<a href="mailto:fritsch@kodi.tv" target="_blank">fritsch@kodi.tv</a>> wrote:<br>
> Hi<br>
><br>
> On Sun, Nov 6, 2016 at 1:23 AM, Pandiyan, Dhinakaran <<br>
> <a href="mailto:dhinakaran.pandiyan@intel.com" target="_blank">dhinakaran.pandiyan@intel.com</a>> wrote:<br>
><br>
>> On Sat, 2016-11-05 at 21:40 +0200, Jani Nikula wrote:<br>
>> > On Fri, 04 Nov 2016, "Pandiyan, Dhinakaran" <<br>
>> <a href="mailto:dhinakaran.pandiyan@intel.com" target="_blank">dhinakaran.pandiyan@intel.com</a>> wrote:<br>
>> > > On Fri, 2016-11-04 at 17:48 +0200, Jani Nikula wrote:<br>
>> > >> On Wed, 26 Oct 2016, Dhinakaran Pandiyan <<br>
>> <a href="mailto:dhinakaran.pandiyan@intel.com" target="_blank">dhinakaran.pandiyan@intel.com</a>> wrote:<br>
>> > >> > Enabling DP audio stall fix is necessary to play audio over DP<br>
>> HBR2. So,<br>
>> > >> > let's set this bit right before enabling the audio codec. Playing<br>
>> audio<br>
>> > >> > without setting this bit results in pipe FIFO underruns.<br>
>> > >> ><br>
>> > >> > This workaround is applicable only for audio sample rates up to<br>
>> 96kHz. For<br>
>> > >> > frequencies above 96kHz, this is insufficient and cdclk should be<br>
>> 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<br>
>> 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>
>> 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>
>><br>
><br>
> as we are currently talking about high samplerates in this context. I<br>
> wanted to post a perhaps related issue. On my Apollo Lake (J4205) I have<br>
> two outputs. One DVI and one HDMI 2.0 via internal DP. Via DVI the<br>
> following works without issues, via DP it fails. As the original commit<br>
> mentions HBR, I think there is still something missing. We submit TrueHD,<br>
> DTS-HD via 192 khz and 16 bit format while setting AES0=2<br>
><br>
> You can easily reproduce with (you obviously need a DTS-HD, TrueHD capable<br>
> AVR attached to your HDMI 2.0 (DP) out):<br>
<br>
</div></div>Just to clarify, is the DP -> HDMI2.0 converter internal to the machine?<br>
LSPCON related messages in the dmesg with drm.debug=14? Do you have a DP<br>
or an HDMI physical connector in the chassis?<br></blockquote><div><br></div></div></div><div>The chip used is: <a href="https://media.digikey.com/pdf/Data%20Sheets/MegaChips%20PDFs/MCDP28x0_Datasheet.pdf" target="_blank">https://media.digikey.com/pdf/<wbr>Data%20Sheets/MegaChips%<wbr>20PDFs/MCDP28x0_Datasheet.pdf</a> which is the same on all intel nucs, including the new Kabilake ones. So it's internal. </div><div>Mainboard: <a href="http://www.asrock.com/MB/Intel/J4205-ITX/index.us.asp" target="_blank">http://www.asrock.<wbr>com/MB/Intel/J4205-ITX/index.<wbr>us.asp</a> (DVI-D, HDMI (2.0 via this above chip), VGA)</div><div>Here is the output of the a boot up with drm.debug=14:  <a href="http://paste.ubuntu.com/23738282/" target="_blank">http://paste.ubuntu.com/<wbr>23738282/</a></div><div>(I used a pastebin site to not spam the ML, is that okay for the future?)</div><div><br></div><div>Best regards</div><span class="HOEnZb"><font color="#888888"><div>Peter</div></font></span><div><div class="h5"><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
<br>
BR,<br>
Jani.<br>
<div class="m_-1206728804480770734gmail-HOEnZb"><div class="m_-1206728804480770734gmail-h5"><br>
><br>
> #TrueHD<br>
> aplay -D 'hdmi:CARD=PCH,DEV=0,AES0=2' -c8 -fs16_le -r192000<br>
> testi.truehd.anssi1.ff.60s.spd<wbr>if<br>
> #DTS-HD<br>
> aplay -D 'hdmi:CARD=PCH,DEV=0,AES0=2' -c8 -fs16_le -r192000<br>
> testi.dtshd.anssi1.ma-71-24.sp<wbr>dif<br>
> Samples:<br>
> <a href="http://www.avenard.org/files/media/mediatest/audiotest/HDAUDIO/Passthrough/" rel="noreferrer" target="_blank">http://www.avenard.org/files/m<wbr>edia/mediatest/audiotest/HDAUD<wbr>IO/Passthrough/</a><br>
><br>
> For the old HDMI 1.x chips it was fixed via:<br>
> <a href="https://bugs.freedesktop.org/show_bug.cgi?id=49055" rel="noreferrer" target="_blank">https://bugs.freedesktop.org/s<wbr>how_bug.cgi?id=49055</a><br>
><br>
> Is this also planned for DP within that patch series?<br>
><br>
> Best regards<br>
> Peter<br>
><br>
>><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" target="_blank">dhinakaran.pandiyan@intel.com</a><wbr>><br>
>> > >> > ---<br>
>> > >> >  drivers/gpu/drm/i915/i915_reg.<wbr>h    |  5 +++++<br>
>> > >> >  drivers/gpu/drm/i915/intel_aud<wbr>io.c | 30<br>
>> +++++++++++++++++++++++++++++-<br>
>> > >> >  2 files changed, 34 insertions(+), 1 deletion(-)<br>
>> > >> ><br>
>> > >> > diff --git a/drivers/gpu/drm/i915/i915_re<wbr>g.h<br>
>> b/drivers/gpu/drm/i915/i915_re<wbr>g.h<br>
>> > >> > index 00efaa1..76dac48 100644<br>
>> > >> > --- a/drivers/gpu/drm/i915/i915_re<wbr>g.h<br>
>> > >> > +++ b/drivers/gpu/drm/i915/i915_re<wbr>g.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,<br>
>> _CHICKEN_TRANS_B)<br>
>> > >> > +#define SPARE_13        (1<<13)<br>
>> > >> > +<br>
>> > >> >  /* WaCatErrorRejectionIssue */<br>
>> > >> >  #define GEN7_SQ_CHICKEN_MBCUNIT_<wbr>CONFIG          _MMIO(0x9030)<br>
>> > >> >  #define  GEN7_SQ_CHICKEN_MBCUNIT_SQINTM<wbr>OB       (1<<11)<br>
>> > >> > diff --git a/drivers/gpu/drm/i915/intel_a<wbr>udio.c<br>
>> b/drivers/gpu/drm/i915/intel_a<wbr>udio.c<br>
>> > >> > index 7093cfb..894f11e 100644<br>
>> > >> > --- a/drivers/gpu/drm/i915/intel_a<wbr>udio.c<br>
>> > >> > +++ b/drivers/gpu/drm/i915/intel_a<wbr>udio.c<br>
>> > >> > @@ -283,6 +283,8 @@ static void hsw_audio_codec_disable(struct<br>
>> intel_encoder *encoder)<br>
>> > >> >  {<br>
>> > >> >          struct drm_i915_private *dev_priv =<br>
>> to_i915(encoder->base.dev);<br>
>> > >> >          struct intel_crtc *intel_crtc =<br>
>> to_intel_crtc(encoder-><a href="http://base.cr">base.cr</a><wbr>tc);<br>
>> > >> > +        struct intel_crtc_state *crtc_config =  intel_crtc->config;<br>
>> > >> > +        enum transcoder cpu_transcoder =<br>
>> 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<br>
>> intel_encoder *encoder)<br>
>> > >> ><br>
>> > >> >          mutex_lock(&dev_priv->av_mutex<wbr>);<br>
>> > >> ><br>
>> > >> > +        /*Disable DP audio stall fix for HBR2*/<br>
>> > >> > +        if (IS_GEN9(dev_priv) && intel_crtc_has_dp_encoder(crtc<wbr>_config)<br>
>> &&<br>
>> > >> > +            crtc_config->port_clock >= 540000) {<br>
>> > >> > +                tmp = I915_READ(CHICKEN_TRANS(cpu_tr<wbr>anscoder));<br>
>> > >> > +                tmp &= ~SPARE_13;<br>
>> > >> > +                I915_WRITE(CHICKEN_TRANS(cpu_t<wbr>ranscoder), 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(int<wbr>el_crtc->config))<br>
>> > >> > +        if (intel_crtc_has_dp_encoder(crt<wbr>c_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<br>
>> drm_connector *connector,<br>
>> > >> >  {<br>
>> > >> >          struct drm_i915_private *dev_priv =<br>
>> to_i915(connector->dev);<br>
>> > >> >          struct intel_crtc *intel_crtc =<br>
>> to_intel_crtc(intel_encoder->b<wbr>ase.crtc);<br>
>> > >> > +        struct intel_crtc_state *crtc_config =  intel_crtc->config;<br>
>> > >> > +        enum transcoder cpu_transcoder =<br>
>> 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<br>
>> drm_connector *connector,<br>
>> > >> ><br>
>> > >> >          mutex_lock(&dev_priv->av_mutex<wbr>);<br>
>> > >> ><br>
>> > >> > +        /* Enable DP audio stall fix for HBR2<br>
>> > >> > +         *<br>
>> > >> > +         * TODO: This workaround is applicable only for audio<br>
>> sample rates up<br>
>> > >> > +         * to 96kHz. For frequencies above 96kHz, this is<br>
>> insufficient and<br>
>> > >> > +         * cdclk should be increased to at least 432 MHz, just<br>
>> like BDW. Since,<br>
>> > >> > +         * the audio driver does not support sample rates > 48<br>
>> kHz, we are safe<br>
>> > >> > +         * with this fix for now.<br>
>> > >> > +         */<br>
>> > >> > +<br>
>> > >> > +        if (IS_GEN9(dev_priv) && intel_crtc_has_dp_encoder(crtc<wbr>_config)<br>
>> &&<br>
>> > >> > +            crtc_config->port_clock >= 540000) {<br>
>> > >> > +                tmp = I915_READ(CHICKEN_TRANS(cpu_tr<wbr>anscoder));<br>
>> > >> > +                tmp |= SPARE_13;<br>
>> > >> > +                I915_WRITE(CHICKEN_TRANS(cpu_t<wbr>ranscoder), tmp);<br>
>> > >> > +        }<br>
>> > >> > +<br>
>> > >> >          /* Enable audio presence detect, invalidate ELD */<br>
>> > >> >          tmp = I915_READ(HSW_AUD_PIN_ELD_CP_V<wbr>LD);<br>
>> > >> >          tmp |= AUDIO_OUTPUT_ENABLE(pipe);<br>
>> > >><br>
>> > ><br>
>> ><br>
>><br>
>> ______________________________<wbr>_________________<br>
>> Intel-gfx mailing list<br>
>> <a href="mailto:Intel-gfx@lists.freedesktop.org" target="_blank">Intel-gfx@lists.freedesktop.or<wbr>g</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>
>><br>
<br>
</div></div><div class="m_-1206728804480770734gmail-HOEnZb"><div class="m_-1206728804480770734gmail-h5">--<br>
Jani Nikula, Intel Open Source Technology Center<br>
</div></div></blockquote></div></div></div><br></div></div>
</blockquote></div><br></div>