diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2014-09-05 02:13:25 -0400 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2014-09-05 03:31:24 -0400 |
commit | 9c787942907face82da505c2c5493998b56cfc5a (patch) | |
tree | 22333c30330a89e1d4470a492264fbed6682a028 /drivers/gpu/drm/i915 | |
parent | d6bbafa183793537d8dca4d4c2e448805e59448a (diff) |
drm/i915: Decouple the stuck pageflip on modeset
If we successfully confuse the hardware, and cause it to drop a queued
pageflip, we wait for 60s and issue a warning before continuing on with
the modeset. However, this leaves the pending pageflip still stuck
indefinitely. Pretend to userspace that it does complete, and let us
start afresh following the modeset.
v2: Rebase after refactor
v3: Rebase, rebase.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
References: https://bugs.freedesktop.org/show_bug.cgi?id=82612
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915')
-rw-r--r-- | drivers/gpu/drm/i915/intel_display.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 7988f1f22068..b912107a1392 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c | |||
@@ -3417,9 +3417,19 @@ void intel_crtc_wait_for_pending_flips(struct drm_crtc *crtc) | |||
3417 | struct drm_i915_private *dev_priv = dev->dev_private; | 3417 | struct drm_i915_private *dev_priv = dev->dev_private; |
3418 | 3418 | ||
3419 | WARN_ON(waitqueue_active(&dev_priv->pending_flip_queue)); | 3419 | WARN_ON(waitqueue_active(&dev_priv->pending_flip_queue)); |
3420 | WARN_ON(wait_event_timeout(dev_priv->pending_flip_queue, | 3420 | if (WARN_ON(wait_event_timeout(dev_priv->pending_flip_queue, |
3421 | !intel_crtc_has_pending_flip(crtc), | 3421 | !intel_crtc_has_pending_flip(crtc), |
3422 | 60*HZ) == 0); | 3422 | 60*HZ) == 0)) { |
3423 | struct intel_crtc *intel_crtc = to_intel_crtc(crtc); | ||
3424 | unsigned long flags; | ||
3425 | |||
3426 | spin_lock_irqsave(&dev->event_lock, flags); | ||
3427 | if (intel_crtc->unpin_work) { | ||
3428 | WARN_ONCE(1, "Removing stuck page flip\n"); | ||
3429 | page_flip_completed(intel_crtc); | ||
3430 | } | ||
3431 | spin_unlock_irqrestore(&dev->event_lock, flags); | ||
3432 | } | ||
3423 | 3433 | ||
3424 | if (crtc->primary->fb) { | 3434 | if (crtc->primary->fb) { |
3425 | mutex_lock(&dev->struct_mutex); | 3435 | mutex_lock(&dev->struct_mutex); |