drm/i915/gt: Call intel_gt_sanitize() directly
Assume all responsibility for operating on the HW to sanitize the GT state upon load/resume in intel_gt_sanitize() itself. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Andi Shyti <andi.shyti@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20191101141009.15581-1-chris@chris-wilson.co.uk
This commit is contained in:
@@ -1039,38 +1039,6 @@ out:
|
||||
return err;
|
||||
}
|
||||
|
||||
void i915_gem_sanitize(struct drm_i915_private *i915)
|
||||
{
|
||||
intel_wakeref_t wakeref;
|
||||
|
||||
GEM_TRACE("\n");
|
||||
|
||||
wakeref = intel_runtime_pm_get(&i915->runtime_pm);
|
||||
intel_uncore_forcewake_get(&i915->uncore, FORCEWAKE_ALL);
|
||||
|
||||
/*
|
||||
* As we have just resumed the machine and woken the device up from
|
||||
* deep PCI sleep (presumably D3_cold), assume the HW has been reset
|
||||
* back to defaults, recovering from whatever wedged state we left it
|
||||
* in and so worth trying to use the device once more.
|
||||
*/
|
||||
if (intel_gt_is_wedged(&i915->gt))
|
||||
intel_gt_unset_wedged(&i915->gt);
|
||||
|
||||
/*
|
||||
* If we inherit context state from the BIOS or earlier occupants
|
||||
* of the GPU, the GPU may be in an inconsistent state when we
|
||||
* try to take over. The only way to remove the earlier state
|
||||
* is by resetting. However, resetting on earlier gen is tricky as
|
||||
* it may impact the display and we are uncertain about the stability
|
||||
* of the reset, so this could be applied to even earlier gen.
|
||||
*/
|
||||
intel_gt_sanitize(&i915->gt, false);
|
||||
|
||||
intel_uncore_forcewake_put(&i915->uncore, FORCEWAKE_ALL);
|
||||
intel_runtime_pm_put(&i915->runtime_pm, wakeref);
|
||||
}
|
||||
|
||||
static int __intel_engines_record_defaults(struct intel_gt *gt)
|
||||
{
|
||||
struct i915_request *requests[I915_NUM_ENGINES] = {};
|
||||
@@ -1409,11 +1377,6 @@ void i915_gem_driver_release(struct drm_i915_private *dev_priv)
|
||||
WARN_ON(!list_empty(&dev_priv->gem.contexts.list));
|
||||
}
|
||||
|
||||
void i915_gem_init_mmio(struct drm_i915_private *i915)
|
||||
{
|
||||
i915_gem_sanitize(i915);
|
||||
}
|
||||
|
||||
static void i915_gem_init__mm(struct drm_i915_private *i915)
|
||||
{
|
||||
spin_lock_init(&i915->mm.obj_lock);
|
||||
|
Reference in New Issue
Block a user