Commit 9d4b7af5 authored by Ville Syrjälä's avatar Ville Syrjälä

drm/i915: Use encoder->devdata in eDP init

Since we now populate encoder->devdata for all DP capable
platforms we can consult it directly during the eDP
connector init instead of taking a detour via some global
list/array.

Unfortunately we can't quite get rid of
intel_dp_is_port_edp() since it's still used by the higher
level ilk/vlv/chv output setup code.
Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230208015508.24824-11-ville.syrjala@linux.intel.comReviewed-by: default avatarJani Nikula <jani.nikula@intel.com>
parent b17a15d6
...@@ -2585,7 +2585,7 @@ intel_bios_encoder_supports_dp(const struct intel_bios_encoder_data *devdata) ...@@ -2585,7 +2585,7 @@ intel_bios_encoder_supports_dp(const struct intel_bios_encoder_data *devdata)
return devdata->child.device_type & DEVICE_TYPE_DISPLAYPORT_OUTPUT; return devdata->child.device_type & DEVICE_TYPE_DISPLAYPORT_OUTPUT;
} }
static bool bool
intel_bios_encoder_supports_edp(const struct intel_bios_encoder_data *devdata) intel_bios_encoder_supports_edp(const struct intel_bios_encoder_data *devdata)
{ {
return intel_bios_encoder_supports_dp(devdata) && return intel_bios_encoder_supports_dp(devdata) &&
...@@ -3417,21 +3417,6 @@ bool intel_bios_is_port_present(struct drm_i915_private *i915, enum port port) ...@@ -3417,21 +3417,6 @@ bool intel_bios_is_port_present(struct drm_i915_private *i915, enum port port)
return false; return false;
} }
/**
* intel_bios_is_port_edp - is the device in given port eDP
* @i915: i915 device instance
* @port: port to check
*
* Return true if the device in %port is eDP.
*/
bool intel_bios_is_port_edp(struct drm_i915_private *i915, enum port port)
{
const struct intel_bios_encoder_data *devdata =
intel_bios_encoder_data_lookup(i915, port);
return devdata && intel_bios_encoder_supports_edp(devdata);
}
static bool intel_bios_encoder_supports_dp_dual_mode(const struct intel_bios_encoder_data *devdata) static bool intel_bios_encoder_supports_dp_dual_mode(const struct intel_bios_encoder_data *devdata)
{ {
const struct child_device_config *child = &devdata->child; const struct child_device_config *child = &devdata->child;
......
...@@ -268,6 +268,7 @@ intel_bios_encoder_data_lookup(struct drm_i915_private *i915, enum port port); ...@@ -268,6 +268,7 @@ intel_bios_encoder_data_lookup(struct drm_i915_private *i915, enum port port);
bool intel_bios_encoder_supports_dvi(const struct intel_bios_encoder_data *devdata); bool intel_bios_encoder_supports_dvi(const struct intel_bios_encoder_data *devdata);
bool intel_bios_encoder_supports_hdmi(const struct intel_bios_encoder_data *devdata); bool intel_bios_encoder_supports_hdmi(const struct intel_bios_encoder_data *devdata);
bool intel_bios_encoder_supports_dp(const struct intel_bios_encoder_data *devdata); bool intel_bios_encoder_supports_dp(const struct intel_bios_encoder_data *devdata);
bool intel_bios_encoder_supports_edp(const struct intel_bios_encoder_data *devdata);
bool intel_bios_encoder_supports_typec_usb(const struct intel_bios_encoder_data *devdata); bool intel_bios_encoder_supports_typec_usb(const struct intel_bios_encoder_data *devdata);
bool intel_bios_encoder_supports_tbt(const struct intel_bios_encoder_data *devdata); bool intel_bios_encoder_supports_tbt(const struct intel_bios_encoder_data *devdata);
bool intel_bios_encoder_is_lspcon(const struct intel_bios_encoder_data *devdata); bool intel_bios_encoder_is_lspcon(const struct intel_bios_encoder_data *devdata);
......
...@@ -5141,8 +5141,9 @@ intel_dp_hpd_pulse(struct intel_digital_port *dig_port, bool long_hpd) ...@@ -5141,8 +5141,9 @@ intel_dp_hpd_pulse(struct intel_digital_port *dig_port, bool long_hpd)
return IRQ_HANDLED; return IRQ_HANDLED;
} }
/* check the VBT to see whether the eDP is on another port */ static bool _intel_dp_is_port_edp(struct drm_i915_private *dev_priv,
bool intel_dp_is_port_edp(struct drm_i915_private *dev_priv, enum port port) const struct intel_bios_encoder_data *devdata,
enum port port)
{ {
/* /*
* eDP not supported on g4x. so bail out early just * eDP not supported on g4x. so bail out early just
...@@ -5154,7 +5155,15 @@ bool intel_dp_is_port_edp(struct drm_i915_private *dev_priv, enum port port) ...@@ -5154,7 +5155,15 @@ bool intel_dp_is_port_edp(struct drm_i915_private *dev_priv, enum port port)
if (DISPLAY_VER(dev_priv) < 9 && port == PORT_A) if (DISPLAY_VER(dev_priv) < 9 && port == PORT_A)
return true; return true;
return intel_bios_is_port_edp(dev_priv, port); return devdata && intel_bios_encoder_supports_edp(devdata);
}
bool intel_dp_is_port_edp(struct drm_i915_private *i915, enum port port)
{
const struct intel_bios_encoder_data *devdata =
intel_bios_encoder_data_lookup(i915, port);
return _intel_dp_is_port_edp(i915, devdata, port);
} }
static bool static bool
...@@ -5427,7 +5436,7 @@ intel_dp_init_connector(struct intel_digital_port *dig_port, ...@@ -5427,7 +5436,7 @@ intel_dp_init_connector(struct intel_digital_port *dig_port,
intel_dp->DP = intel_de_read(dev_priv, intel_dp->output_reg); intel_dp->DP = intel_de_read(dev_priv, intel_dp->output_reg);
intel_dp->attached_connector = intel_connector; intel_dp->attached_connector = intel_connector;
if (intel_dp_is_port_edp(dev_priv, port)) { if (_intel_dp_is_port_edp(dev_priv, intel_encoder->devdata, port)) {
/* /*
* Currently we don't support eDP on TypeC ports, although in * Currently we don't support eDP on TypeC ports, although in
* theory it could work on TypeC legacy ports. * theory it could work on TypeC legacy ports.
......
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