public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: libin.yang@linux.intel.com
Cc: tiwai@suse.de, daniel.vetter@intel.com, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH v3 3/3] drm/i915: HDMI audio gets the TMDS clock by crtc_clock
Date: Thu, 4 Aug 2016 11:57:04 +0300	[thread overview]
Message-ID: <20160804085704.GC4329@intel.com> (raw)
In-Reply-To: <1470297484-82178-3-git-send-email-libin.yang@linux.intel.com>

On Thu, Aug 04, 2016 at 03:58:04PM +0800, libin.yang@linux.intel.com wrote:
> From: Libin Yang <libin.yang@linux.intel.com>
> 
> HDMI audio should use crtc_clock to get the TMDS clock.
> 
> Besides, this patch renames mode to adjusted_mode to unify the name.
> 
> Signed-off-by: Libin Yang <libin.yang@linux.intel.com>
> ---
>  drivers/gpu/drm/i915/intel_audio.c | 14 +++++++-------
>  1 file changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_audio.c b/drivers/gpu/drm/i915/intel_audio.c
> index 7aa0203..bf02645 100644
> --- a/drivers/gpu/drm/i915/intel_audio.c
> +++ b/drivers/gpu/drm/i915/intel_audio.c
> @@ -159,7 +159,7 @@ static int audio_config_get_n(struct intel_crtc *crtc,
>  	if (intel_crtc_has_type(crtc->config, INTEL_OUTPUT_HDMI)) {
>  		for (i = 0; i < ARRAY_SIZE(aud_ncts); i++) {
>  			if ((rate == aud_ncts[i].sample_rate) &&
> -				(adjusted_mode->clock == aud_ncts[i].clock)) {
> +			    (adjusted_mode->crtc_clock == aud_ncts[i].clock)) {
>  				return aud_ncts[i].n;
>  			}
>  		}
> @@ -228,8 +228,8 @@ static uint32_t audio_config_setup_m_reg(struct intel_crtc *crtc,
>  static bool audio_rate_need_prog(struct intel_crtc *crtc,
>  				 const struct drm_display_mode *adjusted_mode)
>  {
> -	if (((adjusted_mode->clock == TMDS_297M) ||
> -		 (adjusted_mode->clock == TMDS_296M)) &&
> +	if (((adjusted_mode->crtc_clock == TMDS_297M) ||
> +		 (adjusted_mode->crtc_clock == TMDS_296M)) &&

Indentation is still a bit off here, but that looks like a more systemic
problem for intel_audio.c. Probably better to clean it all up
separately.

So yeah, this patch looks all right
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

>  		intel_crtc_has_type(crtc->config, INTEL_OUTPUT_HDMI))
>  		return true;
>  	else if (((crtc->config->port_clock == LC_540M) ||
> @@ -725,7 +725,7 @@ static int i915_audio_component_sync_audio_rate(struct device *dev,
>  	struct drm_i915_private *dev_priv = dev_to_i915(dev);
>  	struct intel_encoder *intel_encoder;
>  	struct intel_crtc *crtc;
> -	struct drm_display_mode *mode;
> +	struct drm_display_mode *adjusted_mode;
>  	struct i915_audio_component *acomp = dev_priv->audio_component;
>  	enum pipe pipe = INVALID_PIPE;
>  	u32 tmp, m;
> @@ -756,20 +756,20 @@ static int i915_audio_component_sync_audio_rate(struct device *dev,
>  
>  	DRM_DEBUG_KMS("pipe %c connects port %c\n",
>  				  pipe_name(pipe), port_name(port));
> -	mode = &crtc->config->base.adjusted_mode;
> +	adjusted_mode = &crtc->config->base.adjusted_mode;
>  
>  	/* port must be valid now, otherwise the pipe will be invalid */
>  	acomp->aud_sample_rate[port] = rate;
>  
>  	/* 2. check whether to set the N/CTS/M manually or not */
> -	if (!audio_rate_need_prog(crtc, mode)) {
> +	if (!audio_rate_need_prog(crtc, adjusted_mode)) {
>  		tmp = I915_READ(HSW_AUD_CFG(pipe));
>  		tmp &= ~AUD_CONFIG_N_PROG_ENABLE;
>  		I915_WRITE(HSW_AUD_CFG(pipe), tmp);
>  		goto unlock;
>  	}
>  
> -	n = audio_config_get_n(crtc, mode, rate);
> +	n = audio_config_get_n(crtc, adjusted_mode, rate);
>  	if (n == 0) {
>  		DRM_DEBUG_KMS("Using automatic mode for N value on port %c\n",
>  					  port_name(port));
> -- 
> 1.9.1

-- 
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2016-08-04  8:57 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-04  7:58 [PATCH v3 1/3] drm/i915: set proper N/M in modeset libin.yang
2016-08-04  7:58 ` [PATCH v3 2/3] drm/i915: set proper N/MCTS on more platforms libin.yang
2016-08-04  8:54   ` Ville Syrjälä
2016-08-05  5:41     ` Yang, Libin
2016-08-04  7:58 ` [PATCH v3 3/3] drm/i915: HDMI audio gets the TMDS clock by crtc_clock libin.yang
2016-08-04  8:57   ` Ville Syrjälä [this message]
2016-08-04  8:52 ` [PATCH v3 1/3] drm/i915: set proper N/M in modeset Ville Syrjälä
2016-08-05  5:39   ` Yang, Libin
2016-08-05  5:56     ` Ville Syrjälä
2016-08-05  6:16       ` Yang, Libin
2016-08-05  6:36         ` Ville Syrjälä
2016-08-05  6:40           ` Yang, Libin
2016-08-05  7:16             ` Ville Syrjälä
2016-08-05  7:24               ` Yang, Libin
2016-08-05  8:45                 ` Ville Syrjälä
2016-08-05  8:55                   ` Yang, Libin
2016-08-05 10:54                     ` Ville Syrjälä
2016-08-05 12:32                       ` Yang, Libin
2016-08-04  9:32 ` ✗ Ro.CI.BAT: failure for series starting with [v3,1/3] " 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=20160804085704.GC4329@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=daniel.vetter@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=libin.yang@linux.intel.com \
    --cc=tiwai@suse.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox