From: Jesse Barnes <jbarnes@virtuousgeek.org>
To: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Intel Graphics Development <intel-gfx@lists.freedesktop.org>
Subject: Re: [PATCH 3/5] drm/i915/eDP: compute the panel power clock divisor from the pch rawclock
Date: Mon, 22 Oct 2012 15:07:37 -0700 [thread overview]
Message-ID: <20121022150737.5262c6ed@jbarnes-desktop> (raw)
In-Reply-To: <1350759465-7171-4-git-send-email-daniel.vetter@ffwll.ch>
On Sat, 20 Oct 2012 20:57:43 +0200
Daniel Vetter <daniel.vetter@ffwll.ch> wrote:
> We need this when the bios forgets even to set that bit up. Most seem
> to do that, even when they don't set up anything else in the panel
> power sequencer.
>
> Note that on IBX the rawclk is variable according to Bspec, but
> everyone is using 125MHz. The rawclk is fixed to 125MHz on CPT, but
> luckily we still have the same register available. On hsw, different
> variants have different clocks, hence we need to check the register.
>
> Since other pieces are driven by the rawclock, too, keep the little
> helper in a central place.
>
> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> ---
> drivers/gpu/drm/i915/intel_display.c | 10 ++++++++++
> drivers/gpu/drm/i915/intel_dp.c | 8 ++++++--
> drivers/gpu/drm/i915/intel_drv.h | 2 ++
> 3 files changed, 18 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index 9c17a0a7..7fb032f 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -80,6 +80,16 @@ struct intel_limit {
> /* FDI */
> #define IRONLAKE_FDI_FREQ 2700000 /* in kHz for mode->clock */
>
> +int
> +intel_pch_rawclk(struct drm_device *dev)
> +{
> + struct drm_i915_private *dev_priv = dev->dev_private;
> +
> + WARN_ON(!HAS_PCH_SPLIT(dev));
> +
> + return I915_READ(PCH_RAWCLK_FREQ) & RAWCLK_FREQ_MASK;
> +}
> +
> static bool
> intel_find_best_PLL(const intel_limit_t *limit, struct drm_crtc *crtc,
> int target, int refclk, intel_clock_t *match_clock,
> diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
> index 49846c0..b35d5bd 100644
> --- a/drivers/gpu/drm/i915/intel_dp.c
> +++ b/drivers/gpu/drm/i915/intel_dp.c
> @@ -2749,8 +2749,12 @@ intel_dp_init(struct drm_device *dev, int output_reg, enum port port)
> (final.t8 << PANEL_LIGHT_ON_DELAY_SHIFT);
> pp_off = (final.t9 << PANEL_LIGHT_OFF_DELAY_SHIFT) |
> (final.t10 << PANEL_POWER_DOWN_DELAY_SHIFT);
> - pp_div = (pp_div & PP_REFERENCE_DIVIDER_MASK) |
> - (DIV_ROUND_UP(final.t11_t12, 1000) << PANEL_POWER_CYCLE_DELAY_SHIFT);
> + /* Compute the divisor for the pp clock, simply match the Bspec
> + * formula. */
> + pp_div = ((100 * intel_pch_rawclk(dev))/2 - 1)
> + << PP_REFERENCE_DIVIDER_SHIFT;
> + pp_div |= (DIV_ROUND_UP(final.t11_t12, 1000)
> + << PANEL_POWER_CYCLE_DELAY_SHIFT);
>
> /* Haswell doesn't have any port selection bits for the panel
> * power sequence any more. */
> diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
> index ed75a36..39bddd7 100644
> --- a/drivers/gpu/drm/i915/intel_drv.h
> +++ b/drivers/gpu/drm/i915/intel_drv.h
> @@ -396,6 +396,8 @@ struct intel_fbc_work {
> int interval;
> };
>
> +int intel_pch_rawclk(struct drm_device *dev);
> +
> int intel_connector_update_modes(struct drm_connector *connector,
> struct edid *edid);
> int intel_ddc_get_modes(struct drm_connector *c, struct i2c_adapter *adapter);
Did you check that the calculation generally matched the existing value
on the machines you looked at?
Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
--
Jesse Barnes, Intel Open Source Technology Center
next prev parent reply other threads:[~2012-10-22 22:06 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-20 18:57 [PATCH 0/5] eDP improvements Daniel Vetter
2012-10-20 18:57 ` [PATCH 1/5] drm/i915: make edp panel power sequence setup more robust Daniel Vetter
2012-10-22 22:04 ` Jesse Barnes
2012-10-23 7:23 ` Daniel Vetter
2012-10-23 14:23 ` Jesse Barnes
2012-10-20 18:57 ` [PATCH 2/5] drm/i915: enable/disable backlight for eDP Daniel Vetter
2012-10-22 22:04 ` Jesse Barnes
2012-10-20 18:57 ` [PATCH 3/5] drm/i915/eDP: compute the panel power clock divisor from the pch rawclock Daniel Vetter
2012-10-22 22:07 ` Jesse Barnes [this message]
2012-10-20 18:57 ` [PATCH 4/5] drm/i915/dp: compute the pch dp aux divider from the rawclk Daniel Vetter
2012-10-22 22:08 ` Jesse Barnes
2012-10-20 18:57 ` [PATCH 5/5] drm/i915: extract intel_dp_init_panel_power_sequencer Daniel Vetter
2012-10-22 22:08 ` Jesse Barnes
2012-10-23 15:24 ` Daniel Vetter
2012-10-21 7:37 ` [PATCH 0/5] eDP improvements Oleksij Rempel
2012-10-21 10:34 ` Daniel Vetter
2012-10-23 14:03 ` Paulo Zanoni
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=20121022150737.5262c6ed@jbarnes-desktop \
--to=jbarnes@virtuousgeek.org \
--cc=daniel.vetter@ffwll.ch \
--cc=intel-gfx@lists.freedesktop.org \
/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.