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: Ville Syrjälä <ville.syrjala@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20230208015508.24824-11-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula <jani.nikula@intel.com>
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
static bool
|
||||
bool
|
||||
intel_bios_encoder_supports_edp(const struct intel_bios_encoder_data *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)
|
||||
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)
|
||||
{
|
||||
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);
|
||||
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_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_tbt(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)
|
||||
return IRQ_HANDLED;
|
||||
}
|
||||
|
||||
/* check the VBT to see whether the eDP is on another port */
|
||||
bool intel_dp_is_port_edp(struct drm_i915_private *dev_priv, enum port port)
|
||||
static bool _intel_dp_is_port_edp(struct drm_i915_private *dev_priv,
|
||||
const struct intel_bios_encoder_data *devdata,
|
||||
enum port port)
|
||||
{
|
||||
/*
|
||||
* 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)
|
||||
if (DISPLAY_VER(dev_priv) < 9 && port == PORT_A)
|
||||
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
|
||||
@@ -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->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
|
||||
* theory it could work on TypeC legacy ports.
|
||||
|
||||
Reference in New Issue
Block a user