diff mbox series

drm/i915: Skip scanning for signalers if we are already inflight

Message ID 20190207185202.11968-1-chris@chris-wilson.co.uk (mailing list archive)
State New, archived
Headers show
Series drm/i915: Skip scanning for signalers if we are already inflight | expand

Commit Message

Chris Wilson Feb. 7, 2019, 6:52 p.m. UTC
When a request has its priority changed, we traverse the graph of all of
its signalers to raise their priorities to match (priority inheritance).
If the request has already started executing its payload, we know that
all of its signalers must have signaled and we do not need to process
our list of signalers.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/i915_scheduler.c | 9 +++++++++
 1 file changed, 9 insertions(+)

Comments

Tvrtko Ursulin Feb. 11, 2019, 11:16 a.m. UTC | #1
On 07/02/2019 18:52, Chris Wilson wrote:
> When a request has its priority changed, we traverse the graph of all of
> its signalers to raise their priorities to match (priority inheritance).
> If the request has already started executing its payload, we know that
> all of its signalers must have signaled and we do not need to process
> our list of signalers.
> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> ---
>   drivers/gpu/drm/i915/i915_scheduler.c | 9 +++++++++
>   1 file changed, 9 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/i915_scheduler.c b/drivers/gpu/drm/i915/i915_scheduler.c
> index d01683167c77..71ace2704d89 100644
> --- a/drivers/gpu/drm/i915/i915_scheduler.c
> +++ b/drivers/gpu/drm/i915/i915_scheduler.c
> @@ -18,6 +18,11 @@ node_to_request(const struct i915_sched_node *node)
>   	return container_of(node, const struct i915_request, sched);
>   }
>   
> +static inline bool node_started(const struct i915_sched_node *node)
> +{
> +	return i915_request_started(node_to_request(node));
> +}
> +
>   static inline bool node_signaled(const struct i915_sched_node *node)
>   {
>   	return i915_request_completed(node_to_request(node));
> @@ -294,6 +299,10 @@ static void __i915_schedule(struct i915_request *rq,
>   	list_for_each_entry(dep, &dfs, dfs_link) {
>   		struct i915_sched_node *node = dep->signaler;
>   
> +		/* If we are already flying, we know we have no signalers */
> +		if (node_started(node))
> +			continue;
> +
>   		/*
>   		 * Within an engine, there can be no cycle, but we may
>   		 * refer to the same dependency chain multiple times
> 

Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Regards,

Tvrtko
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/i915_scheduler.c b/drivers/gpu/drm/i915/i915_scheduler.c
index d01683167c77..71ace2704d89 100644
--- a/drivers/gpu/drm/i915/i915_scheduler.c
+++ b/drivers/gpu/drm/i915/i915_scheduler.c
@@ -18,6 +18,11 @@  node_to_request(const struct i915_sched_node *node)
 	return container_of(node, const struct i915_request, sched);
 }
 
+static inline bool node_started(const struct i915_sched_node *node)
+{
+	return i915_request_started(node_to_request(node));
+}
+
 static inline bool node_signaled(const struct i915_sched_node *node)
 {
 	return i915_request_completed(node_to_request(node));
@@ -294,6 +299,10 @@  static void __i915_schedule(struct i915_request *rq,
 	list_for_each_entry(dep, &dfs, dfs_link) {
 		struct i915_sched_node *node = dep->signaler;
 
+		/* If we are already flying, we know we have no signalers */
+		if (node_started(node))
+			continue;
+
 		/*
 		 * Within an engine, there can be no cycle, but we may
 		 * refer to the same dependency chain multiple times