]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
drm/i915: Replace intel_bios_is_lane_reversal_needed() with intel_bios_encoder_lane_r...
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Wed, 8 Feb 2023 01:55:02 +0000 (03:55 +0200)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Tue, 14 Feb 2023 12:04:42 +0000 (14:04 +0200)
The sole user of intel_bios_is_lane_reversal_needed() has
the devdata already located, so pass it in directly instead
of digging it again from vbt.ports[].

And rename the function to follow the common pattern for
these things.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230208015508.24824-5-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <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_ddi.c

index 40dd143fdd1fc16cabc38c01d250266729509905..3cf5122c24018a95426e0487af1777cb5d258e56 100644 (file)
@@ -3594,22 +3594,6 @@ intel_bios_is_port_hpd_inverted(const struct drm_i915_private *i915,
        return devdata && devdata->child.hpd_invert;
 }
 
-/**
- * intel_bios_is_lane_reversal_needed - if lane reversal needed on port
- * @i915:       i915 device instance
- * @port:       port to check
- *
- * Return true if port requires lane reversal
- */
-bool
-intel_bios_is_lane_reversal_needed(const struct drm_i915_private *i915,
-                                  enum port port)
-{
-       const struct intel_bios_encoder_data *devdata = i915->display.vbt.ports[port];
-
-       return devdata && devdata->child.lane_reversal;
-}
-
 enum aux_ch intel_bios_port_aux_ch(struct drm_i915_private *i915,
                                   enum port port)
 {
@@ -3774,6 +3758,11 @@ bool intel_bios_encoder_supports_tbt(const struct intel_bios_encoder_data *devda
        return devdata->i915->display.vbt.version >= 209 && devdata->child.tbt;
 }
 
+bool intel_bios_encoder_lane_reversal(const struct intel_bios_encoder_data *devdata)
+{
+       return devdata && devdata->child.lane_reversal;
+}
+
 const struct intel_bios_encoder_data *
 intel_bios_encoder_data_lookup(struct drm_i915_private *i915, enum port port)
 {
index ad3edfe6ec3a3de241a84f2ef55e915eec3f8a14..29119145cf34a2514d5a69400cb762da8d425882 100644 (file)
@@ -250,8 +250,6 @@ bool intel_bios_is_port_dp_dual_mode(struct drm_i915_private *dev_priv, enum por
 bool intel_bios_is_dsi_present(struct drm_i915_private *dev_priv, enum port *port);
 bool intel_bios_is_port_hpd_inverted(const struct drm_i915_private *i915,
                                     enum port port);
-bool intel_bios_is_lane_reversal_needed(const struct drm_i915_private *i915,
-                                       enum port port);
 enum aux_ch intel_bios_port_aux_ch(struct drm_i915_private *dev_priv, enum port port);
 bool intel_bios_get_dsc_params(struct intel_encoder *encoder,
                               struct intel_crtc_state *crtc_state,
@@ -275,5 +273,6 @@ bool intel_bios_encoder_supports_tbt(const struct intel_bios_encoder_data *devda
 bool intel_bios_encoder_is_lspcon(const struct intel_bios_encoder_data *devdata);
 int intel_bios_encoder_dp_boost_level(const struct intel_bios_encoder_data *devdata);
 int intel_bios_encoder_hdmi_boost_level(const struct intel_bios_encoder_data *devdata);
+bool intel_bios_encoder_lane_reversal(const struct intel_bios_encoder_data *devdata);
 
 #endif /* _INTEL_BIOS_H_ */
index 2c64d5f4b8f3bf6d5956ec8de86010ea1fd1c626..136a683936089a29395375470eb707ce5006e036 100644 (file)
@@ -4500,7 +4500,7 @@ void intel_ddi_init(struct drm_i915_private *dev_priv, enum port port)
                        intel_de_read(dev_priv, DDI_BUF_CTL(port))
                        & (DDI_BUF_PORT_REVERSAL | DDI_A_4_LANES);
 
-       if (intel_bios_is_lane_reversal_needed(dev_priv, port))
+       if (intel_bios_encoder_lane_reversal(devdata))
                dig_port->saved_port_bits |= DDI_BUF_PORT_REVERSAL;
 
        dig_port->dp.output_reg = INVALID_MMIO_REG;