From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Jani Nikula <jani.nikula@intel.com>
Cc: intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org
Subject: Re: [RESEND 05/12] drm/i915: add vlv_clock_get_cdclk()
Date: Tue, 9 Sep 2025 16:24:37 +0300 [thread overview]
Message-ID: <aMAqlVAw2NqlwQ5_@intel.com> (raw)
In-Reply-To: <ddb128204f27ee029fe2858973ec9ca2c59a67e3.1755607980.git.jani.nikula@intel.com>
On Tue, Aug 19, 2025 at 03:53:35PM +0300, Jani Nikula wrote:
> Add vlv_clock_get_cdclk() helper to hide the details from the callers.
>
> For now, this means running vlv_get_hpll_vco() twice in vlv_get_cdclk(),
> but this will be improved later.
>
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
> ---
> drivers/gpu/drm/i915/display/intel_cdclk.c | 4 +---
> drivers/gpu/drm/i915/display/intel_display.c | 6 ++++++
> drivers/gpu/drm/i915/display/intel_display.h | 1 +
> 3 files changed, 8 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_cdclk.c b/drivers/gpu/drm/i915/display/intel_cdclk.c
> index 65ad7d48dd39..e898c0541168 100644
> --- a/drivers/gpu/drm/i915/display/intel_cdclk.c
> +++ b/drivers/gpu/drm/i915/display/intel_cdclk.c
> @@ -610,9 +610,7 @@ static void vlv_get_cdclk(struct intel_display *display,
> vlv_iosf_sb_get(display->drm, BIT(VLV_IOSF_SB_CCK) | BIT(VLV_IOSF_SB_PUNIT));
>
> cdclk_config->vco = vlv_get_hpll_vco(display->drm);
> - cdclk_config->cdclk = vlv_get_cck_clock(display->drm, "cdclk",
> - CCK_DISPLAY_CLOCK_CONTROL,
> - cdclk_config->vco);
> + cdclk_config->cdclk = vlv_clock_get_cdclk(display->drm);
>
> val = vlv_punit_read(display->drm, PUNIT_REG_DSPSSPM);
>
> diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
> index 8baa5f898284..644028d0c7ef 100644
> --- a/drivers/gpu/drm/i915/display/intel_display.c
> +++ b/drivers/gpu/drm/i915/display/intel_display.c
> @@ -204,6 +204,12 @@ int vlv_clock_get_czclk(struct drm_device *drm)
> return i915->czclk_freq;
> }
>
> +int vlv_clock_get_cdclk(struct drm_device *drm)
> +{
> + return vlv_get_cck_clock(drm, "cdclk", CCK_DISPLAY_CLOCK_CONTROL,
> + vlv_get_hpll_vco(drm));
This is actually just vlv_get_cck_clock_hpll(), except that one has
the vlv_iosf_sb_get/put(CCK) stuff inside it whereas vlv_get_cck_clock()
needs the caller to grab that.
So that part of the vlv_clocks.c interface is now rather confusing.
The interface should probably be high level enough that the caller
doesn't have to deal with that get/put stuff at all...
> +}
> +
> int vlv_clock_get_gpll(struct drm_device *drm)
> {
> return vlv_get_cck_clock(drm, "GPLL ref", CCK_GPLL_CLOCK_CONTROL,
> diff --git a/drivers/gpu/drm/i915/display/intel_display.h b/drivers/gpu/drm/i915/display/intel_display.h
> index 5c9b57e94a65..9fdbc4ad5391 100644
> --- a/drivers/gpu/drm/i915/display/intel_display.h
> +++ b/drivers/gpu/drm/i915/display/intel_display.h
> @@ -440,6 +440,7 @@ int vlv_get_cck_clock(struct drm_device *drm,
> const char *name, u32 reg, int ref_freq);
> int vlv_clock_get_hrawclk(struct drm_device *drm);
> int vlv_clock_get_czclk(struct drm_device *drm);
> +int vlv_clock_get_cdclk(struct drm_device *drm);
> int vlv_clock_get_gpll(struct drm_device *drm);
> bool intel_has_pending_fb_unpin(struct intel_display *display);
> void intel_encoder_destroy(struct drm_encoder *encoder);
> --
> 2.47.2
--
Ville Syrjälä
Intel
next prev parent reply other threads:[~2025-09-09 13:24 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-19 12:53 [RESEND 00/12] drm/i915: vlv clock cleanups Jani Nikula
2025-08-19 12:53 ` [RESEND 01/12] drm/i915: add vlv_clock_get_gpll() Jani Nikula
2025-08-19 12:53 ` [RESEND 02/12] drm/i915: add vlv_clock_get_czclk() Jani Nikula
2025-08-19 12:53 ` [RESEND 03/12] drm/i915: add vlv_clock_get_hrawclk() Jani Nikula
2025-08-19 12:53 ` [RESEND 04/12] drm/i915: make vlv_get_cck_clock_hpll() static Jani Nikula
2025-08-19 12:53 ` [RESEND 05/12] drm/i915: add vlv_clock_get_cdclk() Jani Nikula
2025-09-09 13:24 ` Ville Syrjälä [this message]
2025-08-19 12:53 ` [RESEND 06/12] drm/i915: make vlv_get_cck_clock() static Jani Nikula
2025-08-19 12:53 ` [RESEND 07/12] drm/i915: rename vlv_get_hpll_vco() to vlv_clock_get_hpll_vco() Jani Nikula
2025-08-19 12:53 ` [RESEND 08/12] drm/i915: cache the results in vlv_clock_get_hpll_vco() and use it more Jani Nikula
2025-08-19 12:53 ` [RESEND 09/12] drm/i915: remove intel_update_czclk() as unnecessary Jani Nikula
2025-08-19 12:53 ` [RESEND 10/12] drm/i915: log HPLL frequency similar to CZCLK Jani Nikula
2025-08-19 12:53 ` [RESEND 11/12] drm/i915: move hpll and czclk caching under display Jani Nikula
2025-08-19 12:53 ` [RESEND 12/12] drm/i915: split out vlv_clock.[ch] Jani Nikula
2025-08-19 13:51 ` ✗ i915.CI.BAT: failure for drm/i915: vlv clock cleanups (rev2) Patchwork
2025-09-02 15:01 ` [RESEND 00/12] drm/i915: vlv clock cleanups Michał Grzelak
2025-09-09 12:26 ` ✗ i915.CI.BAT: failure for drm/i915: vlv clock cleanups (rev3) Patchwork
2025-09-09 13:29 ` [RESEND 00/12] drm/i915: vlv clock cleanups Ville Syrjälä
2025-09-10 6:53 ` Jani Nikula
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=aMAqlVAw2NqlwQ5_@intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=intel-xe@lists.freedesktop.org \
--cc=jani.nikula@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).