drm/i915: use i9xx_fsb_freq() for GT clock frequency
Reuse i9xx_fsb_freq() for GT clock frequency initialization instead of depending on rawclk_freq. Note: If the init order was changed, we could use i915->fsb_freq directly. However, GT clock initialization is done in i915_driver_mmio_probe(), but intel_dram_detect() later in i915_driver_hw_probe(), with a dependency on intel_pcode_init(). Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/0678d8ec9772725b47d4fa5b14e3b3a34256d5cf.1718356614.git.jani.nikula@intel.com Signed-off-by: Jani Nikula <jani.nikula@intel.com>
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
#include "intel_gt_clock_utils.h"
|
||||
#include "intel_gt_print.h"
|
||||
#include "intel_gt_regs.h"
|
||||
#include "soc/intel_dram.h"
|
||||
|
||||
static u32 read_reference_ts_freq(struct intel_uncore *uncore)
|
||||
{
|
||||
@@ -151,7 +152,7 @@ static u32 gen4_read_clock_frequency(struct intel_uncore *uncore)
|
||||
*
|
||||
* Testing on actual hardware has shown there is no /16.
|
||||
*/
|
||||
return RUNTIME_INFO(uncore->i915)->rawclk_freq * 1000;
|
||||
return DIV_ROUND_CLOSEST(i9xx_fsb_freq(uncore->i915), 4) * 1000;
|
||||
}
|
||||
|
||||
static u32 read_clock_frequency(struct intel_uncore *uncore)
|
||||
|
||||
@@ -142,7 +142,7 @@ static void detect_mem_freq(struct drm_i915_private *i915)
|
||||
drm_dbg(&i915->drm, "DDR speed: %d kHz\n", i915->mem_freq);
|
||||
}
|
||||
|
||||
static unsigned int i9xx_fsb_freq(struct drm_i915_private *i915)
|
||||
unsigned int i9xx_fsb_freq(struct drm_i915_private *i915)
|
||||
{
|
||||
u32 fsb;
|
||||
|
||||
|
||||
@@ -10,5 +10,6 @@ struct drm_i915_private;
|
||||
|
||||
void intel_dram_edram_detect(struct drm_i915_private *i915);
|
||||
void intel_dram_detect(struct drm_i915_private *i915);
|
||||
unsigned int i9xx_fsb_freq(struct drm_i915_private *i915);
|
||||
|
||||
#endif /* __INTEL_DRAM_H__ */
|
||||
|
||||
Reference in New Issue
Block a user