intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@linux.intel.com>
To: Ville Syrjala <ville.syrjala@linux.intel.com>,
	intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH v2 2/9] drm/i915: Extract intel_ddi_clk_disable()
Date: Wed, 11 Oct 2017 22:52:17 +0300	[thread overview]
Message-ID: <87po9to426.fsf@intel.com> (raw)
In-Reply-To: <20171010121207.570-3-ville.syrjala@linux.intel.com>

On Tue, 10 Oct 2017, Ville Syrjala <ville.syrjala@linux.intel.com> wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> Pull the code to disable the port clock into a function. We already have
> the intel_ddi_clk_select() counterpart.
>
> v2: Keep using intel_ddi_get_encoder_port() for now (Chris)
>
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

Reviewed-by: Jani Nikula <jani.nikula@intel.com>

> ---
>  drivers/gpu/drm/i915/intel_ddi.c | 24 ++++++++++++++++--------
>  1 file changed, 16 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_ddi.c b/drivers/gpu/drm/i915/intel_ddi.c
> index b307b6fe1ce3..1cc61ba48e3a 100644
> --- a/drivers/gpu/drm/i915/intel_ddi.c
> +++ b/drivers/gpu/drm/i915/intel_ddi.c
> @@ -2141,6 +2141,21 @@ static void intel_ddi_clk_select(struct intel_encoder *encoder,
>  	}
>  }
>  
> +static void intel_ddi_clk_disable(struct intel_encoder *encoder)
> +{
> +	struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
> +	enum port port = intel_ddi_get_encoder_port(encoder);
> +
> +	if (IS_CANNONLAKE(dev_priv))
> +		I915_WRITE(DPCLKA_CFGCR0, I915_READ(DPCLKA_CFGCR0) |
> +			   DPCLKA_CFGCR0_DDI_CLK_OFF(port));
> +	else if (IS_GEN9_BC(dev_priv))
> +		I915_WRITE(DPLL_CTRL2, I915_READ(DPLL_CTRL2) |
> +			   DPLL_CTRL2_DDI_CLK_OFF(port));
> +	else if (INTEL_GEN(dev_priv) < 9)
> +		I915_WRITE(PORT_CLK_SEL(port), PORT_CLK_SEL_NONE);
> +}
> +
>  static void intel_ddi_pre_enable_dp(struct intel_encoder *encoder,
>  				    int link_rate, uint32_t lane_count,
>  				    struct intel_shared_dpll *pll,
> @@ -2301,14 +2316,7 @@ static void intel_ddi_post_disable(struct intel_encoder *intel_encoder,
>  	if (dig_port)
>  		intel_display_power_put(dev_priv, dig_port->ddi_io_power_domain);
>  
> -	if (IS_CANNONLAKE(dev_priv))
> -		I915_WRITE(DPCLKA_CFGCR0, I915_READ(DPCLKA_CFGCR0) |
> -			   DPCLKA_CFGCR0_DDI_CLK_OFF(port));
> -	else if (IS_GEN9_BC(dev_priv))
> -		I915_WRITE(DPLL_CTRL2, (I915_READ(DPLL_CTRL2) |
> -					DPLL_CTRL2_DDI_CLK_OFF(port)));
> -	else if (INTEL_GEN(dev_priv) < 9)
> -		I915_WRITE(PORT_CLK_SEL(port), PORT_CLK_SEL_NONE);
> +	intel_ddi_clk_disable(intel_encoder);
>  
>  	if (type == INTEL_OUTPUT_HDMI) {
>  		struct intel_hdmi *intel_hdmi = enc_to_intel_hdmi(encoder);

-- 
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:[~2017-10-11 19:52 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-10 12:11 [PATCH v2 0/9] drm/i915: Cleaner DDI DP vs. HDMI split Ville Syrjala
2017-10-10 12:11 ` [PATCH v2 1/9] drm/i915: Dump 'output_types' in crtc state dump Ville Syrjala
2017-10-11 19:50   ` Jani Nikula
2017-10-10 12:12 ` [PATCH v2 2/9] drm/i915: Extract intel_ddi_clk_disable() Ville Syrjala
2017-10-11 19:52   ` Jani Nikula [this message]
2017-10-10 12:12 ` [PATCH v2 3/9] drm/i915: Extract intel_disable_ddi_buf() Ville Syrjala
2017-10-11 19:53   ` Jani Nikula
2017-10-10 12:12 ` [PATCH 4/9] drm/i915: Inline the required bits of intel_ddi_post_disable() into intel_ddi_fdi_post_disable() Ville Syrjala
2017-10-10 12:12 ` [PATCH v2 5/9] drm/i915: Split intel_ddi_post_disable() into DP vs. HDMI variants Ville Syrjala
2017-10-10 12:12 ` [PATCH 6/9] drm/i915: Remove useless eDP check from intel_ddi_pre_enable_dp() Ville Syrjala
2017-10-10 12:12 ` [PATCH 7/9] drm/i915: Split intel_disable_ddi() into DP vs. HDMI variants Ville Syrjala
2017-10-11 20:03   ` Jani Nikula
2017-10-12  9:49     ` Ville Syrjälä
2017-10-13 14:13       ` Jani Nikula
2017-10-10 12:12 ` [PATCH v2 8/9] drm/i915: Plumb crtc_state etc. directly to intel_ddi_pre_enable_{dp, hdmi}() Ville Syrjala
2017-10-13 14:25   ` Jani Nikula
2017-10-10 12:12 ` [PATCH v2 9/9] drm/i915: Split intel_enable_ddi() into DP and HDMI variants Ville Syrjala
2017-10-11 20:06   ` Jani Nikula
2017-10-13 14:20     ` Jani Nikula
2017-10-13 18:10       ` Ville Syrjälä
2017-10-10 13:07 ` ✗ Fi.CI.BAT: warning for drm/i915: Cleaner DDI DP vs. HDMI split Patchwork
2017-10-10 13:21   ` Ville Syrjälä
2017-10-13 17:03 ` ✓ Fi.CI.BAT: success " Patchwork
2017-10-13 18:16   ` Ville Syrjälä
2017-10-13 18:49     ` Jani Nikula
2017-10-14  0:10 ` ✗ Fi.CI.IGT: failure " 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=87po9to426.fsf@intel.com \
    --to=jani.nikula@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=ville.syrjala@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).