Commit 46bdb77d authored by Ville Syrjälä's avatar Ville Syrjälä

drm/i915: Split intel_ddi_compute_min_voltage_level() into platform variants

The mess inside intel_ddi_compute_min_voltage_level() is illegible.
Clean it up a bit by splitting the internals into per-platform
functions.

TODO: make it a vfunc?
Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20231128115138.13238-7-ville.syrjala@linux.intel.comReviewed-by: default avatarGustavo Sousa <gustavo.sousa@intel.com>
parent 273361f5
......@@ -3672,16 +3672,39 @@ static bool intel_ddi_is_audio_enabled(struct drm_i915_private *dev_priv,
AUDIO_OUTPUT_ENABLE(cpu_transcoder);
}
static int tgl_ddi_min_voltage_level(const struct intel_crtc_state *crtc_state)
{
if (crtc_state->port_clock > 594000)
return 2;
else
return 0;
}
static int jsl_ddi_min_voltage_level(const struct intel_crtc_state *crtc_state)
{
if (crtc_state->port_clock > 594000)
return 3;
else
return 0;
}
static int icl_ddi_min_voltage_level(const struct intel_crtc_state *crtc_state)
{
if (crtc_state->port_clock > 594000)
return 1;
else
return 0;
}
void intel_ddi_compute_min_voltage_level(struct drm_i915_private *dev_priv,
struct intel_crtc_state *crtc_state)
{
if (DISPLAY_VER(dev_priv) >= 12 && crtc_state->port_clock > 594000)
crtc_state->min_voltage_level = 2;
else if ((IS_JASPERLAKE(dev_priv) || IS_ELKHARTLAKE(dev_priv)) &&
crtc_state->port_clock > 594000)
crtc_state->min_voltage_level = 3;
else if (DISPLAY_VER(dev_priv) >= 11 && crtc_state->port_clock > 594000)
crtc_state->min_voltage_level = 1;
if (DISPLAY_VER(dev_priv) >= 12)
crtc_state->min_voltage_level = tgl_ddi_min_voltage_level(crtc_state);
else if (IS_JASPERLAKE(dev_priv) || IS_ELKHARTLAKE(dev_priv))
crtc_state->min_voltage_level = jsl_ddi_min_voltage_level(crtc_state);
else if (DISPLAY_VER(dev_priv) >= 11)
crtc_state->min_voltage_level = icl_ddi_min_voltage_level(crtc_state);
}
static enum transcoder bdw_transcoder_master_readout(struct drm_i915_private *dev_priv,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment