Commit 9151c85c authored by Ville Syrjälä's avatar Ville Syrjälä

drm/i915: Replace intel_bios_is_port_hpd_inverted() with intel_bios_encoder_hpd_invert()

intel_bios_is_port_hpd_inverted() is only used on bxt/glk on
which we always have encoder->devdata available. So consult
that instead of digging around in vbt.ports[].

And rename the function to match the common pattern.
Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230208015508.24824-6-ville.syrjala@linux.intel.comReviewed-by: default avatarJani Nikula <jani.nikula@intel.com>
parent 5f42196d
...@@ -3574,26 +3574,6 @@ bool intel_bios_get_dsc_params(struct intel_encoder *encoder, ...@@ -3574,26 +3574,6 @@ bool intel_bios_get_dsc_params(struct intel_encoder *encoder,
return false; return false;
} }
/**
* intel_bios_is_port_hpd_inverted - is HPD inverted for %port
* @i915: i915 device instance
* @port: port to check
*
* Return true if HPD should be inverted for %port.
*/
bool
intel_bios_is_port_hpd_inverted(const struct drm_i915_private *i915,
enum port port)
{
const struct intel_bios_encoder_data *devdata = i915->display.vbt.ports[port];
if (drm_WARN_ON_ONCE(&i915->drm,
!IS_GEMINILAKE(i915) && !IS_BROXTON(i915)))
return false;
return devdata && devdata->child.hpd_invert;
}
enum aux_ch intel_bios_port_aux_ch(struct drm_i915_private *i915, enum aux_ch intel_bios_port_aux_ch(struct drm_i915_private *i915,
enum port port) enum port port)
{ {
...@@ -3763,6 +3743,11 @@ bool intel_bios_encoder_lane_reversal(const struct intel_bios_encoder_data *devd ...@@ -3763,6 +3743,11 @@ bool intel_bios_encoder_lane_reversal(const struct intel_bios_encoder_data *devd
return devdata && devdata->child.lane_reversal; return devdata && devdata->child.lane_reversal;
} }
bool intel_bios_encoder_hpd_invert(const struct intel_bios_encoder_data *devdata)
{
return devdata && devdata->child.hpd_invert;
}
const struct intel_bios_encoder_data * const struct intel_bios_encoder_data *
intel_bios_encoder_data_lookup(struct drm_i915_private *i915, enum port port) intel_bios_encoder_data_lookup(struct drm_i915_private *i915, enum port port)
{ {
......
...@@ -248,8 +248,6 @@ bool intel_bios_is_port_present(struct drm_i915_private *dev_priv, enum port por ...@@ -248,8 +248,6 @@ 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_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_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); bool intel_bios_is_dsi_present(struct drm_i915_private *dev_priv, enum port *port);
bool intel_bios_is_port_hpd_inverted(const struct drm_i915_private *i915,
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 *dev_priv, enum port port);
bool intel_bios_get_dsc_params(struct intel_encoder *encoder, bool intel_bios_get_dsc_params(struct intel_encoder *encoder,
struct intel_crtc_state *crtc_state, struct intel_crtc_state *crtc_state,
...@@ -274,5 +272,6 @@ bool intel_bios_encoder_is_lspcon(const struct intel_bios_encoder_data *devdata) ...@@ -274,5 +272,6 @@ bool intel_bios_encoder_is_lspcon(const struct intel_bios_encoder_data *devdata)
int intel_bios_encoder_dp_boost_level(const struct intel_bios_encoder_data *devdata); int intel_bios_encoder_dp_boost_level(const struct intel_bios_encoder_data *devdata);
int intel_bios_encoder_hdmi_boost_level(const struct intel_bios_encoder_data *devdata); int intel_bios_encoder_hdmi_boost_level(const struct intel_bios_encoder_data *devdata);
bool intel_bios_encoder_lane_reversal(const struct intel_bios_encoder_data *devdata); bool intel_bios_encoder_lane_reversal(const struct intel_bios_encoder_data *devdata);
bool intel_bios_encoder_hpd_invert(const struct intel_bios_encoder_data *devdata);
#endif /* _INTEL_BIOS_H_ */ #endif /* _INTEL_BIOS_H_ */
...@@ -3131,23 +3131,22 @@ static void ilk_hpd_irq_setup(struct drm_i915_private *dev_priv) ...@@ -3131,23 +3131,22 @@ static void ilk_hpd_irq_setup(struct drm_i915_private *dev_priv)
static u32 bxt_hotplug_enables(struct intel_encoder *encoder) static u32 bxt_hotplug_enables(struct intel_encoder *encoder)
{ {
struct drm_i915_private *i915 = to_i915(encoder->base.dev);
u32 hotplug; u32 hotplug;
switch (encoder->hpd_pin) { switch (encoder->hpd_pin) {
case HPD_PORT_A: case HPD_PORT_A:
hotplug = PORTA_HOTPLUG_ENABLE; hotplug = PORTA_HOTPLUG_ENABLE;
if (intel_bios_is_port_hpd_inverted(i915, PORT_A)) if (intel_bios_encoder_hpd_invert(encoder->devdata))
hotplug |= BXT_DDIA_HPD_INVERT; hotplug |= BXT_DDIA_HPD_INVERT;
return hotplug; return hotplug;
case HPD_PORT_B: case HPD_PORT_B:
hotplug = PORTB_HOTPLUG_ENABLE; hotplug = PORTB_HOTPLUG_ENABLE;
if (intel_bios_is_port_hpd_inverted(i915, PORT_B)) if (intel_bios_encoder_hpd_invert(encoder->devdata))
hotplug |= BXT_DDIB_HPD_INVERT; hotplug |= BXT_DDIB_HPD_INVERT;
return hotplug; return hotplug;
case HPD_PORT_C: case HPD_PORT_C:
hotplug = PORTC_HOTPLUG_ENABLE; hotplug = PORTC_HOTPLUG_ENABLE;
if (intel_bios_is_port_hpd_inverted(i915, PORT_C)) if (intel_bios_encoder_hpd_invert(encoder->devdata))
hotplug |= BXT_DDIC_HPD_INVERT; hotplug |= BXT_DDIC_HPD_INVERT;
return hotplug; return hotplug;
default: default:
......
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