drm/i915/bios: save a higher level pointer in ddi_vbt_port_info[]
authorJani Nikula <jani.nikula@intel.com>
Wed, 17 Mar 2021 16:36:50 +0000 (18:36 +0200)
committerJani Nikula <jani.nikula@intel.com>
Thu, 18 Mar 2021 12:44:09 +0000 (14:44 +0200)
We'll be needing the intel_bios_encoder_data pointer going forward, and
it's just easier to store the higher level pointer in the
ddi_vbt_port_info[] array.

Cc: Lucas De Marchi <lucas.demarchi@intel.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/89717516e99afccfecf1a7c6c938b8349f65e985.1615998927.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/i915_drv.h

index cf36c93..441274d 100644 (file)
@@ -1513,7 +1513,7 @@ static enum port get_port_by_ddc_pin(struct drm_i915_private *i915, u8 ddc_pin)
        for_each_port(port) {
                info = &i915->vbt.ddi_port_info[port];
 
-               if (info->child && ddc_pin == info->alternate_ddc_pin)
+               if (info->devdata && ddc_pin == info->alternate_ddc_pin)
                        return port;
        }
 
@@ -1563,7 +1563,7 @@ static enum port get_port_by_aux_ch(struct drm_i915_private *i915, u8 aux_ch)
        for_each_port(port) {
                info = &i915->vbt.ddi_port_info[port];
 
-               if (info->child && aux_ch == info->alternate_aux_channel)
+               if (info->devdata && aux_ch == info->alternate_aux_channel)
                        return port;
        }
 
@@ -1862,7 +1862,7 @@ static void parse_ddi_port(struct drm_i915_private *i915,
 
        info = &i915->vbt.ddi_port_info[port];
 
-       if (info->child) {
+       if (info->devdata) {
                drm_dbg_kms(&i915->drm,
                            "More than one child device for port %c in VBT, using the first.\n",
                            port_name(port));
@@ -1976,7 +1976,7 @@ static void parse_ddi_port(struct drm_i915_private *i915,
                            port_name(port), info->dp_max_link_rate);
        }
 
-       info->child = child;
+       info->devdata = devdata;
 }
 
 static void parse_ddi_ports(struct drm_i915_private *i915)
@@ -2517,7 +2517,7 @@ bool intel_bios_is_port_present(struct drm_i915_private *i915, enum port port)
                const struct ddi_vbt_port_info *port_info =
                        &i915->vbt.ddi_port_info[port];
 
-               return port_info->child;
+               return port_info->devdata;
        }
 
        /* FIXME maybe deal with port A as well? */
@@ -2764,13 +2764,13 @@ bool
 intel_bios_is_port_hpd_inverted(const struct drm_i915_private *i915,
                                enum port port)
 {
-       const struct child_device_config *child =
-               i915->vbt.ddi_port_info[port].child;
+       const struct intel_bios_encoder_data *devdata =
+               i915->vbt.ddi_port_info[port].devdata;
 
        if (drm_WARN_ON_ONCE(&i915->drm, !IS_GEN9_LP(i915)))
                return false;
 
-       return child && child->hpd_invert;
+       return devdata && devdata->child.hpd_invert;
 }
 
 /**
@@ -2784,10 +2784,10 @@ bool
 intel_bios_is_lspcon_present(const struct drm_i915_private *i915,
                             enum port port)
 {
-       const struct child_device_config *child =
-               i915->vbt.ddi_port_info[port].child;
+       const struct intel_bios_encoder_data *devdata =
+               i915->vbt.ddi_port_info[port].devdata;
 
-       return HAS_LSPCON(i915) && child && child->lspcon;
+       return HAS_LSPCON(i915) && devdata && devdata->child.lspcon;
 }
 
 /**
@@ -2801,10 +2801,10 @@ bool
 intel_bios_is_lane_reversal_needed(const struct drm_i915_private *i915,
                                   enum port port)
 {
-       const struct child_device_config *child =
-               i915->vbt.ddi_port_info[port].child;
+       const struct intel_bios_encoder_data *devdata =
+               i915->vbt.ddi_port_info[port].devdata;
 
-       return child && child->lane_reversal;
+       return devdata && devdata->child.lane_reversal;
 }
 
 enum aux_ch intel_bios_port_aux_ch(struct drm_i915_private *i915,
index f25190e..6591cf7 100644 (file)
@@ -33,6 +33,7 @@
 #include <linux/types.h>
 
 struct drm_i915_private;
+struct intel_bios_encoder_data;
 struct intel_crtc_state;
 struct intel_encoder;
 enum port;
index 96fffde..89fd4ad 100644 (file)
@@ -582,7 +582,7 @@ i915_fence_timeout(const struct drm_i915_private *i915)
 
 struct ddi_vbt_port_info {
        /* Non-NULL if port present. */
-       const struct child_device_config *child;
+       const struct intel_bios_encoder_data *devdata;
 
        int max_tmds_clock;