Commit f6407193 authored by Chris Wilson's avatar Chris Wilson

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: default avatarChris Wilson <chris@chris-wilson.co.uk>
Cc: Mika Kuoppala <mika.kuoppala@intel.com>
Reviewed-by: default avatarJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20160827075401.16470-1-chris@chris-wilson.co.uk
parent f7978a0c
...@@ -749,16 +749,18 @@ int i915_wait_request(struct drm_i915_gem_request *req, ...@@ -749,16 +749,18 @@ int i915_wait_request(struct drm_i915_gem_request *req,
return ret; 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; struct drm_i915_gem_request *request, *next;
list_for_each_entry_safe(request, next, &engine->request_list, link) { list_for_each_entry_safe(request, next, &engine->request_list, link) {
if (!i915_gem_request_completed(request)) if (!i915_gem_request_completed(request))
break; return false;
i915_gem_request_retire(request); i915_gem_request_retire(request);
} }
return true;
} }
void i915_gem_retire_requests(struct drm_i915_private *dev_priv) 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) ...@@ -772,11 +774,9 @@ void i915_gem_retire_requests(struct drm_i915_private *dev_priv)
GEM_BUG_ON(!dev_priv->gt.awake); GEM_BUG_ON(!dev_priv->gt.awake);
for_each_engine(engine, dev_priv) { for_each_engine_masked(engine, dev_priv, dev_priv->gt.active_engines)
engine_retire_requests(engine); if (engine_retire_requests(engine))
if (!intel_engine_is_active(engine))
dev_priv->gt.active_engines &= ~intel_engine_flag(engine); dev_priv->gt.active_engines &= ~intel_engine_flag(engine);
}
if (dev_priv->gt.active_engines == 0) if (dev_priv->gt.active_engines == 0)
queue_delayed_work(dev_priv->wq, queue_delayed_work(dev_priv->wq,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment