aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/i915')
-rw-r--r--drivers/gpu/drm/i915/i915_gem.c25
1 files changed, 12 insertions, 13 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index f766d5f94d93..89dbb1bb43e2 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -4452,15 +4452,11 @@ i915_gem_init_hw(struct drm_device *dev)
4452 * the do_switch), but before enabling PPGTT. So don't move this. 4452 * the do_switch), but before enabling PPGTT. So don't move this.
4453 */ 4453 */
4454 ret = i915_gem_context_enable(dev_priv); 4454 ret = i915_gem_context_enable(dev_priv);
4455 if (ret) { 4455 if (ret && ret != -EIO) {
4456 DRM_ERROR("Context enable failed %d\n", ret); 4456 DRM_ERROR("Context enable failed %d\n", ret);
4457 goto err_out; 4457 i915_gem_cleanup_ringbuffer(dev);
4458 } 4458 }
4459 4459
4460 return 0;
4461
4462err_out:
4463 i915_gem_cleanup_ringbuffer(dev);
4464 return ret; 4460 return ret;
4465} 4461}
4466 4462
@@ -4487,18 +4483,21 @@ int i915_gem_init(struct drm_device *dev)
4487 } 4483 }
4488 4484
4489 ret = i915_gem_init_hw(dev); 4485 ret = i915_gem_init_hw(dev);
4490 mutex_unlock(&dev->struct_mutex); 4486 if (ret == -EIO) {
4491 if (ret) { 4487 /* Allow ring initialisation to fail by marking the GPU as
4492 WARN_ON(dev_priv->mm.aliasing_ppgtt); 4488 * wedged. But we only want to do this where the GPU is angry,
4493 i915_gem_context_fini(dev); 4489 * for all other failure, such as an allocation failure, bail.
4494 drm_mm_takedown(&dev_priv->gtt.base.mm); 4490 */
4495 return ret; 4491 DRM_ERROR("Failed to initialize GPU, declaring it wedged\n");
4492 atomic_set_mask(I915_WEDGED, &dev_priv->gpu_error.reset_counter);
4493 ret = 0;
4496 } 4494 }
4495 mutex_unlock(&dev->struct_mutex);
4497 4496
4498 /* Allow hardware batchbuffers unless told otherwise, but not for KMS. */ 4497 /* Allow hardware batchbuffers unless told otherwise, but not for KMS. */
4499 if (!drm_core_check_feature(dev, DRIVER_MODESET)) 4498 if (!drm_core_check_feature(dev, DRIVER_MODESET))
4500 dev_priv->dri1.allow_batchbuffer = 1; 4499 dev_priv->dri1.allow_batchbuffer = 1;
4501 return 0; 4500 return ret;
4502} 4501}
4503 4502
4504void 4503void