aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Widawsky <ben@bwidawsk.net>2013-10-14 13:01:36 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2013-10-16 05:08:08 -0400
commit3d57e5bd1284f44e325f3a52d966259ed42f9e05 (patch)
tree93802f5c21e99345e418cba71386d52353bdffe9
parentec98c8d1ffdc87c54ec0896db45db5b7bd22eca9 (diff)
drm/i915: Do a fuller init after reset
I had this lying around from he original PPGTT series, and thought we might try to get it in by itself. It's convenient to just call i915_gem_init_hw at reset because we'll be adding new things to that function, and having just one function to call instead of reimplementing it in two places is nice. In order to accommodate we cleanup ringbuffers in order to bring them back up cleanly. Optionally, we could also teardown/re initialize the default context but this was causing some problems on reset which I wasn't able to fully debug, and is unnecessary with the previous context init/enable split. This essentially reverts: commit 8e88a2bd5987178d16d53686197404e149e996d9 Author: Daniel Vetter <daniel.vetter@ffwll.ch> Date: Tue Jun 19 18:40:00 2012 +0200 drm/i915: don't call modeset_init_hw in i915_reset It seems to work for me on ILK now. Perhaps it's due to: commit 8a5c2ae753c588bcb2a4e38d1c6a39865dbf1ff3 Author: Jesse Barnes <jbarnes@virtuousgeek.org> Date: Thu Mar 28 13:57:19 2013 -0700 drm/i915: fix ILK GPU reset for render Signed-off-by: Ben Widawsky <ben@bwidawsk.net> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
-rw-r--r--drivers/gpu/drm/i915/i915_drv.c29
-rw-r--r--drivers/gpu/drm/i915/i915_gem.c2
-rw-r--r--drivers/gpu/drm/i915/intel_ringbuffer.c4
3 files changed, 13 insertions, 22 deletions
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index 59649c060986..db84e242306d 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -744,30 +744,17 @@ int i915_reset(struct drm_device *dev)
744 */ 744 */
745 if (drm_core_check_feature(dev, DRIVER_MODESET) || 745 if (drm_core_check_feature(dev, DRIVER_MODESET) ||
746 !dev_priv->ums.mm_suspended) { 746 !dev_priv->ums.mm_suspended) {
747 struct intel_ring_buffer *ring; 747 bool hw_contexts_disabled = dev_priv->hw_contexts_disabled;
748 int i;
749
750 dev_priv->ums.mm_suspended = 0; 748 dev_priv->ums.mm_suspended = 0;
751 749
752 i915_gem_init_swizzling(dev); 750 ret = i915_gem_init_hw(dev);
753 751 if (!hw_contexts_disabled && dev_priv->hw_contexts_disabled)
754 for_each_ring(ring, dev_priv, i) 752 DRM_ERROR("HW contexts didn't survive reset\n");
755 ring->init(ring);
756
757 i915_gem_context_init(dev);
758 if (dev_priv->mm.aliasing_ppgtt) {
759 ret = dev_priv->mm.aliasing_ppgtt->enable(dev);
760 if (ret)
761 i915_gem_cleanup_aliasing_ppgtt(dev);
762 }
763
764 /*
765 * It would make sense to re-init all the other hw state, at
766 * least the rps/rc6/emon init done within modeset_init_hw. For
767 * some unknown reason, this blows up my ilk, so don't.
768 */
769
770 mutex_unlock(&dev->struct_mutex); 753 mutex_unlock(&dev->struct_mutex);
754 if (ret) {
755 DRM_ERROR("Failed hw init on reset %d\n", ret);
756 return ret;
757 }
771 758
772 drm_irq_uninstall(dev); 759 drm_irq_uninstall(dev);
773 drm_irq_install(dev); 760 drm_irq_install(dev);
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 71dd0305eb32..1d22c99601ed 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -2406,6 +2406,8 @@ void i915_gem_reset(struct drm_device *dev)
2406 for_each_ring(ring, dev_priv, i) 2406 for_each_ring(ring, dev_priv, i)
2407 i915_gem_reset_ring_lists(dev_priv, ring); 2407 i915_gem_reset_ring_lists(dev_priv, ring);
2408 2408
2409 i915_gem_cleanup_ringbuffer(dev);
2410
2409 i915_gem_restore_fences(dev); 2411 i915_gem_restore_fences(dev);
2410} 2412}
2411 2413
diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c
index 4e108fc3c340..2dec134f75eb 100644
--- a/drivers/gpu/drm/i915/intel_ringbuffer.c
+++ b/drivers/gpu/drm/i915/intel_ringbuffer.c
@@ -1324,7 +1324,7 @@ void intel_cleanup_ring_buffer(struct intel_ring_buffer *ring)
1324 /* Disable the ring buffer. The ring must be idle at this point */ 1324 /* Disable the ring buffer. The ring must be idle at this point */
1325 dev_priv = ring->dev->dev_private; 1325 dev_priv = ring->dev->dev_private;
1326 ret = intel_ring_idle(ring); 1326 ret = intel_ring_idle(ring);
1327 if (ret) 1327 if (ret && !i915_reset_in_progress(&dev_priv->gpu_error))
1328 DRM_ERROR("failed to quiesce %s whilst cleaning up: %d\n", 1328 DRM_ERROR("failed to quiesce %s whilst cleaning up: %d\n",
1329 ring->name, ret); 1329 ring->name, ret);
1330 1330
@@ -1335,6 +1335,8 @@ void intel_cleanup_ring_buffer(struct intel_ring_buffer *ring)
1335 i915_gem_object_unpin(ring->obj); 1335 i915_gem_object_unpin(ring->obj);
1336 drm_gem_object_unreference(&ring->obj->base); 1336 drm_gem_object_unreference(&ring->obj->base);
1337 ring->obj = NULL; 1337 ring->obj = NULL;
1338 ring->preallocated_lazy_request = NULL;
1339 ring->outstanding_lazy_seqno = 0;
1338 1340
1339 if (ring->cleanup) 1341 if (ring->cleanup)
1340 ring->cleanup(ring); 1342 ring->cleanup(ring);