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

drm/i915: Move the g45 PEG band gap HPD workaround to the HPD code

We are asked to reprogram PEG_BAND_GAP_DATA prior to enabling
hotplug detection on the g45 HDMI/DP ports. Currently we do said
reprogamming from the DP/HDMI connector initialization functions.
That code should be mostly platform agnostic so clearly not the
best place for this. Move the workaround to the place where we
actually enable HPD detection.
Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20231012124033.26983-1-ville.syrjala@linux.intel.comReviewed-by: default avatarJani Nikula <jani.nikula@intel.com>
parent 7880d41c
...@@ -6231,16 +6231,6 @@ intel_dp_init_connector(struct intel_digital_port *dig_port, ...@@ -6231,16 +6231,6 @@ intel_dp_init_connector(struct intel_digital_port *dig_port,
"HDCP init failed, skipping.\n"); "HDCP init failed, skipping.\n");
} }
/* For G4X desktop chip, PEG_BAND_GAP_DATA 3:0 must first be written
* 0xd. Failure to do so will result in spurious interrupts being
* generated on the port when a cable is not attached.
*/
if (IS_G45(dev_priv)) {
u32 temp = intel_de_read(dev_priv, PEG_BAND_GAP_DATA);
intel_de_write(dev_priv, PEG_BAND_GAP_DATA,
(temp & ~0xf) | 0xd);
}
intel_dp->frl.is_trained = false; intel_dp->frl.is_trained = false;
intel_dp->frl.trained_rate_gbps = 0; intel_dp->frl.trained_rate_gbps = 0;
......
...@@ -3030,16 +3030,6 @@ void intel_hdmi_init_connector(struct intel_digital_port *dig_port, ...@@ -3030,16 +3030,6 @@ void intel_hdmi_init_connector(struct intel_digital_port *dig_port,
"HDCP init failed, skipping.\n"); "HDCP init failed, skipping.\n");
} }
/* For G4X desktop chip, PEG_BAND_GAP_DATA 3:0 must first be written
* 0xd. Failure to do so will result in spurious interrupts being
* generated on the port when a cable is not attached.
*/
if (IS_G45(dev_priv)) {
u32 temp = intel_de_read(dev_priv, PEG_BAND_GAP_DATA);
intel_de_write(dev_priv, PEG_BAND_GAP_DATA,
(temp & ~0xf) | 0xd);
}
cec_fill_conn_info_from_drm(&conn_info, connector); cec_fill_conn_info_from_drm(&conn_info, connector);
intel_hdmi->cec_notifier = intel_hdmi->cec_notifier =
......
...@@ -1361,11 +1361,24 @@ static void bxt_hpd_irq_setup(struct drm_i915_private *dev_priv) ...@@ -1361,11 +1361,24 @@ static void bxt_hpd_irq_setup(struct drm_i915_private *dev_priv)
bxt_hpd_detection_setup(dev_priv); bxt_hpd_detection_setup(dev_priv);
} }
static void g45_hpd_peg_band_gap_wa(struct drm_i915_private *i915)
{
/*
* For G4X desktop chip, PEG_BAND_GAP_DATA 3:0 must first be written
* 0xd. Failure to do so will result in spurious interrupts being
* generated on the port when a cable is not attached.
*/
intel_de_rmw(i915, PEG_BAND_GAP_DATA, 0xf, 0xd);
}
static void i915_hpd_enable_detection(struct intel_encoder *encoder) static void i915_hpd_enable_detection(struct intel_encoder *encoder)
{ {
struct drm_i915_private *i915 = to_i915(encoder->base.dev); struct drm_i915_private *i915 = to_i915(encoder->base.dev);
u32 hotplug_en = hpd_mask_i915[encoder->hpd_pin]; u32 hotplug_en = hpd_mask_i915[encoder->hpd_pin];
if (IS_G45(i915))
g45_hpd_peg_band_gap_wa(i915);
/* HPD sense and interrupt enable are one and the same */ /* HPD sense and interrupt enable are one and the same */
i915_hotplug_interrupt_update(i915, hotplug_en, hotplug_en); i915_hotplug_interrupt_update(i915, hotplug_en, hotplug_en);
} }
...@@ -1389,6 +1402,9 @@ static void i915_hpd_irq_setup(struct drm_i915_private *dev_priv) ...@@ -1389,6 +1402,9 @@ static void i915_hpd_irq_setup(struct drm_i915_private *dev_priv)
hotplug_en |= CRT_HOTPLUG_ACTIVATION_PERIOD_64; hotplug_en |= CRT_HOTPLUG_ACTIVATION_PERIOD_64;
hotplug_en |= CRT_HOTPLUG_VOLTAGE_COMPARE_50; hotplug_en |= CRT_HOTPLUG_VOLTAGE_COMPARE_50;
if (IS_G45(dev_priv))
g45_hpd_peg_band_gap_wa(dev_priv);
/* Ignore TV since it's buggy */ /* Ignore TV since it's buggy */
i915_hotplug_interrupt_update_locked(dev_priv, i915_hotplug_interrupt_update_locked(dev_priv,
HOTPLUG_INT_EN_MASK | HOTPLUG_INT_EN_MASK |
......
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