summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/i915/i915_timeline.h
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2019-02-05 16:00:05 +0300
committerChris Wilson <chris@chris-wilson.co.uk>2019-02-05 20:20:11 +0300
commit21950ee7cc8f13c5350bda0cae22cdb7ac7e3058 (patch)
tree83c07ae5da83aa7ef95c5f8821b5ab8cf2b7dd08 /drivers/gpu/drm/i915/i915_timeline.h
parent5f5c139d6900b3338963bddcd8a567dcad33cf92 (diff)
downloadlinux-21950ee7cc8f13c5350bda0cae22cdb7ac7e3058.tar.xz
drm/i915: Pull i915_gem_active into the i915_active family
Looking forward, we need to break the struct_mutex dependency on i915_gem_active. In the meantime, external use of i915_gem_active is quite beguiling, little do new users suspect that it implies a barrier as each request it tracks must be ordered wrt the previous one. As one of many, it can be used to track activity across multiple timelines, a shared fence, which fits our unordered request submission much better. We need to steer external users away from the singular, exclusive fence imposed by i915_gem_active to i915_active instead. As part of that process, we move i915_gem_active out of i915_request.c into i915_active.c to start separating the two concepts, and rename it to i915_active_request (both to tie it to the concept of tracking just one request, and to give it a longer, less appealing name). Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20190205130005.2807-5-chris@chris-wilson.co.uk
Diffstat (limited to 'drivers/gpu/drm/i915/i915_timeline.h')
-rw-r--r--drivers/gpu/drm/i915/i915_timeline.h14
1 files changed, 9 insertions, 5 deletions
diff --git a/drivers/gpu/drm/i915/i915_timeline.h b/drivers/gpu/drm/i915/i915_timeline.h
index d167e04073c5..7bec7d2e45bf 100644
--- a/drivers/gpu/drm/i915/i915_timeline.h
+++ b/drivers/gpu/drm/i915/i915_timeline.h
@@ -28,6 +28,7 @@
#include <linux/list.h>
#include <linux/kref.h>
+#include "i915_active.h"
#include "i915_request.h"
#include "i915_syncmap.h"
#include "i915_utils.h"
@@ -58,10 +59,10 @@ struct i915_timeline {
/* Contains an RCU guarded pointer to the last request. No reference is
* held to the request, users must carefully acquire a reference to
- * the request using i915_gem_active_get_request_rcu(), or hold the
+ * the request using i915_active_request_get_request_rcu(), or hold the
* struct_mutex.
*/
- struct i915_gem_active last_request;
+ struct i915_active_request last_request;
/**
* We track the most recent seqno that we wait on in every context so
@@ -82,7 +83,7 @@ struct i915_timeline {
* subsequent submissions to this timeline be executed only after the
* barrier has been completed.
*/
- struct i915_gem_active barrier;
+ struct i915_active_request barrier;
struct list_head link;
const char *name;
@@ -174,7 +175,10 @@ void i915_timelines_fini(struct drm_i915_private *i915);
* submissions on @timeline. Subsequent requests will not be submitted to GPU
* until the barrier has been completed.
*/
-int i915_timeline_set_barrier(struct i915_timeline *timeline,
- struct i915_request *rq);
+static inline int
+i915_timeline_set_barrier(struct i915_timeline *tl, struct i915_request *rq)
+{
+ return i915_active_request_set(&tl->barrier, rq);
+}
#endif