[Intel-gfx] [PATCH v2 1/2] drm/i915/dp: Enable DP audio stall fix for gen9 platforms
Daniel Vetter
daniel at ffwll.ch
Wed Oct 26 06:37:22 UTC 2016
On Mon, Oct 24, 2016 at 09:18:36PM -0700, Dhinakaran Pandiyan wrote:
> Enabling DP audio stall fix is necessary to play audio over DP HBR2. So,
> let's set this bit right before enabling the audio codec. Playing audio
> without setting this bit results in pipe FIFO underruns.
Please insert a full Bspec citation here so that we can find where this is
documented in the future. Both where in Bspec it is, and then just quote
the full text with the explanation and put that into the commit message.
Otherwise there's no way we'll ever find this again in the future.
-Daniel
>
> Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan at intel.com>
> ---
> drivers/gpu/drm/i915/i915_reg.h | 5 +++++
> drivers/gpu/drm/i915/intel_ddi.c | 38 ++++++++++++++++++++++++++++++++++++++
> drivers/gpu/drm/i915/intel_drv.h | 2 ++
> 3 files changed, 45 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
> index 00efaa1..76dac48 100644
> --- a/drivers/gpu/drm/i915/i915_reg.h
> +++ b/drivers/gpu/drm/i915/i915_reg.h
> @@ -6236,6 +6236,11 @@ enum {
> #define SLICE_ECO_CHICKEN0 _MMIO(0x7308)
> #define PIXEL_MASK_CAMMING_DISABLE (1 << 14)
>
> +#define _CHICKEN_TRANS_A 0x420C0
> +#define _CHICKEN_TRANS_B 0x420C4
> +#define CHICKEN_TRANS(tran) _MMIO_TRANS(tran, _CHICKEN_TRANS_A, _CHICKEN_TRANS_B)
> +#define SPARE_13 (1<<13)
> +
> /* WaCatErrorRejectionIssue */
> #define GEN7_SQ_CHICKEN_MBCUNIT_CONFIG _MMIO(0x9030)
> #define GEN7_SQ_CHICKEN_MBCUNIT_SQINTMOB (1<<11)
> diff --git a/drivers/gpu/drm/i915/intel_ddi.c b/drivers/gpu/drm/i915/intel_ddi.c
> index fb18d69..84c91c1 100644
> --- a/drivers/gpu/drm/i915/intel_ddi.c
> +++ b/drivers/gpu/drm/i915/intel_ddi.c
> @@ -1858,6 +1858,38 @@ void intel_ddi_fdi_post_disable(struct intel_encoder *intel_encoder,
> I915_WRITE(FDI_RX_CTL(PIPE_A), val);
> }
>
> +void gen9_enable_dp_audio_stall_fix(struct intel_crtc_state *pipe_config)
> +{
> + struct drm_i915_private *dev_priv =
> + to_i915(pipe_config->base.crtc->dev);
> + enum transcoder cpu_transcoder = pipe_config->cpu_transcoder;
> + uint32_t temp;
> +
> + if (intel_crtc_has_dp_encoder(pipe_config) &&
> + pipe_config->port_clock >= 54000) {
> +
> + temp = I915_READ(CHICKEN_TRANS(cpu_transcoder));
> + temp |= SPARE_13;
> + I915_WRITE(CHICKEN_TRANS(cpu_transcoder), temp);
> + }
> +}
> +
> +void gen9_disable_dp_audio_stall_fix(struct intel_crtc_state *pipe_config)
> +{
> + struct drm_i915_private *dev_priv =
> + to_i915(pipe_config->base.crtc->dev);
> + enum transcoder cpu_transcoder = pipe_config->cpu_transcoder;
> + uint32_t temp;
> +
> + if (intel_crtc_has_dp_encoder(pipe_config) &&
> + pipe_config->port_clock >= 54000) {
> +
> + temp = I915_READ(CHICKEN_TRANS(cpu_transcoder));
> + temp &= ~SPARE_13;
> + I915_WRITE(CHICKEN_TRANS(cpu_transcoder), temp);
> + }
> +}
> +
> static void intel_enable_ddi(struct intel_encoder *intel_encoder,
> struct intel_crtc_state *pipe_config,
> struct drm_connector_state *conn_state)
> @@ -1893,6 +1925,9 @@ static void intel_enable_ddi(struct intel_encoder *intel_encoder,
> }
>
> if (intel_crtc->config->has_audio) {
> + if (IS_GEN9(dev_priv))
> + gen9_enable_dp_audio_stall_fix(pipe_config);
> +
> intel_display_power_get(dev_priv, POWER_DOMAIN_AUDIO);
> intel_audio_codec_enable(intel_encoder);
> }
> @@ -1912,6 +1947,9 @@ static void intel_disable_ddi(struct intel_encoder *intel_encoder,
> if (intel_crtc->config->has_audio) {
> intel_audio_codec_disable(intel_encoder);
> intel_display_power_put(dev_priv, POWER_DOMAIN_AUDIO);
> +
> + if (IS_GEN9(dev_priv))
> + gen9_disable_dp_audio_stall_fix(old_crtc_state);
> }
>
> if (type == INTEL_OUTPUT_EDP) {
> diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
> index 4e90b07..ef02c62 100644
> --- a/drivers/gpu/drm/i915/intel_drv.h
> +++ b/drivers/gpu/drm/i915/intel_drv.h
> @@ -1189,6 +1189,8 @@ unsigned int intel_fb_align_height(struct drm_device *dev,
> uint64_t fb_format_modifier);
> u32 intel_fb_stride_alignment(const struct drm_i915_private *dev_priv,
> uint64_t fb_modifier, uint32_t pixel_format);
> +void gen9_enable_dp_audio_stall_fix(struct intel_crtc_state *pipe_config);
> +void gen9_disable_dp_audio_stall_fix(struct intel_crtc_state *pipe_config);
>
> /* intel_audio.c */
> void intel_init_audio_hooks(struct drm_i915_private *dev_priv);
> --
> 2.7.4
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
More information about the Intel-gfx
mailing list