drm/i915: Bump timeout for wait_for_engines()
authorChris Wilson <chris@chris-wilson.co.uk>
Mon, 11 Dec 2017 19:41:34 +0000 (19:41 +0000)
committerChris Wilson <chris@chris-wilson.co.uk>
Tue, 12 Dec 2017 21:07:41 +0000 (21:07 +0000)
Extract the timeout we use in i915_gem_idle_work_handler() and reuse it
for wait_for_engines() in i915_gem_wait_for_idle(). It too has the same
problem in sometimes having to wait for an extended period before the HW
settles, so make use of the same timeout.

References: 5427f207852d ("drm/i915: Bump wait-times for the final CS interrupt before parking")
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20171211194135.27095-1-chris@chris-wilson.co.uk
drivers/gpu/drm/i915/i915_drv.h
drivers/gpu/drm/i915/i915_gem.c

index 61196ff939011c4789bb4c86ff4fed8c566a7a4f..7762eabd31c1282771b9cc44b1d7cb83d330c77b 100644 (file)
@@ -1586,6 +1586,8 @@ struct drm_i915_error_state_buf {
        loff_t pos;
 };
 
+#define I915_IDLE_ENGINES_TIMEOUT (200) /* in ms */
+
 #define I915_RESET_TIMEOUT (10 * HZ) /* 10s */
 #define I915_FENCE_TIMEOUT (10 * HZ) /* 10s */
 
index e89496aec85703e9f947a4c80c5873fc16e3f65e..55e4475fabe01a4d24b5bc451089cbc31b636f31 100644 (file)
@@ -3333,7 +3333,7 @@ i915_gem_idle_work_handler(struct work_struct *work)
         * Wait for last execlists context complete, but bail out in case a
         * new request is submitted.
         */
-       end = ktime_add_ms(ktime_get(), 200);
+       end = ktime_add_ms(ktime_get(), I915_IDLE_ENGINES_TIMEOUT);
        do {
                if (new_requests_since_last_retire(dev_priv))
                        return;
@@ -3533,7 +3533,7 @@ static int wait_for_timeline(struct i915_gem_timeline *tl, unsigned int flags)
 
 static int wait_for_engines(struct drm_i915_private *i915)
 {
-       if (wait_for(intel_engines_are_idle(i915), 50)) {
+       if (wait_for(intel_engines_are_idle(i915), I915_IDLE_ENGINES_TIMEOUT)) {
                DRM_ERROR("Failed to idle engines, declaring wedged!\n");
                i915_gem_set_wedged(i915);
                return -EIO;