-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
drm/i915: Move the priotree struct to its own headers
Over time the priotree has grown from a sorted list to a more complicated structure for propagating constraints along the dependency chain to try and resolve priority inversion. Start to segregate this information from the rest of the request/fence tracking. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20180418184052.7129-1-chris@chris-wilson.co.uk
- Loading branch information
Chris Wilson
committed
Apr 18, 2018
1 parent
8221229
commit 98ff5c7
Showing
2 changed files
with
58 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
/* | ||
* SPDX-License-Identifier: MIT | ||
* | ||
* Copyright © 2018 Intel Corporation | ||
*/ | ||
|
||
#ifndef _I915_SCHEDULER_H_ | ||
#define _I915_SCHEDULER_H_ | ||
|
||
#include <linux/bitops.h> | ||
|
||
#include <uapi/drm/i915_drm.h> | ||
|
||
enum { | ||
I915_PRIORITY_MIN = I915_CONTEXT_MIN_USER_PRIORITY - 1, | ||
I915_PRIORITY_NORMAL = I915_CONTEXT_DEFAULT_PRIORITY, | ||
I915_PRIORITY_MAX = I915_CONTEXT_MAX_USER_PRIORITY + 1, | ||
|
||
I915_PRIORITY_INVALID = INT_MIN | ||
}; | ||
|
||
/* | ||
* "People assume that time is a strict progression of cause to effect, but | ||
* actually, from a nonlinear, non-subjective viewpoint, it's more like a big | ||
* ball of wibbly-wobbly, timey-wimey ... stuff." -The Doctor, 2015 | ||
* | ||
* Requests exist in a complex web of interdependencies. Each request | ||
* has to wait for some other request to complete before it is ready to be run | ||
* (e.g. we have to wait until the pixels have been rendering into a texture | ||
* before we can copy from it). We track the readiness of a request in terms | ||
* of fences, but we also need to keep the dependency tree for the lifetime | ||
* of the request (beyond the life of an individual fence). We use the tree | ||
* at various points to reorder the requests whilst keeping the requests | ||
* in order with respect to their various dependencies. | ||
* | ||
* There is no active component to the "scheduler". As we know the dependency | ||
* DAG of each request, we are able to insert it into a sorted queue when it | ||
* is ready, and are able to reorder its portion of the graph to accommodate | ||
* dynamic priority changes. | ||
*/ | ||
struct i915_priotree { | ||
struct list_head signalers_list; /* those before us, we depend upon */ | ||
struct list_head waiters_list; /* those after us, they depend upon us */ | ||
struct list_head link; | ||
int priority; | ||
}; | ||
|
||
struct i915_dependency { | ||
struct i915_priotree *signaler; | ||
struct list_head signal_link; | ||
struct list_head wait_link; | ||
struct list_head dfs_link; | ||
unsigned long flags; | ||
#define I915_DEPENDENCY_ALLOC BIT(0) | ||
}; | ||
|
||
#endif /* _I915_SCHEDULER_H_ */ |