Commit b90b6e41 authored by Ville Syrjälä's avatar Ville Syrjälä

drm/i915/bios: Introduce has_ddi_port_info()

Pull the "do we want to use i915->vbt.ports[]?" check into
a central place.
Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20211217155403.31477-2-ville.syrjala@linux.intel.comReviewed-by: default avatarJani Nikula <jani.nikula@intel.com>
parent 8172375e
...@@ -2053,6 +2053,11 @@ static void parse_ddi_port(struct drm_i915_private *i915, ...@@ -2053,6 +2053,11 @@ static void parse_ddi_port(struct drm_i915_private *i915,
i915->vbt.ports[port] = devdata; i915->vbt.ports[port] = devdata;
} }
static bool has_ddi_port_info(struct drm_i915_private *i915)
{
return HAS_DDI(i915);
}
static void parse_ddi_ports(struct drm_i915_private *i915) static void parse_ddi_ports(struct drm_i915_private *i915)
{ {
struct intel_bios_encoder_data *devdata; struct intel_bios_encoder_data *devdata;
...@@ -2653,7 +2658,7 @@ bool intel_bios_is_port_present(struct drm_i915_private *i915, enum port port) ...@@ -2653,7 +2658,7 @@ bool intel_bios_is_port_present(struct drm_i915_private *i915, enum port port)
[PORT_F] = { DVO_PORT_DPF, DVO_PORT_HDMIF, }, [PORT_F] = { DVO_PORT_DPF, DVO_PORT_HDMIF, },
}; };
if (HAS_DDI(i915)) if (has_ddi_port_info(i915))
return i915->vbt.ports[port]; return i915->vbt.ports[port];
/* FIXME maybe deal with port A as well? */ /* FIXME maybe deal with port A as well? */
...@@ -2693,7 +2698,7 @@ bool intel_bios_is_port_edp(struct drm_i915_private *i915, enum port port) ...@@ -2693,7 +2698,7 @@ bool intel_bios_is_port_edp(struct drm_i915_private *i915, enum port port)
[PORT_F] = DVO_PORT_DPF, [PORT_F] = DVO_PORT_DPF,
}; };
if (HAS_DDI(i915)) { if (has_ddi_port_info(i915)) {
const struct intel_bios_encoder_data *devdata; const struct intel_bios_encoder_data *devdata;
devdata = intel_bios_encoder_data_lookup(i915, port); devdata = intel_bios_encoder_data_lookup(i915, port);
...@@ -2748,7 +2753,7 @@ bool intel_bios_is_port_dp_dual_mode(struct drm_i915_private *i915, ...@@ -2748,7 +2753,7 @@ bool intel_bios_is_port_dp_dual_mode(struct drm_i915_private *i915,
}; };
const struct intel_bios_encoder_data *devdata; const struct intel_bios_encoder_data *devdata;
if (HAS_DDI(i915)) { if (has_ddi_port_info(i915)) {
const struct intel_bios_encoder_data *devdata; const struct intel_bios_encoder_data *devdata;
devdata = intel_bios_encoder_data_lookup(i915, port); devdata = intel_bios_encoder_data_lookup(i915, port);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment