From: Sivakumar Thulasimani <sivakumar.thulasimani@intel.com>
To: ville.syrjala@linux.intel.com, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 6/9] drm/i915: Move DPLL ref/cri/VGA mode frobbing to the disp2d well enable
Date: Fri, 10 Jul 2015 18:03:39 +0530 [thread overview]
Message-ID: <559FBBA3.9040906@intel.com> (raw)
In-Reply-To: <1435580756-20154-7-git-send-email-ville.syrjala@linux.intel.com>
[-- Attachment #1.1: Type: text/plain, Size: 3819 bytes --]
Reviewed-by: Sivakumar Thulasimani <sivakumar.thulasimani@intel.com>
On 6/29/2015 5:55 PM, ville.syrjala@linux.intel.com wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> Bunch of stuff needs the DPLL ref/cri clocks on both VLV and CHV,
> and having VGA mode enabled causes some problems for CHV. So let's just
> pull the code to configure those bits into the disp2d well enable hook.
> With the DPLL disable code also fixed to leave those bits alone we
> should now have a consistent DPLL state all the time even if the DPLL
> is disabled.
>
> This also neatly removes some duplicated code between the VLV and
> CHV codepaths.
>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
> drivers/gpu/drm/i915/intel_runtime_pm.c | 45 ++++++++++++++++++---------------
> 1 file changed, 24 insertions(+), 21 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_runtime_pm.c b/drivers/gpu/drm/i915/intel_runtime_pm.c
> index 6393b76..2142ae6 100644
> --- a/drivers/gpu/drm/i915/intel_runtime_pm.c
> +++ b/drivers/gpu/drm/i915/intel_runtime_pm.c
> @@ -837,6 +837,25 @@ static bool vlv_power_well_enabled(struct drm_i915_private *dev_priv,
>
> static void vlv_display_power_well_init(struct drm_i915_private *dev_priv)
> {
> + enum pipe pipe;
> +
> + /*
> + * Enable the CRI clock source so we can get at the
> + * display and the reference clock for VGA
> + * hotplug / manual detection. Supposedly DSI also
> + * needs the ref clock up and running.
> + *
> + * CHV DPLL B/C have some issues if VGA mode is enabled.
> + */
> + for_each_pipe(dev_priv->dev, pipe) {
> + u32 val = I915_READ(DPLL(pipe));
> +
> + val |= DPLL_REF_CLK_ENABLE_VLV | DPLL_VGA_MODE_DIS;
> + if (pipe != PIPE_A)
> + val |= DPLL_INTEGRATED_CRI_CLK_VLV;
> +
> + I915_WRITE(DPLL(pipe), val);
> + }
>
> spin_lock_irq(&dev_priv->irq_lock);
> valleyview_enable_display_irqs(dev_priv);
> @@ -888,13 +907,7 @@ static void vlv_dpio_cmn_power_well_enable(struct drm_i915_private *dev_priv,
> {
> WARN_ON_ONCE(power_well->data != PUNIT_POWER_WELL_DPIO_CMN_BC);
>
> - /*
> - * Enable the CRI clock source so we can get at the
> - * display and the reference clock for VGA
> - * hotplug / manual detection.
> - */
> - I915_WRITE(DPLL(PIPE_B), I915_READ(DPLL(PIPE_B)) | DPLL_VGA_MODE_DIS |
> - DPLL_REF_CLK_ENABLE_VLV | DPLL_INTEGRATED_CRI_CLK_VLV);
> + /* since ref/cri clock was enabled */
> udelay(1); /* >10ns for cmnreset, >0ns for sidereset */
>
> vlv_set_power_well(dev_priv, power_well, true);
> @@ -937,22 +950,12 @@ static void chv_dpio_cmn_power_well_enable(struct drm_i915_private *dev_priv,
> WARN_ON_ONCE(power_well->data != PUNIT_POWER_WELL_DPIO_CMN_BC &&
> power_well->data != PUNIT_POWER_WELL_DPIO_CMN_D);
>
> - /*
> - * Enable the CRI clock source so we can get at the
> - * display and the reference clock for VGA
> - * hotplug / manual detection.
> - */
> - if (power_well->data == PUNIT_POWER_WELL_DPIO_CMN_BC) {
> + if (power_well->data == PUNIT_POWER_WELL_DPIO_CMN_BC)
> phy = DPIO_PHY0;
> - I915_WRITE(DPLL(PIPE_B), I915_READ(DPLL(PIPE_B)) | DPLL_VGA_MODE_DIS |
> - DPLL_REF_CLK_ENABLE_VLV);
> - I915_WRITE(DPLL(PIPE_B), I915_READ(DPLL(PIPE_B)) | DPLL_VGA_MODE_DIS |
> - DPLL_REF_CLK_ENABLE_VLV | DPLL_INTEGRATED_CRI_CLK_VLV);
> - } else {
> + else
> phy = DPIO_PHY1;
> - I915_WRITE(DPLL(PIPE_C), I915_READ(DPLL(PIPE_C)) | DPLL_VGA_MODE_DIS |
> - DPLL_REF_CLK_ENABLE_VLV | DPLL_INTEGRATED_CRI_CLK_VLV);
> - }
> +
> + /* since ref/cri clock was enabled */
> udelay(1); /* >10ns for cmnreset, >0ns for sidereset */
> vlv_set_power_well(dev_priv, power_well, true);
>
--
regards,
Sivakumar
[-- Attachment #1.2: Type: text/html, Size: 4719 bytes --]
[-- Attachment #2: Type: text/plain, Size: 159 bytes --]
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2015-07-10 12:33 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-29 12:25 [PATCH 0/9] drm/i915: VLV/CHV DPLL workarounds and cleanups ville.syrjala
2015-06-29 12:25 ` [PATCH 1/9] drm/i915: Keep GMCH DPLL VGA mode always disabled ville.syrjala
2015-06-29 14:16 ` Sivakumar Thulasimani
2015-06-29 14:31 ` Ville Syrjälä
2015-06-29 12:25 ` [PATCH 2/9] drm/i915: Apply OCD to VLV/CHV DPLL defines ville.syrjala
2015-06-29 14:21 ` Sivakumar Thulasimani
2015-06-29 12:25 ` [PATCH 3/9] drm/i915: Simplify CHV pipe A power well code ville.syrjala
2015-07-10 11:13 ` Sivakumar Thulasimani
2015-06-29 12:25 ` [PATCH 4/9] drm/i915: Refactor VLV display power well init/deinit ville.syrjala
2015-07-10 11:22 ` Sivakumar Thulasimani
2015-06-29 12:25 ` [PATCH 5/9] drm/i915: Clear out DPLL state from pipe config in DSI get config ville.syrjala
2015-06-29 16:42 ` Daniel Vetter
2015-06-29 16:56 ` Ville Syrjälä
2015-06-29 17:08 ` Ville Syrjälä
2015-06-30 10:13 ` Daniel Vetter
2015-06-30 11:50 ` Ville Syrjälä
2015-07-01 12:42 ` Daniel Vetter
2015-07-10 12:07 ` Sivakumar Thulasimani
2015-07-13 8:51 ` Daniel Vetter
2015-07-13 10:19 ` Sivakumar Thulasimani
2015-07-13 14:39 ` Daniel Vetter
2015-07-10 11:45 ` Sivakumar Thulasimani
2015-06-29 12:25 ` [PATCH 6/9] drm/i915: Move DPLL ref/cri/VGA mode frobbing to the disp2d well enable ville.syrjala
2015-07-10 12:33 ` Sivakumar Thulasimani [this message]
2015-08-26 12:34 ` Daniel Vetter
2015-06-29 12:25 ` [PATCH 7/9] drm/i915: Make {vlv, chv}_{disable, update}_pll() more similar ville.syrjala
2015-06-29 12:25 ` [PATCH 8/9] drm/i915: Implement WaPixelRepeatModeFixForC0:chv ville.syrjala
2015-07-13 6:14 ` Sivakumar Thulasimani
2015-08-10 16:01 ` Ville Syrjälä
2015-06-29 12:25 ` [PATCH 9/9] drm/i915: Disable DSI PLL before reconfiguring it ville.syrjala
2015-07-13 6:17 ` Sivakumar Thulasimani
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=559FBBA3.9040906@intel.com \
--to=sivakumar.thulasimani@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