From: Jani Nikula <jani.nikula@linux.intel.com>
To: ville.syrjala@linux.intel.com, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH v2] drm/i915: Make i9xx_crtc_clock_get() use dpll_hw_state
Date: Fri, 13 Sep 2013 16:44:33 +0300 [thread overview]
Message-ID: <8761u4n8e6.fsf@intel.com> (raw)
In-Reply-To: <1379078326-4259-1-git-send-email-ville.syrjala@linux.intel.com>
On Fri, 13 Sep 2013, ville.syrjala@linux.intel.com wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> We already extract the DPLL state to pipe_config, so let's make use of
> it in i9xx_crtc_clock_get() and avoid the register reads.
>
> This will also make the function closer to being useable with PCH DPLL
> since the registers for those live in a different address.
>
> Also kill the useless adjusted_mode.clock zeroing. It's already zero at
> this point.
>
> v2: Read out DPLL state in intel_crtc_mode_get()
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
> drivers/gpu/drm/i915/intel_display.c | 13 ++++++++-----
> 1 file changed, 8 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index 13dea9b..ad7f8a7 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -7326,14 +7326,14 @@ static void i9xx_crtc_clock_get(struct intel_crtc *crtc,
> struct drm_device *dev = crtc->base.dev;
> struct drm_i915_private *dev_priv = dev->dev_private;
> int pipe = pipe_config->cpu_transcoder;
> - u32 dpll = I915_READ(DPLL(pipe));
> + u32 dpll = pipe_config->dpll_hw_state.dpll;
> u32 fp;
> intel_clock_t clock;
>
> if ((dpll & DISPLAY_RATE_SELECT_FPA1) == 0)
> - fp = I915_READ(FP0(pipe));
> + fp = pipe_config->dpll_hw_state.fp0;
> else
> - fp = I915_READ(FP1(pipe));
> + fp = pipe_config->dpll_hw_state.fp1;
>
> clock.m1 = (fp & FP_M1_DIV_MASK) >> FP_M1_DIV_SHIFT;
> if (IS_PINEVIEW(dev)) {
> @@ -7364,7 +7364,6 @@ static void i9xx_crtc_clock_get(struct intel_crtc *crtc,
> default:
> DRM_DEBUG_KMS("Unknown DPLL mode %08x in programmed "
> "mode\n", (int)(dpll & DPLL_MODE_MASK));
> - pipe_config->adjusted_mode.clock = 0;
> return;
> }
>
> @@ -7464,6 +7463,7 @@ struct drm_display_mode *intel_crtc_mode_get(struct drm_device *dev,
> int hsync = I915_READ(HSYNC(cpu_transcoder));
> int vtot = I915_READ(VTOTAL(cpu_transcoder));
> int vsync = I915_READ(VSYNC(cpu_transcoder));
> + enum pipe pipe = intel_crtc->pipe;
>
> mode = kzalloc(sizeof(*mode), GFP_KERNEL);
> if (!mode)
> @@ -7476,8 +7476,11 @@ struct drm_display_mode *intel_crtc_mode_get(struct drm_device *dev,
> * Note, if LVDS ever uses a non-1 pixel multiplier, we'll need
> * to use a real value here instead.
> */
> - pipe_config.cpu_transcoder = (enum transcoder) intel_crtc->pipe;
> + pipe_config.cpu_transcoder = (enum transcoder) pipe;
> pipe_config.pixel_multiplier = 1;
> + pipe_config.dpll_hw_state.dpll = I915_READ(DPLL(pipe));
> + pipe_config.dpll_hw_state.fp0 = I915_READ(FP0(pipe));
> + pipe_config.dpll_hw_state.fp1 = I915_READ(FP1(pipe));
> i9xx_crtc_clock_get(intel_crtc, &pipe_config);
>
> mode->clock = pipe_config.adjusted_mode.clock;
> --
> 1.8.1.5
>
--
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2013-09-13 13:42 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-06 20:28 [PATCH 00/11] drm/i915: adjusted_mode.clock vs. port_clock v3 ville.syrjala
2013-09-06 20:28 ` [PATCH 01/11] drm/i915: Don't factor in pixel multplier when deriving dotclock from link clock and M/N values ville.syrjala
2013-09-06 20:28 ` [PATCH v2 02/11] drm/i915: Make adjusted_mode.clock non-pixel multiplied ville.syrjala
2013-09-13 11:40 ` Jani Nikula
2013-09-06 20:29 ` [PATCH v2 03/11] drm/i915: Add support for pipe_bpp readout ville.syrjala
2013-09-13 11:59 ` Jani Nikula
2013-09-06 20:29 ` [PATCH 04/11] drm/i915: Add state readout and checking for has_dp_encoder and dp_m_n ville.syrjala
2013-09-10 14:02 ` [PATCH v2] " ville.syrjala
2013-09-13 12:11 ` Jani Nikula
2013-09-06 20:29 ` [PATCH 05/11] drm/i915: Make intel_fuzzy_clock_check() take in arbitrary clocks ville.syrjala
2013-09-13 12:55 ` Daniel Vetter
2013-09-06 20:29 ` [PATCH 06/11] drm/i915: Add intel_dotclock_calculate() ville.syrjala
2013-09-13 12:30 ` Jani Nikula
2013-09-13 12:43 ` Ville Syrjälä
2013-09-13 12:59 ` [PATCH v2] " ville.syrjala
2013-09-16 11:14 ` Jani Nikula
2013-09-16 20:41 ` Daniel Vetter
2013-09-17 8:16 ` Ville Syrjälä
2013-09-06 20:29 ` [PATCH 07/11] drm/i915: Make i9xx_crtc_clock_get() use dpll_hw_state ville.syrjala
2013-09-13 12:40 ` Jani Nikula
2013-09-13 13:12 ` Ville Syrjälä
2013-09-13 13:18 ` [PATCH v2] " ville.syrjala
2013-09-13 13:44 ` Jani Nikula [this message]
2013-09-06 20:29 ` [PATCH 08/11] drm/i915: Make i9xx_crtc_clock_get() work for PCH DPLLs ville.syrjala
2013-09-08 12:35 ` Daniel Vetter
2013-09-09 11:06 ` [PATCH v2] " ville.syrjala
2013-09-13 13:04 ` Jani Nikula
2013-09-13 13:06 ` Ville Syrjälä
2013-09-13 13:47 ` Jani Nikula
2013-09-13 13:54 ` Ville Syrjälä
2013-09-16 20:43 ` Daniel Vetter
2013-09-06 20:29 ` [PATCH 09/11] drm/i915: Fix port_clock and adjusted_mode.clock readout all over ville.syrjala
2013-09-08 12:37 ` Daniel Vetter
2013-09-09 10:35 ` [PATCH v2] " ville.syrjala
2013-09-09 11:34 ` [PATCH v3] " ville.syrjala
2013-09-13 13:00 ` [PATCH v4] " ville.syrjala
2013-09-16 11:16 ` Jani Nikula
2013-09-06 20:29 ` [PATCH v2 10/11] drm/i915: Add PIPE_CONF_CHECK_CLOCK_FUZZY() ville.syrjala
2013-09-06 20:29 ` [PATCH v2 11/11] drm/i915: Add fuzzy clock check for port_clock ville.syrjala
2013-09-16 21:16 ` Daniel Vetter
2013-09-08 12:38 ` [PATCH 00/11] drm/i915: adjusted_mode.clock vs. port_clock v3 Daniel Vetter
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=8761u4n8e6.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