public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Paulo Zanoni <przanoni@gmail.com>
Cc: intel-gfx@lists.freedesktop.org, Paulo Zanoni <paulo.r.zanoni@intel.com>
Subject: Re: [PATCH 5/7] drm/i915: disable CLKOUT_DP when it's not needed
Date: Fri, 12 Jul 2013 20:23:01 +0200	[thread overview]
Message-ID: <20130712182301.GI6143@phenom.ffwll.local> (raw)
In-Reply-To: <1373649582-19618-6-git-send-email-przanoni@gmail.com>

On Fri, Jul 12, 2013 at 02:19:40PM -0300, Paulo Zanoni wrote:
> From: Paulo Zanoni <paulo.r.zanoni@intel.com>
> 
> We currently don't support HDMI clock bending nor use SSC for DP or
> HDMI on Haswell, so the only case where we need CLKOUT_DP is for VGA.
> 
> Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>

Just an aside: One of the many plans on my todo is to move the refclk
updates into the global_modeset_resources callback and only enable the
refclocks we actually need for the given configuration. Entirely different
patch series though.
-Daniel

> ---
>  drivers/gpu/drm/i915/intel_display.c | 38 ++++++++++++++++++++++++++++++++----
>  1 file changed, 34 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index 5f3b636..059c9a8 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -5305,6 +5305,36 @@ static void lpt_enable_clkout_dp(struct drm_device *dev, bool with_spread,
>  	mutex_unlock(&dev_priv->dpio_lock);
>  }
>  
> +/* Sequence to disable CLKOUT_DP */
> +static void lpt_disable_clkout_dp(struct drm_device *dev)
> +{
> +	struct drm_i915_private *dev_priv = dev->dev_private;
> +	uint32_t tmp;
> +
> +	mutex_lock(&dev_priv->dpio_lock);
> +
> +	if (IS_ULT(dev_priv->dev)) {
> +		tmp = intel_sbi_read(dev_priv, SBI_GEN0, SBI_ICLK);
> +		tmp &= ~SBI_GEN0_ENABLE;
> +		intel_sbi_write(dev_priv, SBI_GEN0, tmp, SBI_ICLK);
> +	} else {
> +		tmp = intel_sbi_read(dev_priv, SBI_DBUFF0, SBI_ICLK);
> +		tmp &= ~SBI_DBUFF0_ENABLE;
> +		intel_sbi_write(dev_priv, SBI_DBUFF0, tmp, SBI_ICLK);
> +	}
> +
> +	tmp = intel_sbi_read(dev_priv, SBI_SSCCTL, SBI_ICLK);
> +	if (!(tmp & SBI_SSCCTL_PATHALT)) {
> +		tmp |= SBI_SSCCTL_PATHALT;
> +		intel_sbi_write(dev_priv, SBI_SSCCTL, tmp, SBI_ICLK);
> +		udelay(32);
> +	}
> +	tmp |= SBI_SSCCTL_DISABLE;
> +	intel_sbi_write(dev_priv, SBI_SSCCTL, tmp, SBI_ICLK);
> +
> +	mutex_unlock(&dev_priv->dpio_lock);
> +}
> +
>  static void lpt_init_pch_refclk(struct drm_device *dev)
>  {
>  	struct drm_mode_config *mode_config = &dev->mode_config;
> @@ -5319,10 +5349,10 @@ static void lpt_init_pch_refclk(struct drm_device *dev)
>  		}
>  	}
>  
> -	if (!has_vga)
> -		return;
> -
> -	lpt_enable_clkout_dp(dev, true, true);
> +	if (has_vga)
> +		lpt_enable_clkout_dp(dev, true, true);
> +	else
> +		lpt_disable_clkout_dp(dev);
>  }
>  
>  /*
> -- 
> 1.8.1.2
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch

  reply	other threads:[~2013-07-12 18:23 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-12 17:19 [PATCH 0/7] HSW/LPT clocking code additional sequences Paulo Zanoni
2013-07-12 17:19 ` [PATCH 1/7] drm/i915: remove SDV support from lpt_pch_init_refclk Paulo Zanoni
2013-07-13  5:11   ` Ben Widawsky
2013-07-12 17:19 ` [PATCH 2/7] drm/i915: extract FDI mPHY functions from lpt_init_pch_refclk Paulo Zanoni
2013-07-18 21:51   ` Paulo Zanoni
2013-07-12 17:19 ` [PATCH 3/7] drm/i915: extract lpt_enable_clkout_dp " Paulo Zanoni
2013-07-19  6:54   ` Daniel Vetter
2013-07-12 17:19 ` [PATCH 4/7] drm/i915: extend lpt_enable_clkout_dp Paulo Zanoni
2013-07-18 22:40   ` Ben Widawsky
2013-07-19 15:04     ` Paulo Zanoni
2013-07-19 21:53       ` [PATCH 1/5] " Paulo Zanoni
2013-07-12 17:19 ` [PATCH 5/7] drm/i915: disable CLKOUT_DP when it's not needed Paulo Zanoni
2013-07-12 18:23   ` Daniel Vetter [this message]
2013-07-12 18:24     ` Paulo Zanoni
2013-07-18 22:54   ` Ben Widawsky
2013-07-19 21:54     ` [PATCH 2/5] " Paulo Zanoni
2013-07-12 17:19 ` [PATCH 6/7] drm/i915: add functions to disable and restore LCPLL Paulo Zanoni
2013-07-18 21:53   ` Paulo Zanoni
2013-07-18 23:26   ` Ben Widawsky
2013-07-18 23:33     ` Ben Widawsky
2013-07-19 16:57       ` Paulo Zanoni
2013-07-19 18:22     ` Paulo Zanoni
2013-07-19 21:56       ` [PATCH 3/5] " Paulo Zanoni
2013-07-19 21:58         ` [PATCH 5/5] drm/i915: add HAS_LP_PCH check Paulo Zanoni
2013-07-22 17:10           ` Ben Widawsky
2013-07-22 22:44             ` Paulo Zanoni
2013-07-12 17:19 ` [PATCH 7/7] drm/i915: add some assertions to hsw_disable_lcpll Paulo Zanoni
2013-07-18 23:32   ` Ben Widawsky
2013-07-19 18:42     ` Paulo Zanoni
2013-07-18 23:33 ` [PATCH 0/7] HSW/LPT clocking code additional sequences Ben Widawsky

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=20130712182301.GI6143@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=paulo.r.zanoni@intel.com \
    --cc=przanoni@gmail.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