All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Yang, Libin" <libin.yang@intel.com>
To: "intel-gfx@lists.freedesktop.org" <intel-gfx@lists.freedesktop.org>
Cc: "Nikula, Jani" <jani.nikula@intel.com>,
	"libin.yang@linux.intel.com" <libin.yang@linux.intel.com>,
	"Pandiyan, Dhinakaran" <dhinakaran.pandiyan@intel.com>
Subject: Re: [PATCH RESEND 3/9] drm/i915/audio: use the same code	for updating audio config
Date: Tue, 11 Oct 2016 05:25:47 +0000	[thread overview]
Message-ID: <96A12704CE18D347B625EE2D4A099D194FA33D13@SHSMSX103.ccr.corp.intel.com> (raw)
In-Reply-To: <e0e88ec00c0ed1734083153b55283efd3116be5c.1476111629.git.jani.nikula@intel.com>

Reviewed-by: Libin Yang <libin.yang@intel.com>

Regards,
Libin


> -----Original Message-----
> From: Intel-gfx [mailto:intel-gfx-bounces@lists.freedesktop.org] On Behalf Of
> Jani Nikula
> Sent: Monday, October 10, 2016 11:04 PM
> To: intel-gfx@lists.freedesktop.org
> Cc: Nikula, Jani <jani.nikula@intel.com>; libin.yang@linux.intel.com;
> Pandiyan, Dhinakaran <dhinakaran.pandiyan@intel.com>
> Subject: [Intel-gfx] [PATCH RESEND 3/9] drm/i915/audio: use the same code
> for updating audio config
> 
> It gets fragile to duplicate the code for updating HSW_AUD_CFG. The only
> change should be that the hdmi pixel clock is also updated in
> i915_audio_component_sync_audio_rate(), but it should not be any
> different.
> 
> Cc: Libin Yang <libin.yang@linux.intel.com>
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_audio.c | 29 +++--------------------------
>  1 file changed, 3 insertions(+), 26 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_audio.c
> b/drivers/gpu/drm/i915/intel_audio.c
> index 5d0bd07afa51..4d62b3e8ac19 100644
> --- a/drivers/gpu/drm/i915/intel_audio.c
> +++ b/drivers/gpu/drm/i915/intel_audio.c
> @@ -671,10 +671,8 @@ static int
> i915_audio_component_sync_audio_rate(struct device *kdev, int port,
>  	struct drm_i915_private *dev_priv = kdev_to_i915(kdev);
>  	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;
> -	u32 tmp;
> -	int n;
>  	int err = 0;
> 
>  	/* HSW, BDW, SKL, KBL need this fix */ @@ -700,33 +698,12 @@
> static int i915_audio_component_sync_audio_rate(struct device *kdev, int
> port,
>  	crtc = to_intel_crtc(intel_encoder->base.crtc);
>  	pipe = crtc->pipe;
> 
> -	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)) {
> -		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(mode, rate);
> -	if (n == 0) {
> -		DRM_DEBUG_KMS("Using automatic mode for N value on
> port %c\n",
> -					  port_name(port));
> -		tmp = I915_READ(HSW_AUD_CFG(pipe));
> -		tmp &= ~AUD_CONFIG_N_PROG_ENABLE;
> -		I915_WRITE(HSW_AUD_CFG(pipe), tmp);
> -		goto unlock;
> -	}
> -
> -	/* 3. set the N/CTS/M */
> -	tmp = I915_READ(HSW_AUD_CFG(pipe));
> -	tmp = audio_config_setup_n_reg(n, tmp);
> -	I915_WRITE(HSW_AUD_CFG(pipe), tmp);
> +	hsw_audio_config_update(crtc, port, adjusted_mode);
> 
>   unlock:
>  	mutex_unlock(&dev_priv->av_mutex);
> --
> 2.1.4
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2016-10-11  5:25 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-10 15:03 [PATCH RESEND 0/9] drm/i915/audio: audio cleanups, 4k fixes Jani Nikula
2016-10-10 15:04 ` [PATCH RESEND 1/9] drm/i915/audio: abstract audio config update Jani Nikula
2016-10-11  1:59   ` Yang, Libin
2016-10-10 15:04 ` [PATCH RESEND 2/9] drm/i915/audio: port is going to be just fine, simplify checks Jani Nikula
2016-10-11  2:37   ` Yang, Libin
2016-10-10 15:04 ` [PATCH RESEND 3/9] drm/i915/audio: use the same code for updating audio config Jani Nikula
2016-10-11  5:25   ` Yang, Libin [this message]
2016-10-10 15:04 ` [PATCH RESEND 4/9] drm/i915/audio: split dp and hdmi audio config update Jani Nikula
2016-10-11  5:42   ` Yang, Libin
2016-10-10 15:04 ` [PATCH RESEND 5/9] drm/i915/audio: set proper N/MCTS on more platforms Jani Nikula
2016-10-10 15:04 ` [PATCH RESEND 6/9] drm/i915/audio: HDMI audio gets the TMDS clock by crtc_clock Jani Nikula
2016-10-10 15:04 ` [PATCH RESEND 7/9] drm/i915/audio: add register macros for audio config N value Jani Nikula
2016-10-11  5:52   ` Yang, Libin
2016-10-10 15:04 ` [PATCH RESEND 8/9] drm/i915/audio: rename N value getter to emphasize it's for hdmi Jani Nikula
2016-10-11  5:55   ` Yang, Libin
2016-10-11 14:25     ` Jani Nikula
2016-10-10 15:04 ` [PATCH RESEND 9/9] drm/i915: set proper N/M in modeset Jani Nikula
2016-10-12  2:45   ` Lin, Mengdong
2016-10-12  6:29     ` Yang, Libin
2016-10-19 15:08       ` Jani Nikula
2016-10-20  2:00         ` Yang, Libin
2016-10-20  8:33           ` Jani Nikula
2016-10-20  8:42             ` Yang, Libin
2016-10-20 11:34               ` Jani Nikula
2016-10-20 12:02                 ` Ville Syrjälä
2016-10-21  6:47                   ` Yang, Libin
2016-10-21  6:21                 ` Yang, Libin
2016-10-12  6:41   ` Zhang, Keqiao
2016-10-10 18:19 ` ✗ Fi.CI.BAT: warning for drm/i915/audio: audio cleanups, 4k fixes (rev3) 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=96A12704CE18D347B625EE2D4A099D194FA33D13@SHSMSX103.ccr.corp.intel.com \
    --to=libin.yang@intel.com \
    --cc=dhinakaran.pandiyan@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jani.nikula@intel.com \
    --cc=libin.yang@linux.intel.com \
    /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.