aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorVille Syrjälä <ville.syrjala@linux.intel.com>2013-01-29 11:13:34 -0500
committerDaniel Vetter <daniel.vetter@ffwll.ch>2013-02-19 18:21:42 -0500
commit10d8373064762b21e16e73bc7dfde49d68f4e31f (patch)
tree3644f3474ae6a3afcbefd4b5c414fe34d0777135 /drivers
parent3d56e2d62b333aab434cba5a40e2353cac61154f (diff)
drm/i915: Don't wait for page flips if there was GPU reset
If a GPU reset occurs while a page flip has been submitted to the ring, the flip will never complete once the ring has been reset. The GPU reset can be detected by sampling the reset_counter before the flip is submitted, and then while waiting for the flip, the sampled counter is compared with the current reset_counter value. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Damien Lespiau <damien.lespiau@intel.com> [danvet: Move the reset_counter assignment to an earlier place in common code as discussed on the mailing list.] Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=60140 Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/drm/i915/intel_display.c5
-rw-r--r--drivers/gpu/drm/i915/intel_drv.h3
2 files changed, 7 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 6dfb49c25ea8..593c66801d56 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -2868,10 +2868,12 @@ static bool intel_crtc_has_pending_flip(struct drm_crtc *crtc)
2868{ 2868{
2869 struct drm_device *dev = crtc->dev; 2869 struct drm_device *dev = crtc->dev;
2870 struct drm_i915_private *dev_priv = dev->dev_private; 2870 struct drm_i915_private *dev_priv = dev->dev_private;
2871 struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
2871 unsigned long flags; 2872 unsigned long flags;
2872 bool pending; 2873 bool pending;
2873 2874
2874 if (i915_reset_in_progress(&dev_priv->gpu_error)) 2875 if (i915_reset_in_progress(&dev_priv->gpu_error) ||
2876 intel_crtc->reset_counter != atomic_read(&dev_priv->gpu_error.reset_counter))
2875 return false; 2877 return false;
2876 2878
2877 spin_lock_irqsave(&dev->event_lock, flags); 2879 spin_lock_irqsave(&dev->event_lock, flags);
@@ -7250,6 +7252,7 @@ static int intel_crtc_page_flip(struct drm_crtc *crtc,
7250 work->enable_stall_check = true; 7252 work->enable_stall_check = true;
7251 7253
7252 atomic_inc(&intel_crtc->unpin_work_count); 7254 atomic_inc(&intel_crtc->unpin_work_count);
7255 intel_crtc->reset_counter = atomic_read(&dev_priv->gpu_error.reset_counter);
7253 7256
7254 ret = dev_priv->display.queue_flip(dev, crtc, fb, obj); 7257 ret = dev_priv->display.queue_flip(dev, crtc, fb, obj);
7255 if (ret) 7258 if (ret)
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
index 13afb37d8dec..006b5aa35bb3 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -235,6 +235,9 @@ struct intel_crtc {
235 /* We can share PLLs across outputs if the timings match */ 235 /* We can share PLLs across outputs if the timings match */
236 struct intel_pch_pll *pch_pll; 236 struct intel_pch_pll *pch_pll;
237 uint32_t ddi_pll_sel; 237 uint32_t ddi_pll_sel;
238
239 /* reset counter value when the last flip was submitted */
240 unsigned int reset_counter;
238}; 241};
239 242
240struct intel_plane { 243struct intel_plane {