All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@intel.com>
To: Abhay Kumar <abhay.kumar@intel.com>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH v2] drm/i915: set minimum CD clock to twice the BCLK.
Date: Fri, 06 Apr 2018 16:47:08 +0300	[thread overview]
Message-ID: <878ta0la5f.fsf@intel.com> (raw)
In-Reply-To: <1522960670-29948-1-git-send-email-abhay.kumar@intel.com>

On Thu, 05 Apr 2018, Abhay Kumar <abhay.kumar@intel.com> wrote:
> In glk when device boots with 1366x768 panel, HDA codec doesn't comeup.
> This result in no audio forever as cdclk is < 96Mhz.
> This chagne will ensure CD clock to be twice of  BCLK.

In short, we can't poke around CDCLK like this. It needs a full modeset,
and it's non-trivial from the path you're calling this from.

I'm considering pushing the original patch [1], because we haven't come
up with working alternatives. Please confirm that the patch reliably
fixes the issue.

(Though I think if you boot with *all* outputs disabled, we'll choose
the lowest CDCLK possible regardless of the patch, reproducing the same
issue.)

What's the CDCLK frequency set by the BIOS/GOP at boot? There are no
logs with drm.debug=14 attached to the referenced bug.

I see that bspec says, "158.4 MHz CD (Display Audio enumeration and
playback OK)" but that's *not* twice the BCLK. I'm inclined to lean
towards 192 MHz min leading to max CDCLK on GLK.

BR,
Jani.


[1] https://patchwork.freedesktop.org/patch/184778/



