mirror of
https://github.com/torvalds/linux.git
synced 2026-06-07 14:04:54 +02:00
drm/i915/dram: add intel_fsb_freq() and use it
Add a more generic intel_fsb_freq() function instead of platform specific ones. Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Link: https://lore.kernel.org/r/c5b77311c5f64b7163c86a042b7d023c07a685e2.1755511595.git.jani.nikula@intel.com Signed-off-by: Jani Nikula <jani.nikula@intel.com>
This commit is contained in:
parent
1d409b0a77
commit
e0b1bbed5e
|
|
@ -3574,7 +3574,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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -154,7 +154,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;
|
||||
|
||||
|
|
@ -236,13 +236,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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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__ */
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user