summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/i915_gem_request.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2016-08-27 08:54:00 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2016-08-27 09:41:23 +0100
commitf6407193dd9d9e29fc94b7f6943c517cbee314bb (patch)
tree9f5949c06ffe4971e456bf36d35f67fb2955aadc /drivers/gpu/drm/i915/i915_gem_request.c
parentf7978a0c581a8a840a28306f8da43e06e7fef3bf (diff)
downloadblackbird-op-linux-f6407193dd9d9e29fc94b7f6943c517cbee314bb.tar.gz
blackbird-op-linux-f6407193dd9d9e29fc94b7f6943c517cbee314bb.zip
drm/i915: Tidy reporting busy status during i915_gem_retire_requests()
As we know by inspection whether any engine is still busy as we retire all the requests, we can pass that information back via return value rather than check again afterwards. v2: A little more polish missed in patch splitting Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Mika Kuoppala <mika.kuoppala@intel.com> Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> Link: http://patchwork.freedesktop.org/patch/msgid/20160827075401.16470-1-chris@chris-wilson.co.uk
Diffstat (limited to 'drivers/gpu/drm/i915/i915_gem_request.c')
-rw-r--r--drivers/gpu/drm/i915/i915_gem_request.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem_request.c b/drivers/gpu/drm/i915/i915_gem_request.c
index 1a215320cefb..5e55270bb2de 100644
--- a/drivers/gpu/drm/i915/i915_gem_request.c
+++ b/drivers/gpu/drm/i915/i915_gem_request.c
@@ -749,16 +749,18 @@ complete:
return ret;
}
-static void engine_retire_requests(struct intel_engine_cs *engine)
+static bool engine_retire_requests(struct intel_engine_cs *engine)
{
struct drm_i915_gem_request *request, *next;
list_for_each_entry_safe(request, next, &engine->request_list, link) {
if (!i915_gem_request_completed(request))
- break;
+ return false;
i915_gem_request_retire(request);
}
+
+ return true;
}
void i915_gem_retire_requests(struct drm_i915_private *dev_priv)
@@ -772,11 +774,9 @@ void i915_gem_retire_requests(struct drm_i915_private *dev_priv)
GEM_BUG_ON(!dev_priv->gt.awake);
- for_each_engine(engine, dev_priv) {
- engine_retire_requests(engine);
- if (!intel_engine_is_active(engine))
+ for_each_engine_masked(engine, dev_priv, dev_priv->gt.active_engines)
+ if (engine_retire_requests(engine))
dev_priv->gt.active_engines &= ~intel_engine_flag(engine);
- }
if (dev_priv->gt.active_engines == 0)
queue_delayed_work(dev_priv->wq,
OpenPOWER on IntegriCloud