From: Rodrigo Vivi <rodrigo.vivi@intel.com>
To: Jani Nikula <jani.nikula@intel.com>
Cc: <intel-gfx@lists.freedesktop.org>, <intel-xe@lists.freedesktop.org>
Subject: Re: [PATCH 1/5] drm/i915/dram: add intel_fsb_freq() and use it
Date: Tue, 5 Aug 2025 18:17:22 -0400 [thread overview]
Message-ID: <aJKC8vKZvibSr_av@intel.com> (raw)
In-Reply-To: <05aff5118d67d1b3426c5337de1e73e523d643f1.1753971617.git.jani.nikula@intel.com>
On Thu, Jul 31, 2025 at 05:21:21PM +0300, Jani Nikula wrote:
> Add a more generic intel_fsb_freq() function instead of platform
> specific ones.
>
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
> ---
> drivers/gpu/drm/i915/display/intel_cdclk.c | 2 +-
> drivers/gpu/drm/i915/gt/intel_gt_clock_utils.c | 2 +-
> drivers/gpu/drm/i915/soc/intel_dram.c | 14 ++++++++++----
> drivers/gpu/drm/i915/soc/intel_dram.h | 2 +-
> 4 files changed, 13 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_cdclk.c b/drivers/gpu/drm/i915/display/intel_cdclk.c
> index 228aa64c1349..50f8e8e7b2a2 100644
> --- a/drivers/gpu/drm/i915/display/intel_cdclk.c
> +++ b/drivers/gpu/drm/i915/display/intel_cdclk.c
> @@ -3569,7 +3569,7 @@ static int i9xx_hrawclk(struct intel_display *display)
> struct drm_i915_private *i915 = to_i915(display->drm);
>
> /* hrawclock is 1/4 the FSB frequency */
> - return DIV_ROUND_CLOSEST(i9xx_fsb_freq(i915), 4);
> + return DIV_ROUND_CLOSEST(intel_fsb_freq(i915), 4);
> }
>
> /**
> diff --git a/drivers/gpu/drm/i915/gt/intel_gt_clock_utils.c b/drivers/gpu/drm/i915/gt/intel_gt_clock_utils.c
> index 6c499692d61e..88b147fa5cb1 100644
> --- a/drivers/gpu/drm/i915/gt/intel_gt_clock_utils.c
> +++ b/drivers/gpu/drm/i915/gt/intel_gt_clock_utils.c
> @@ -148,7 +148,7 @@ static u32 gen4_read_clock_frequency(struct intel_uncore *uncore)
> *
> * Testing on actual hardware has shown there is no /16.
> */
> - return DIV_ROUND_CLOSEST(i9xx_fsb_freq(uncore->i915), 4) * 1000;
> + return DIV_ROUND_CLOSEST(intel_fsb_freq(uncore->i915), 4) * 1000;
> }
>
> static u32 read_clock_frequency(struct intel_uncore *uncore)
> diff --git a/drivers/gpu/drm/i915/soc/intel_dram.c b/drivers/gpu/drm/i915/soc/intel_dram.c
> index deb159548a09..6be3618d4885 100644
> --- a/drivers/gpu/drm/i915/soc/intel_dram.c
> +++ b/drivers/gpu/drm/i915/soc/intel_dram.c
> @@ -153,7 +153,7 @@ static void detect_mem_freq(struct drm_i915_private *i915)
> drm_dbg(&i915->drm, "DDR speed: %d kHz\n", i915->mem_freq);
> }
>
> -unsigned int i9xx_fsb_freq(struct drm_i915_private *i915)
> +static unsigned int i9xx_fsb_freq(struct drm_i915_private *i915)
> {
> u32 fsb;
>
> @@ -235,13 +235,19 @@ static unsigned int ilk_fsb_freq(struct drm_i915_private *dev_priv)
> }
> }
>
> -static void detect_fsb_freq(struct drm_i915_private *i915)
> +unsigned int intel_fsb_freq(struct drm_i915_private *i915)
> {
> if (GRAPHICS_VER(i915) == 5)
> - i915->fsb_freq = ilk_fsb_freq(i915);
> + return ilk_fsb_freq(i915);
> else if (GRAPHICS_VER(i915) == 3 || GRAPHICS_VER(i915) == 4)
> - i915->fsb_freq = i9xx_fsb_freq(i915);
> + return i9xx_fsb_freq(i915);
> + else
> + return 0;
> +}
>
> +static void detect_fsb_freq(struct drm_i915_private *i915)
> +{
> + i915->fsb_freq = intel_fsb_freq(i915);
> if (i915->fsb_freq)
> drm_dbg(&i915->drm, "FSB frequency: %d kHz\n", i915->fsb_freq);
> }
> diff --git a/drivers/gpu/drm/i915/soc/intel_dram.h b/drivers/gpu/drm/i915/soc/intel_dram.h
> index 2a696e03aad4..09a7a581d949 100644
> --- a/drivers/gpu/drm/i915/soc/intel_dram.h
> +++ b/drivers/gpu/drm/i915/soc/intel_dram.h
> @@ -33,7 +33,7 @@ struct dram_info {
>
> void intel_dram_edram_detect(struct drm_i915_private *i915);
> int intel_dram_detect(struct drm_i915_private *i915);
> -unsigned int i9xx_fsb_freq(struct drm_i915_private *i915);
> +unsigned int intel_fsb_freq(struct drm_i915_private *i915);
> const struct dram_info *intel_dram_info(struct drm_device *drm);
>
> #endif /* __INTEL_DRAM_H__ */
> --
> 2.39.5
>
next prev parent reply other threads:[~2025-08-05 22:17 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-31 14:21 [PATCH 0/5] drm/i915 and drm/xe: remove fsb/mem freq cleanups Jani Nikula
2025-07-31 14:21 ` [PATCH 1/5] drm/i915/dram: add intel_fsb_freq() and use it Jani Nikula
2025-08-05 22:17 ` Rodrigo Vivi [this message]
2025-07-31 14:21 ` [PATCH 2/5] drm/i915/dram: add intel_mem_freq() Jani Nikula
2025-08-05 22:18 ` Rodrigo Vivi
2025-07-31 14:21 ` [PATCH 3/5] drm/i915/rps: use intel_fsb_freq() and intel_mem_freq() Jani Nikula
2025-08-05 22:20 ` Rodrigo Vivi
2025-07-31 14:21 ` [PATCH 4/5] drm/i915/dram: bypass fsb/mem freq detection on dg2 and no display Jani Nikula
2025-08-05 22:24 ` Rodrigo Vivi
2025-08-06 13:52 ` Jani Nikula
2025-08-15 15:43 ` Rodrigo Vivi
2025-07-31 14:21 ` [PATCH 5/5] drm/i915/dram: move fsb_freq and mem_freq to dram info Jani Nikula
2025-08-05 22:28 ` Rodrigo Vivi
2025-08-06 13:57 ` Jani Nikula
2025-08-15 15:49 ` Rodrigo Vivi
2025-07-31 16:58 ` ✗ i915.CI.BAT: failure for drm/i915 and drm/xe: remove fsb/mem freq cleanups Patchwork
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=aJKC8vKZvibSr_av@intel.com \
--to=rodrigo.vivi@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).