diff options
author | Jonathan Gray <jsg@cvs.openbsd.org> | 2019-09-16 15:14:55 +0000 |
---|---|---|
committer | Jonathan Gray <jsg@cvs.openbsd.org> | 2019-09-16 15:14:55 +0000 |
commit | d075a497dc69f0c0dbc777fa6c89b2bb987b26e7 (patch) | |
tree | 549d7937ede5b473025b90e54418cc096b08230e /sys/dev/pci/drm | |
parent | 5d90bf86b5a169d4eb403f63642907294a88b8f1 (diff) |
drm/i915: Restore sane defaults for KMS on GEM error load
From Chris Wilson
b185bde520d5feb8fc750107d4cda32262fd92bf in linux 4.19.y/4.19.73
7ed43df720c007d60bee6d81da07bcdc7e4a55ae in mainline linux
Diffstat (limited to 'sys/dev/pci/drm')
-rw-r--r-- | sys/dev/pci/drm/i915/i915_gem.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/sys/dev/pci/drm/i915/i915_gem.c b/sys/dev/pci/drm/i915/i915_gem.c index 98a0a1a6652..731a59b163e 100644 --- a/sys/dev/pci/drm/i915/i915_gem.c +++ b/sys/dev/pci/drm/i915/i915_gem.c @@ -6028,6 +6028,8 @@ err_uc_misc: i915_gem_cleanup_userptr(dev_priv); if (ret == -EIO) { + mutex_lock(&dev_priv->drm.struct_mutex); + /* * Allow engine initialisation to fail by marking the GPU as * wedged. But we only want to do this where the GPU is angry, @@ -6038,7 +6040,14 @@ err_uc_misc: "Failed to initialize GPU, declaring it wedged!\n"); i915_gem_set_wedged(dev_priv); } - ret = 0; + + /* Minimal basic recovery for KMS */ + ret = i915_ggtt_enable_hw(dev_priv); + i915_gem_restore_gtt_mappings(dev_priv); + i915_gem_restore_fences(dev_priv); + intel_init_clock_gating(dev_priv); + + mutex_unlock(&dev_priv->drm.struct_mutex); } i915_gem_drain_freed_objects(dev_priv); |