drm/i915: move rawclk from runtime to display runtime info
BugLink: https://bugs.launchpad.net/bugs/2099996 commit a9556637a23311dea96f27fa3c3e5bfba0b38ae4 upstream. It's mostly about display, so move it under display. This should also fix rawclk freq initialization in the xe driver. v2: Change the init location Link: https://lore.kernel.org/r/20240819133138.147511-2-maarten.lankhorst@linux.intel.com Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/39330d09c48509e013f01fd0247a9b7c291173e2.1724144570.git.jani.nikula@intel.com Signed-off-by: Jani Nikula <jani.nikula@intel.com> Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> [koichiroden: adjusted gen4_read_clock_frequency() in drivers/gpu/drm/i915/gt/intel_gt_clock_utils.c due to missing commit: d0a6e5015f0e ("drm/i915: use i9xx_fsb_freq() for GT clock frequency")] Signed-off-by: Koichiro Den <koichiro.den@canonical.com> Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
This commit is contained in:
committed by
Stefan Bader
parent
96f80cee19
commit
bdec4d66ae
@@ -1011,7 +1011,7 @@ static u32 cnp_hz_to_pwm(struct intel_connector *connector, u32 pwm_freq_hz)
|
||||
{
|
||||
struct drm_i915_private *i915 = to_i915(connector->base.dev);
|
||||
|
||||
return DIV_ROUND_CLOSEST(KHz(RUNTIME_INFO(i915)->rawclk_freq),
|
||||
return DIV_ROUND_CLOSEST(KHz(DISPLAY_RUNTIME_INFO(i915)->rawclk_freq),
|
||||
pwm_freq_hz);
|
||||
}
|
||||
|
||||
@@ -1073,7 +1073,7 @@ static u32 pch_hz_to_pwm(struct intel_connector *connector, u32 pwm_freq_hz)
|
||||
{
|
||||
struct drm_i915_private *i915 = to_i915(connector->base.dev);
|
||||
|
||||
return DIV_ROUND_CLOSEST(KHz(RUNTIME_INFO(i915)->rawclk_freq),
|
||||
return DIV_ROUND_CLOSEST(KHz(DISPLAY_RUNTIME_INFO(i915)->rawclk_freq),
|
||||
pwm_freq_hz * 128);
|
||||
}
|
||||
|
||||
@@ -1091,7 +1091,7 @@ static u32 i9xx_hz_to_pwm(struct intel_connector *connector, u32 pwm_freq_hz)
|
||||
int clock;
|
||||
|
||||
if (IS_PINEVIEW(i915))
|
||||
clock = KHz(RUNTIME_INFO(i915)->rawclk_freq);
|
||||
clock = KHz(DISPLAY_RUNTIME_INFO(i915)->rawclk_freq);
|
||||
else
|
||||
clock = KHz(i915->display.cdclk.hw.cdclk);
|
||||
|
||||
@@ -1109,7 +1109,7 @@ static u32 i965_hz_to_pwm(struct intel_connector *connector, u32 pwm_freq_hz)
|
||||
int clock;
|
||||
|
||||
if (IS_G4X(i915))
|
||||
clock = KHz(RUNTIME_INFO(i915)->rawclk_freq);
|
||||
clock = KHz(DISPLAY_RUNTIME_INFO(i915)->rawclk_freq);
|
||||
else
|
||||
clock = KHz(i915->display.cdclk.hw.cdclk);
|
||||
|
||||
@@ -1133,7 +1133,7 @@ static u32 vlv_hz_to_pwm(struct intel_connector *connector, u32 pwm_freq_hz)
|
||||
clock = MHz(25);
|
||||
mul = 16;
|
||||
} else {
|
||||
clock = KHz(RUNTIME_INFO(i915)->rawclk_freq);
|
||||
clock = KHz(DISPLAY_RUNTIME_INFO(i915)->rawclk_freq);
|
||||
mul = 128;
|
||||
}
|
||||
|
||||
|
||||
@@ -1098,6 +1098,9 @@ static void __intel_display_device_info_runtime_init(struct drm_i915_private *i9
|
||||
}
|
||||
}
|
||||
|
||||
display_runtime->rawclk_freq = intel_read_rawclk(i915);
|
||||
drm_dbg_kms(&i915->drm, "rawclk rate: %d kHz\n", display_runtime->rawclk_freq);
|
||||
|
||||
return;
|
||||
|
||||
display_fused_off:
|
||||
@@ -1140,6 +1143,8 @@ void intel_display_device_info_print(const struct intel_display_device_info *inf
|
||||
drm_printf(p, "has_hdcp: %s\n", str_yes_no(runtime->has_hdcp));
|
||||
drm_printf(p, "has_dmc: %s\n", str_yes_no(runtime->has_dmc));
|
||||
drm_printf(p, "has_dsc: %s\n", str_yes_no(runtime->has_dsc));
|
||||
|
||||
drm_printf(p, "rawclk rate: %u kHz\n", runtime->rawclk_freq);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -115,6 +115,8 @@ struct intel_display_runtime_info {
|
||||
u16 step;
|
||||
} ip;
|
||||
|
||||
u32 rawclk_freq;
|
||||
|
||||
u8 pipe_mask;
|
||||
u8 cpu_transcoder_mask;
|
||||
u16 port_mask;
|
||||
|
||||
@@ -1174,9 +1174,9 @@ static void vlv_init_display_clock_gating(struct drm_i915_private *dev_priv)
|
||||
MI_ARB_DISPLAY_TRICKLE_FEED_DISABLE);
|
||||
intel_de_write(dev_priv, CBR1_VLV, 0);
|
||||
|
||||
drm_WARN_ON(&dev_priv->drm, RUNTIME_INFO(dev_priv)->rawclk_freq == 0);
|
||||
drm_WARN_ON(&dev_priv->drm, DISPLAY_RUNTIME_INFO(dev_priv)->rawclk_freq == 0);
|
||||
intel_de_write(dev_priv, RAWCLK_FREQ_VLV,
|
||||
DIV_ROUND_CLOSEST(RUNTIME_INFO(dev_priv)->rawclk_freq,
|
||||
DIV_ROUND_CLOSEST(DISPLAY_RUNTIME_INFO(dev_priv)->rawclk_freq,
|
||||
1000));
|
||||
}
|
||||
|
||||
|
||||
@@ -84,7 +84,7 @@ static u32 g4x_get_aux_clock_divider(struct intel_dp *intel_dp, int index)
|
||||
* The clock divider is based off the hrawclk, and would like to run at
|
||||
* 2MHz. So, take the hrawclk value and divide by 2000 and use that
|
||||
*/
|
||||
return DIV_ROUND_CLOSEST(RUNTIME_INFO(i915)->rawclk_freq, 2000);
|
||||
return DIV_ROUND_CLOSEST(DISPLAY_RUNTIME_INFO(i915)->rawclk_freq, 2000);
|
||||
}
|
||||
|
||||
static u32 ilk_get_aux_clock_divider(struct intel_dp *intel_dp, int index)
|
||||
@@ -104,7 +104,7 @@ static u32 ilk_get_aux_clock_divider(struct intel_dp *intel_dp, int index)
|
||||
if (dig_port->aux_ch == AUX_CH_A)
|
||||
freq = i915->display.cdclk.hw.cdclk;
|
||||
else
|
||||
freq = RUNTIME_INFO(i915)->rawclk_freq;
|
||||
freq = DISPLAY_RUNTIME_INFO(i915)->rawclk_freq;
|
||||
return DIV_ROUND_CLOSEST(freq, 2000);
|
||||
}
|
||||
|
||||
|
||||
@@ -1481,7 +1481,7 @@ static void pps_init_registers(struct intel_dp *intel_dp, bool force_disable_vdd
|
||||
{
|
||||
struct drm_i915_private *dev_priv = dp_to_i915(intel_dp);
|
||||
u32 pp_on, pp_off, port_sel = 0;
|
||||
int div = RUNTIME_INFO(dev_priv)->rawclk_freq / 1000;
|
||||
int div = DISPLAY_RUNTIME_INFO(dev_priv)->rawclk_freq / 1000;
|
||||
struct pps_registers regs;
|
||||
enum port port = dp_to_dig_port(intel_dp)->base.port;
|
||||
const struct edp_power_seq *seq = &intel_dp->pps.pps_delays;
|
||||
|
||||
@@ -151,7 +151,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 DISPLAY_RUNTIME_INFO(uncore->i915)->rawclk_freq * 1000;
|
||||
}
|
||||
|
||||
static u32 read_clock_frequency(struct intel_uncore *uncore)
|
||||
|
||||
@@ -126,7 +126,6 @@ void intel_device_info_print(const struct intel_device_info *info,
|
||||
#undef PRINT_FLAG
|
||||
|
||||
drm_printf(p, "has_pooled_eu: %s\n", str_yes_no(runtime->has_pooled_eu));
|
||||
drm_printf(p, "rawclk rate: %u kHz\n", runtime->rawclk_freq);
|
||||
}
|
||||
|
||||
#undef INTEL_VGA_DEVICE
|
||||
@@ -372,10 +371,6 @@ void intel_device_info_runtime_init(struct drm_i915_private *dev_priv)
|
||||
"Disabling ppGTT for VT-d support\n");
|
||||
runtime->ppgtt_type = INTEL_PPGTT_NONE;
|
||||
}
|
||||
|
||||
runtime->rawclk_freq = intel_read_rawclk(dev_priv);
|
||||
drm_dbg(&dev_priv->drm, "rawclk rate: %d kHz\n", runtime->rawclk_freq);
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -206,8 +206,6 @@ struct intel_runtime_info {
|
||||
|
||||
u16 device_id;
|
||||
|
||||
u32 rawclk_freq;
|
||||
|
||||
struct intel_step_info step;
|
||||
|
||||
unsigned int page_sizes; /* page sizes supported by the HW */
|
||||
|
||||
Reference in New Issue
Block a user