From add64e41874c21af687013cb8830dda7d127a30f Mon Sep 17 00:00:00 2001 From: Daniel Vetter Date: Mon, 21 Oct 2013 21:53:19 +0200 Subject: [PATCH] drm/i915: Sanitize the PPT fdi lane bifurcate state on ivb We expect this bit to be always set when possible, but some BIOSes are lazy and don't do this. The result is a pile of WARNs and unhappy fdi link training code ... v2: It's actually the inverse: The BIOS sets this bit when it's not strictly needed. This should be cleaned up in the global_modeset_resources callback, but we've failed to look at the active bit. Which means this won't fire (and so clean up BIOS state) when enabling pipe B or C for the first time. v3: Wrap lines. v4: Sanitize the state in the modeset state readout code instead of trying to play trick in the ->modeset_global_resources callback. The later is too fragile and has implications to how we handle state more generally. Note that we might want to call the ->modeset_global_resources callback in general to fix up global state to our liking. But that's not something for a regression fix. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=70507 Tested-by: Jan-Michael Brummer Cc: stable@vger.kernel.org Signed-off-by: Daniel Vetter --- drivers/gpu/drm/i915/intel_display.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 8c3bf8a89cb7..556639ad3003 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c @@ -10748,6 +10748,13 @@ static void intel_sanitize_crtc(struct intel_crtc *crtc) } } +static void intel_sanitize_global_modeset_resources(struct drm_device *dev) +{ + /* Update the pch pipe B/C bifurcate state to our liking. */ + if (IS_IVYBRIDGE(dev)) + ivb_modeset_global_resources(dev); +} + static void intel_sanitize_encoder(struct intel_encoder *encoder) { struct intel_connector *connector; @@ -10949,6 +10956,8 @@ void intel_modeset_setup_hw_state(struct drm_device *dev, pll->on = false; } + intel_sanitize_global_modeset_resources(dev); + if (IS_HASWELL(dev)) ilk_wm_get_hw_state(dev); -- 1.8.4.rc3