diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2019-03-07 10:45:29 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2019-03-07 18:09:26 +0000 |
commit | 3d606249165870f28679eec1a3805ce291b0a273 (patch) | |
tree | 19955347e52bbd44e400c2e3c5697c5c39c285b7 /drivers/gpu/drm/i915 | |
parent | 37fbbd49054b624400a65cf1a39f152a7f3f4749 (diff) | |
download | linux-stable-3d606249165870f28679eec1a3805ce291b0a273.tar.gz linux-stable-3d606249165870f28679eec1a3805ce291b0a273.tar.bz2 linux-stable-3d606249165870f28679eec1a3805ce291b0a273.zip |
drm/i915: Make I915_GEM_IDLE_TIMEOUT into a macro
Currently we use HZ/5 for detecting a dead gpu on startup, and we will
wish to reuse this value for detecting a dead gpu on suspend, so convert
it into a macro for later convenience.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190307104530.21745-1-chris@chris-wilson.co.uk
Diffstat (limited to 'drivers/gpu/drm/i915')
-rw-r--r-- | drivers/gpu/drm/i915/i915_gem.c | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/i915_gem.h | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index 0b23cf3be718..eb90f73de06a 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c @@ -4684,7 +4684,9 @@ static int __intel_engines_record_defaults(struct drm_i915_private *i915) if (err) goto err_active; - if (i915_gem_wait_for_idle(i915, I915_WAIT_LOCKED, HZ / 5)) { + if (i915_gem_wait_for_idle(i915, + I915_WAIT_LOCKED, + I915_GEM_IDLE_TIMEOUT)) { i915_gem_set_wedged(i915); err = -EIO; /* Caller will declare us wedged */ goto err_active; diff --git a/drivers/gpu/drm/i915/i915_gem.h b/drivers/gpu/drm/i915/i915_gem.h index b0e4b976880c..74a2ddc1b52f 100644 --- a/drivers/gpu/drm/i915/i915_gem.h +++ b/drivers/gpu/drm/i915/i915_gem.h @@ -75,6 +75,8 @@ struct drm_i915_private; #define I915_NUM_ENGINES 8 +#define I915_GEM_IDLE_TIMEOUT (HZ / 5) + void i915_gem_park(struct drm_i915_private *i915); void i915_gem_unpark(struct drm_i915_private *i915); |