>
> v2:
>     - Address comment (Jani)
>     - New design approach
>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=102937
> Signed-off-by: Abhay Kumar <abhay.kumar@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_audio.c | 33 ++++++++++++++++++++++-----------
>  drivers/gpu/drm/i915/intel_cdclk.c | 21 +++++++++++++++++++++
>  drivers/gpu/drm/i915/intel_drv.h   |  1 +
>  3 files changed, 44 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_audio.c b/drivers/gpu/drm/i915/intel_audio.c
> index 709d6ca68074..f7dd3d532e93 100644
> --- a/drivers/gpu/drm/i915/intel_audio.c
> +++ b/drivers/gpu/drm/i915/intel_audio.c
> @@ -723,15 +723,37 @@ static void i915_audio_component_put_power(struct device *kdev)
>  	intel_display_power_put(kdev_to_i915(kdev), POWER_DOMAIN_AUDIO);
>  }
>  
> +/* Get CDCLK in kHz  */
> +static int i915_audio_component_get_cdclk_freq(struct device *kdev)
> +{
> +	struct drm_i915_private *dev_priv = kdev_to_i915(kdev);
> +
> +	if (WARN_ON_ONCE(!HAS_DDI(dev_priv)))
> +		return -ENODEV;
> +
> +	return dev_priv->cdclk.hw.cdclk;
> +}
> +
>  static void i915_audio_component_codec_wake_override(struct device *kdev,
>  						     bool enable)
>  {
>  	struct drm_i915_private *dev_priv = kdev_to_i915(kdev);
>  	u32 tmp;
> +	int current_cdclk;
>  
>  	if (!IS_GEN9_BC(dev_priv))
>  		return;
>  
> +	current_cdclk = i915_audio_component_get_cdclk_freq(kdev);
> +
> +	/*
> +	 * Before probing for HDA Codec we need to make sure
> +	 * "The CD clock frequency must be at least twice
> +	 * the frequency of the Azalia BCLK."
> +	 */
> +	if (INTEL_GEN(dev_priv) >= 9 && current_cdclk <= 192000)
> +		intel_cdclk_bump(dev_priv);
> +
>  	i915_audio_component_get_power(kdev);
>  
>  	/*
> @@ -753,17 +775,6 @@ static void i915_audio_component_codec_wake_override(struct device *kdev,
>  	i915_audio_component_put_power(kdev);
>  }
>  
> -/* Get CDCLK in kHz  */
> -static int i915_audio_component_get_cdclk_freq(struct device *kdev)
> -{
> -	struct drm_i915_private *dev_priv = kdev_to_i915(kdev);
> -
> -	if (WARN_ON_ONCE(!HAS_DDI(dev_priv)))
> -		return -ENODEV;
> -
> -	return dev_priv->cdclk.hw.cdclk;
> -}
> -
>  /*
>   * get the intel_encoder according to the parameter port and pipe
>   * intel_encoder is saved by the index of pipe
> diff --git a/drivers/gpu/drm/i915/intel_cdclk.c b/drivers/gpu/drm/i915/intel_cdclk.c
> index dc7db8a2caf8..9426e1b7badc 100644
> --- a/drivers/gpu/drm/i915/intel_cdclk.c
> +++ b/drivers/gpu/drm/i915/intel_cdclk.c
> @@ -1516,6 +1516,27 @@ void bxt_init_cdclk(struct drm_i915_private *dev_priv)
>  }
>  
>  /**
> + * intel_cdclk_bump - Increase cdclk to 2* BCLK
> + * @dev_priv: i915 device
> + *
> + * Increase CDCLK for GKL and CNL. This is done only
> + * during HDA codec probe.
> + */
> +void intel_cdclk_bump(struct drm_i915_private *dev_priv)
> +{
> +	struct intel_cdclk_state cdclk_state;
> +
> +	cdclk_state = dev_priv->cdclk.hw;
> +
> +	if (IS_GEMINILAKE(dev_priv)) {
> +		cdclk_state.cdclk = glk_calc_cdclk((2*96000));
> +		cdclk_state.vco = glk_de_pll_vco(dev_priv, cdclk_state.cdclk);
> +		cdclk_state.voltage_level = bxt_calc_voltage_level(cdclk_state.cdclk);
> +		bxt_set_cdclk(dev_priv, &cdclk_state);
> +	}
> +}
> +
> +/**
>   * bxt_uninit_cdclk - Uninitialize CDCLK on BXT
>   * @dev_priv: i915 device
>   *
> diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
> index d1452fd2a58d..5192753df3dc 100644
> --- a/drivers/gpu/drm/i915/intel_drv.h
> +++ b/drivers/gpu/drm/i915/intel_drv.h
> @@ -1417,6 +1417,7 @@ void skl_uninit_cdclk(struct drm_i915_private *dev_priv);
>  void cnl_init_cdclk(struct drm_i915_private *dev_priv);
>  void cnl_uninit_cdclk(struct drm_i915_private *dev_priv);
>  void bxt_init_cdclk(struct drm_i915_private *dev_priv);
> +void intel_cdclk_bump(struct drm_i915_private *dev_priv);
>  void bxt_uninit_cdclk(struct drm_i915_private *dev_priv);
>  void icl_init_cdclk(struct drm_i915_private *dev_priv);
>  void icl_uninit_cdclk(struct drm_i915_private *dev_priv);

-- 
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2018-04-06 13:46 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-25 22:02 [PATCH] drm/i915: set minimum CD clock to twice the BCLK abhay.kumar
2017-10-25 22:26 ` ✗ Fi.CI.BAT: warning for " Patchwork
2017-10-26  4:03 ` [PATCH] " Dhinakaran Pandiyan
2017-10-26  8:45   ` Jani Nikula
2017-10-26 19:10     ` Kumar, Abhay
2017-10-29  3:04       ` Kumar, Abhay
2017-10-31  0:21         ` Pandiyan, Dhinakaran
2017-10-31 23:43           ` Kumar, Abhay
2017-11-01  9:40             ` Jani Nikula
2017-11-03  3:54               ` Prusty, Subhransu S
2017-11-03  4:13             ` Prusty, Subhransu S
2018-02-14 17:59 ` Jani Nikula
     [not found]   ` <A49308764D41694491D5AFB53AB2F16D70A5CBD8@ORSMSX114.amr.corp.intel.com>
2018-03-23 19:33     ` FW: " Kumar, Abhay
2018-04-05 18:40 ` [PATCH v2] " Abhay Kumar
2018-04-06  7:21   ` kbuild test robot
2018-04-05 19:02 ` ✗ Fi.CI.BAT: failure for drm/i915: set minimum CD clock to twice the BCLK. (rev2) Patchwork
2018-04-05 20:37 ` [PATCH v2] drm/i915: set minimum CD clock to twice the BCLK Abhay Kumar
2018-04-06 13:47   ` Jani Nikula [this message]
2018-04-09 10:33     ` Ville Syrjälä
2018-04-09 22:11       ` Kumar, Abhay
2018-04-10  8:01         ` Jani Nikula
2018-04-10  8:49           ` Jani Nikula
2018-04-11  3:00             ` Kumar, Abhay
2018-04-17 19:06   ` [PATCH v3] " Abhay Kumar
2018-04-17 19:17     ` Kumar, Abhay
2018-04-17 19:28       ` Du,Wenkai
2018-04-18 10:49       ` Jani Nikula
2018-04-18 15:41         ` Ville Syrjälä
2018-04-19  1:19           ` Kumar, Abhay
2018-04-05 21:55 ` ✗ Fi.CI.CHECKPATCH: warning for drm/i915: set minimum CD clock to twice the BCLK. (rev3) Patchwork
2018-04-05 22:10 ` ✓ Fi.CI.BAT: success " Patchwork
2018-04-06  0:38 ` ✗ Fi.CI.IGT: failure " Patchwork
2018-04-17 19:22 ` ✗ Fi.CI.CHECKPATCH: warning for drm/i915: set minimum CD clock to twice the BCLK. (rev4) Patchwork
2018-04-17 19:22 ` ✗ Fi.CI.SPARSE: " Patchwork
2018-04-17 19:31 ` ✓ Fi.CI.BAT: success " Patchwork
2018-04-17 19:48 ` ✓ Fi.CI.IGT: " Patchwork
2018-04-18 10:24 ` ✗ Fi.CI.CHECKPATCH: warning " Patchwork
2018-04-18 10:24 ` ✗ Fi.CI.SPARSE: " Patchwork
2018-04-18 10:40 ` ✓ Fi.CI.BAT: success " Patchwork
2018-04-18 11:07 ` ✗ Fi.CI.CHECKPATCH: warning " Patchwork
2018-04-18 11:07 ` ✗ Fi.CI.SPARSE: " Patchwork
2018-04-18 11:23 ` ✓ Fi.CI.BAT: success " Patchwork
2018-04-18 12:25 ` ✓ Fi.CI.IGT: " Patchwork
2018-04-18 13:01 ` Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=878ta0la5f.fsf@intel.com \
    --to=jani.nikula@intel.com \
    --cc=abhay.kumar@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.