From 25f683dadbed1b0f41dd0aa3a71f196f77a337e2 Mon Sep 17 00:00:00 2001 From: Daniel Vetter Date: Tue, 2 Jul 2013 11:32:41 +0200 Subject: [PATCH] drm/i915: run the full gem hw init after a gpu reset Otherwise we can't resurrect the bsd ring on gm45 completely. I've discovered this trick because module reload recovered the bsd ring, making it clear that it's not an issue with the hw or our reset code. While touching the code update the comment to be a bit clearer about what we actually want to reinitialize and which pieces we better leave untouched. Note: In my opinion this is not a stable candidate - historically such seemingly correct looking changes in the reset code have lead to big heaps of scary hilarity. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=65495 Signed-off-by: Daniel Vetter --- drivers/gpu/drm/i915/i915_drv.c | 25 ++++++------------------- 1 file changed, 6 insertions(+), 19 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c index 0689a46..45e5884 100644 --- a/drivers/gpu/drm/i915/i915_drv.c +++ b/drivers/gpu/drm/i915/i915_drv.c @@ -957,28 +957,15 @@ int i915_reset(struct drm_device *dev) */ if (drm_core_check_feature(dev, DRIVER_MODESET) || !dev_priv->mm.suspended) { - struct intel_ring_buffer *ring; - int i; - - dev_priv->mm.suspended = 0; - - i915_gem_init_swizzling(dev); - - for_each_ring(ring, dev_priv, i) - ring->init(ring); - - i915_gem_context_init(dev); - if (dev_priv->mm.aliasing_ppgtt) { - ret = dev_priv->mm.aliasing_ppgtt->enable(dev); - if (ret) - i915_gem_cleanup_aliasing_ppgtt(dev); - } + int ret; /* - * It would make sense to re-init all the other hw state, at - * least the rps/rc6/emon init done within modeset_init_hw. For - * some unknown reason, this blows up my ilk, so don't. + * We have to be carefuly to not reinit hw state which is not + * reset. E.g. reinitializing rps/rc6 on ilk here results in a + * dead machine. */ + ret = i915_gem_init_hw(dev); + WARN(ret != 0, "gem hw init failed after reset: %i\n", ret); mutex_unlock(&dev->struct_mutex); -- 1.8.3.1