drm/i915: Pass devdata to intel_bios_port_aux_ch()
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Wed, 8 Feb 2023 01:55:06 +0000 (03:55 +0200)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Tue, 14 Feb 2023 12:07:45 +0000 (14:07 +0200)
Currently intel_bios_port_aux_ch() digs out the devdata
(VBT child device info) from the vbt.ports[] array. We
need to get rid of that, so just pass in the correct
encoder->devdata (now that we have it also for g4x+ ports)
directly.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230208015508.24824-9-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
drivers/gpu/drm/i915/display/g4x_dp.c
drivers/gpu/drm/i915/display/g4x_hdmi.c
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 0cc1531..5a3e794 100644 (file)
@@ -1401,7 +1401,7 @@ bool g4x_dp_init(struct drm_i915_private *dev_priv,
        if (port != PORT_A)
                intel_infoframe_init(dig_port);
 
-       dig_port->aux_ch = intel_bios_port_aux_ch(dev_priv, port);
+       dig_port->aux_ch = intel_bios_port_aux_ch(dev_priv, devdata, port);
        if (!intel_dp_init_connector(dig_port, intel_connector))
                goto err_init_connector;
 
index e9ae4c6..3a11448 100644 (file)
@@ -639,6 +639,6 @@ void g4x_hdmi_init(struct drm_i915_private *dev_priv,
 
        intel_infoframe_init(dig_port);
 
-       dig_port->aux_ch = intel_bios_port_aux_ch(dev_priv, port);
+       dig_port->aux_ch = intel_bios_port_aux_ch(dev_priv, devdata, port);
        intel_hdmi_init_connector(dig_port, intel_connector);
 }
index 81bfb03..db0beb9 100644 (file)
@@ -3575,9 +3575,9 @@ bool intel_bios_get_dsc_params(struct intel_encoder *encoder,
 }
 
 enum aux_ch intel_bios_port_aux_ch(struct drm_i915_private *i915,
+                                  const struct intel_bios_encoder_data *devdata,
                                   enum port port)
 {
-       const struct intel_bios_encoder_data *devdata = i915->display.vbt.ports[port];
        enum aux_ch aux_ch;
 
        if (!devdata || !devdata->child.aux_channel) {
index cf9fbf5..eaff412 100644 (file)
@@ -248,7 +248,9 @@ bool intel_bios_is_port_present(struct drm_i915_private *dev_priv, enum port por
 bool intel_bios_is_port_edp(struct drm_i915_private *dev_priv, enum port port);
 bool intel_bios_is_port_dp_dual_mode(struct drm_i915_private *dev_priv, enum port port);
 bool intel_bios_is_dsi_present(struct drm_i915_private *dev_priv, enum port *port);
-enum aux_ch intel_bios_port_aux_ch(struct drm_i915_private *dev_priv, enum port port);
+enum aux_ch intel_bios_port_aux_ch(struct drm_i915_private *i915,
+                                  const struct intel_bios_encoder_data *devdata,
+                                  enum port port);
 bool intel_bios_get_dsc_params(struct intel_encoder *encoder,
                               struct intel_crtc_state *crtc_state,
                               int dsc_max_bpc);
index 136a683..bfd1e30 100644 (file)
@@ -4505,7 +4505,7 @@ void intel_ddi_init(struct drm_i915_private *dev_priv, enum port port)
 
        dig_port->dp.output_reg = INVALID_MMIO_REG;
        dig_port->max_lanes = intel_ddi_max_lanes(dig_port);
-       dig_port->aux_ch = intel_bios_port_aux_ch(dev_priv, port);
+       dig_port->aux_ch = intel_bios_port_aux_ch(dev_priv, devdata, port);
 
        if (intel_phy_is_tc(dev_priv, phy)) {
                bool is_legacy =