From: Chris Wilson Date: Tue, 25 Nov 2014 11:56:33 +0000 (+0000) Subject: drm/i915: Assert that we successfully downclock the GPU before suspend X-Git-Tag: firefly_0821_release~176^2~2312^2~43^2~115 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=bdcf120bfcb7e3b9356e96cdd7a6ac3c28062ffc;p=firefly-linux-kernel-4.4.55.git drm/i915: Assert that we successfully downclock the GPU before suspend Before suspending, we wait upon the outstanding GPU requests and flush our pending idle handlers. This should downclock the GPU to its lowest power state. Add a WARN to check that the delayed tasks were run and did their job properly. Suggested-by: Akash Goel Signed-off-by: Chris Wilson Signed-off-by: Daniel Vetter --- diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index c630d4986376..fa3f907ce229 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c @@ -4581,6 +4581,11 @@ i915_gem_suspend(struct drm_device *dev) cancel_delayed_work_sync(&dev_priv->mm.retire_work); flush_delayed_work(&dev_priv->mm.idle_work); + /* Assert that we sucessfully flushed all the work and + * reset the GPU back to its idle, low power state. + */ + WARN_ON(dev_priv->mm.busy); + return 0; err: