From 7bfbba16a766b689b8d9751c4f91ad0f3278842f Mon Sep 17 00:00:00 2001 From: Daniel Vetter Date: Fri, 5 Jul 2013 00:01:55 +0200 Subject: [PATCH] drm/i915: improve assert_pipe when QUIRK_PIPEA is set We may only check that the pipe A is on if we try to enable pipe B. Otherwise the assert will misfire at resume where both pipes are disabled and we're trying to enable pipe A. The various checks to make sure the pipe is still of are then quirked to on and misfire. So quirk the quirk quirk around the time where we try to force-enable Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=66462 Signed-off-by: Daniel Vetter --- drivers/gpu/drm/i915/i915_drv.h | 1 + drivers/gpu/drm/i915/intel_display.c | 18 +++++++++++++----- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index dc7475d..39a5a0e 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h @@ -1120,6 +1120,7 @@ typedef struct drm_i915_private { unsigned short pch_id; unsigned long quirks; + bool pipe_A_quirk_check_disable; enum modeset_restore modeset_restore; struct mutex modeset_restore_lock; diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index a45bb92..8776312 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c @@ -1061,9 +1061,16 @@ void assert_pipe(struct drm_i915_private *dev_priv, enum transcoder cpu_transcoder = intel_pipe_to_cpu_transcoder(dev_priv, pipe); - /* if we need the pipe A quirk it must be always on */ - if (pipe == PIPE_A && dev_priv->quirks & QUIRK_PIPEA_FORCE) - state = true; + /* When the pipe A quirk is set pipe A must be on when using pipe B. */ + if (pipe == PIPE_B && dev_priv->quirks & QUIRK_PIPEA_FORCE) + assert_pipe(dev_priv, PIPE_A, true); + + if (pipe == PIPE_A && dev_priv->quirks & QUIRK_PIPEA_FORCE) { + if (dev_priv->pipe_A_quirk_check_disable) + return; + else + state = true; + } if (!intel_display_power_enabled(dev_priv->dev, POWER_DOMAIN_TRANSCODER(cpu_transcoder))) { @@ -9729,6 +9736,7 @@ intel_connector_break_all_links(struct intel_connector *connector) static void intel_enable_pipe_a(struct drm_device *dev) { + struct drm_i915_private *dev_priv = dev->dev_private; struct intel_connector *connector; struct drm_connector *crt = NULL; struct intel_load_detect_pipe load_detect_temp; @@ -9748,10 +9756,10 @@ static void intel_enable_pipe_a(struct drm_device *dev) if (!crt) return; + dev_priv->pipe_A_quirk_check_disable = true; if (intel_get_load_detect_pipe(crt, NULL, &load_detect_temp)) intel_release_load_detect_pipe(crt, &load_detect_temp); - - + dev_priv->pipe_A_quirk_check_disable = false; } static bool -- 1.7.10.4