]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
drm/i915/bios: add intel_bios_dp_max_link_rate()
authorJani Nikula <jani.nikula@intel.com>
Fri, 17 Jan 2020 14:29:25 +0000 (16:29 +0200)
committerJani Nikula <jani.nikula@intel.com>
Tue, 21 Jan 2020 08:51:28 +0000 (10:51 +0200)
Don't access i915->vbt.ddi_port_info[] directly.

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/8c30e1183afdd469c95b01f64ca0458b9e832404.1579270868.git.jani.nikula@intel.com
drivers/gpu/drm/i915/display/intel_bios.c
drivers/gpu/drm/i915/display/intel_bios.h
drivers/gpu/drm/i915/display/intel_dp.c

index 5882ffc1b2a6b7513545c1421f3f6ae70d83391c..dd3968456aeac72680f71d8f08a2c6c50385be0a 100644 (file)
@@ -2592,3 +2592,10 @@ int intel_bios_hdmi_boost_level(struct intel_encoder *encoder)
 
        return i915->vbt.ddi_port_info[encoder->port].hdmi_boost_level;
 }
+
+int intel_bios_dp_max_link_rate(struct intel_encoder *encoder)
+{
+       struct drm_i915_private *i915 = to_i915(encoder->base.dev);
+
+       return i915->vbt.ddi_port_info[encoder->port].dp_max_link_rate;
+}
index b1c11b9bea41772c108a117bcca77b7339efd58c..179d2eb49d7e5b7fbf0ae9b4be3f925cbfc9ae21 100644 (file)
@@ -251,5 +251,6 @@ int intel_bios_max_tmds_clock(struct intel_encoder *encoder);
 int intel_bios_hdmi_level_shift(struct intel_encoder *encoder);
 int intel_bios_dp_boost_level(struct intel_encoder *encoder);
 int intel_bios_hdmi_boost_level(struct intel_encoder *encoder);
+int intel_bios_dp_max_link_rate(struct intel_encoder *encoder);
 
 #endif /* _INTEL_BIOS_H_ */
index c7424e2a04a358068624fab83a5a53a79c8c0f62..3bfbd2b9a53ea3deb015faa66829fcf62832f4db 100644 (file)
@@ -323,11 +323,10 @@ intel_dp_set_source_rates(struct intel_dp *intel_dp)
                162000, 270000
        };
        struct intel_digital_port *dig_port = dp_to_dig_port(intel_dp);
+       struct intel_encoder *encoder = &dig_port->base;
        struct drm_i915_private *dev_priv = to_i915(dig_port->base.base.dev);
-       const struct ddi_vbt_port_info *info =
-               &dev_priv->vbt.ddi_port_info[dig_port->base.port];
        const int *source_rates;
-       int size, max_rate = 0, vbt_max_rate = info->dp_max_link_rate;
+       int size, max_rate = 0, vbt_max_rate;
 
        /* This should only be done once */
        WARN_ON(intel_dp->source_rates || intel_dp->num_source_rates);
@@ -354,6 +353,7 @@ intel_dp_set_source_rates(struct intel_dp *intel_dp)
                size = ARRAY_SIZE(g4x_rates);
        }
 
+       vbt_max_rate = intel_bios_dp_max_link_rate(encoder);
        if (max_rate && vbt_max_rate)
                max_rate = min(max_rate, vbt_max_rate);
        else if (vbt_max_rate)