aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915
diff options
context:
space:
mode:
authorVille Syrjälä <ville.syrjala@linux.intel.com>2014-12-17 16:08:03 -0500
committerJani Nikula <jani.nikula@intel.com>2014-12-18 05:02:42 -0500
commit7d47559ee84b3ac206aa9e675606fafcd7c0b500 (patch)
tree9618257fc3fd2a31c525eb8a95c02505e7ebda8a /drivers/gpu/drm/i915
parent7f1241ed1a06b4846ad7a2a57eb088b757e58e16 (diff)
drm/i915: Don't call intel_prepare_page_flip() multiple times on gen2-4
The flip stall detector kicks in when pending>=INTEL_FLIP_COMPLETE. That means if we first call intel_prepare_page_flip() but don't call intel_finish_page_flip(), the next stall check will erroneosly think the page flip was somehow stuck. With enough debug spew emitted from the interrupt handler my 830 hangs when this happens. My theory is that the previous vblank interrupt gets sufficiently delayed that the handler will see the pending bit set in IIR, but ISR still has the bit set as well (ie. the flip was processed by CS but didn't complete yet). In this case the handler will proceed to call intel_check_page_flip() immediately after intel_prepare_page_flip(). It then tries to print a backtrace for the stuck flip WARN, which apparetly results in way too much debug spew delaying interrupt processing further. That then seems to cause an endless loop in the interrupt handler, and the machine is dead until the watchdog kicks in and reboots. At least limiting the number of iterations of the loop in the interrupt handler also prevented the hang. So it seems better to not call intel_prepare_page_flip() without immediately calling intel_finish_page_flip(). The IIR/ISR trickery avoids races here so this is a perfectly safe thing to do. v2: Fix typo in commit message (checkpatch) Cc: stable@vger.kernel.org Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=88381 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=85888 Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Diffstat (limited to 'drivers/gpu/drm/i915')
-rw-r--r--drivers/gpu/drm/i915/i915_irq.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
index 996c2931c499..d0d3dfbe6d2a 100644
--- a/drivers/gpu/drm/i915/i915_irq.c
+++ b/drivers/gpu/drm/i915/i915_irq.c
@@ -3725,8 +3725,6 @@ static bool i8xx_handle_vblank(struct drm_device *dev,
3725 if ((iir & flip_pending) == 0) 3725 if ((iir & flip_pending) == 0)
3726 goto check_page_flip; 3726 goto check_page_flip;
3727 3727
3728 intel_prepare_page_flip(dev, plane);
3729
3730 /* We detect FlipDone by looking for the change in PendingFlip from '1' 3728 /* We detect FlipDone by looking for the change in PendingFlip from '1'
3731 * to '0' on the following vblank, i.e. IIR has the Pendingflip 3729 * to '0' on the following vblank, i.e. IIR has the Pendingflip
3732 * asserted following the MI_DISPLAY_FLIP, but ISR is deasserted, hence 3730 * asserted following the MI_DISPLAY_FLIP, but ISR is deasserted, hence
@@ -3736,6 +3734,7 @@ static bool i8xx_handle_vblank(struct drm_device *dev,
3736 if (I915_READ16(ISR) & flip_pending) 3734 if (I915_READ16(ISR) & flip_pending)
3737 goto check_page_flip; 3735 goto check_page_flip;
3738 3736
3737 intel_prepare_page_flip(dev, plane);
3739 intel_finish_page_flip(dev, pipe); 3738 intel_finish_page_flip(dev, pipe);
3740 return true; 3739 return true;
3741 3740
@@ -3907,8 +3906,6 @@ static bool i915_handle_vblank(struct drm_device *dev,
3907 if ((iir & flip_pending) == 0) 3906 if ((iir & flip_pending) == 0)
3908 goto check_page_flip; 3907 goto check_page_flip;
3909 3908
3910 intel_prepare_page_flip(dev, plane);
3911
3912 /* We detect FlipDone by looking for the change in PendingFlip from '1' 3909 /* We detect FlipDone by looking for the change in PendingFlip from '1'
3913 * to '0' on the following vblank, i.e. IIR has the Pendingflip 3910 * to '0' on the following vblank, i.e. IIR has the Pendingflip
3914 * asserted following the MI_DISPLAY_FLIP, but ISR is deasserted, hence 3911 * asserted following the MI_DISPLAY_FLIP, but ISR is deasserted, hence
@@ -3918,6 +3915,7 @@ static bool i915_handle_vblank(struct drm_device *dev,
3918 if (I915_READ(ISR) & flip_pending) 3915 if (I915_READ(ISR) & flip_pending)
3919 goto check_page_flip; 3916 goto check_page_flip;
3920 3917
3918 intel_prepare_page_flip(dev, plane);
3921 intel_finish_page_flip(dev, pipe); 3919 intel_finish_page_flip(dev, pipe);
3922 return true; 3920 return true;
3923 3921