Commit fa37d39e authored by Sean Paul's avatar Sean Paul Committed by Daniel Vetter

drm/i915: Retry reading the PCH FDI receiver ISR

According to the PRM (Vol3P2), the PCH FDI receiver ISR read for bit lock
should be retried at least once. This patch retries the read 5 times
with a small delay in between reads. I've had reports of display corruption
on resume with "FDI train 1 fail!", so I'm hoping that adding this retry
will mitigate the issue.
Signed-off-by: default avatarSean Paul <seanpaul@chromium.org>
Reviewed-by: default avatarJesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent b2dbf316
...@@ -2537,7 +2537,7 @@ static void gen6_fdi_link_train(struct drm_crtc *crtc) ...@@ -2537,7 +2537,7 @@ static void gen6_fdi_link_train(struct drm_crtc *crtc)
struct drm_i915_private *dev_priv = dev->dev_private; struct drm_i915_private *dev_priv = dev->dev_private;
struct intel_crtc *intel_crtc = to_intel_crtc(crtc); struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
int pipe = intel_crtc->pipe; int pipe = intel_crtc->pipe;
u32 reg, temp, i; u32 reg, temp, i, retry;
/* Train 1: umask FDI RX Interrupt symbol_lock and bit_lock bit /* Train 1: umask FDI RX Interrupt symbol_lock and bit_lock bit
for train result */ for train result */
...@@ -2589,15 +2589,19 @@ static void gen6_fdi_link_train(struct drm_crtc *crtc) ...@@ -2589,15 +2589,19 @@ static void gen6_fdi_link_train(struct drm_crtc *crtc)
POSTING_READ(reg); POSTING_READ(reg);
udelay(500); udelay(500);
reg = FDI_RX_IIR(pipe); for (retry = 0; retry < 5; retry++) {
temp = I915_READ(reg); reg = FDI_RX_IIR(pipe);
DRM_DEBUG_KMS("FDI_RX_IIR 0x%x\n", temp); temp = I915_READ(reg);
DRM_DEBUG_KMS("FDI_RX_IIR 0x%x\n", temp);
if (temp & FDI_RX_BIT_LOCK) { if (temp & FDI_RX_BIT_LOCK) {
I915_WRITE(reg, temp | FDI_RX_BIT_LOCK); I915_WRITE(reg, temp | FDI_RX_BIT_LOCK);
DRM_DEBUG_KMS("FDI train 1 done.\n"); DRM_DEBUG_KMS("FDI train 1 done.\n");
break; break;
}
udelay(50);
} }
if (retry < 5)
break;
} }
if (i == 4) if (i == 4)
DRM_ERROR("FDI train 1 fail!\n"); DRM_ERROR("FDI train 1 fail!\n");
...@@ -2638,15 +2642,19 @@ static void gen6_fdi_link_train(struct drm_crtc *crtc) ...@@ -2638,15 +2642,19 @@ static void gen6_fdi_link_train(struct drm_crtc *crtc)
POSTING_READ(reg); POSTING_READ(reg);
udelay(500); udelay(500);
reg = FDI_RX_IIR(pipe); for (retry = 0; retry < 5; retry++) {
temp = I915_READ(reg); reg = FDI_RX_IIR(pipe);
DRM_DEBUG_KMS("FDI_RX_IIR 0x%x\n", temp); temp = I915_READ(reg);
DRM_DEBUG_KMS("FDI_RX_IIR 0x%x\n", temp);
if (temp & FDI_RX_SYMBOL_LOCK) { if (temp & FDI_RX_SYMBOL_LOCK) {
I915_WRITE(reg, temp | FDI_RX_SYMBOL_LOCK); I915_WRITE(reg, temp | FDI_RX_SYMBOL_LOCK);
DRM_DEBUG_KMS("FDI train 2 done.\n"); DRM_DEBUG_KMS("FDI train 2 done.\n");
break; break;
}
udelay(50);
} }
if (retry < 5)
break;
} }
if (i == 4) if (i == 4)
DRM_ERROR("FDI train 2 fail!\n"); DRM_ERROR("FDI train 2 fail!\n");
......
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