drm/i915/mtl: Calculate the correct voltage level from port_clock
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Tue, 28 Nov 2023 11:51:37 +0000 (13:51 +0200)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Wed, 13 Dec 2023 18:50:24 +0000 (20:50 +0200)
On MTL we need to bump the voltage level to only 1 (not 2)
when port clock exceeds 594MHz. Make it so.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20231128115138.13238-8-ville.syrjala@linux.intel.com
Reviewed-by: Gustavo Sousa <gustavo.sousa@intel.com>
drivers/gpu/drm/i915/display/intel_ddi.c

index bcfcd7e789f014561d1be3d15f7d9b715fa31e06..dd04bd7b348c51a765238f53631b94a1e450c7c2 100644 (file)
@@ -3699,7 +3699,9 @@ static int icl_ddi_min_voltage_level(const struct intel_crtc_state *crtc_state)
 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)
+       if (DISPLAY_VER(dev_priv) >= 14)
+               crtc_state->min_voltage_level = icl_ddi_min_voltage_level(crtc_state);
+       else 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);