summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/i915/gt/intel_timeline.h
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2021-01-08 23:40:24 +0300
committerChris Wilson <chris@chris-wilson.co.uk>2021-01-09 00:35:56 +0300
commitb1ad5f6d68cbca9366a1dbe9f5d3002db94b0c85 (patch)
tree4d5b8debfb0dffcdee57e764ee114cb56479f7d8 /drivers/gpu/drm/i915/gt/intel_timeline.h
parent2b2985a417c7ca1752a4f0b2631cf916dabd43b5 (diff)
downloadlinux-b1ad5f6d68cbca9366a1dbe9f5d3002db94b0c85.tar.xz
drm/i915/gt: Only retire on the last breadcrumb if the last request
We use the completion of the last active breadcrumb to retire the requests along a timeline. This is purely opportunistic as nothing guarantees that any particular timeline is terminated by a breadcrumb; except for parking the engine where we explicitly add a breadcrumb so that we park quickly and do an explicit retire upon signaling to reduce the latency dramatically (avoiding a retire worker roundtrip). With scheduling, we anticipate retiring completed timelines as a matter of course. Performing the same action from inside the breadcrumbs is intended to provide similar functionality for legacy ringbuffer submission. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Andi Shyti <andi.shyti@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20210108204026.20682-5-chris@chris-wilson.co.uk
Diffstat (limited to 'drivers/gpu/drm/i915/gt/intel_timeline.h')
-rw-r--r--drivers/gpu/drm/i915/gt/intel_timeline.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/gt/intel_timeline.h b/drivers/gpu/drm/i915/gt/intel_timeline.h
index f502a619843f..dcdee692a80e 100644
--- a/drivers/gpu/drm/i915/gt/intel_timeline.h
+++ b/drivers/gpu/drm/i915/gt/intel_timeline.h
@@ -110,4 +110,11 @@ void intel_gt_show_timelines(struct intel_gt *gt,
const char *prefix,
int indent));
+static inline bool
+intel_timeline_is_last(const struct intel_timeline *tl,
+ const struct i915_request *rq)
+{
+ return list_is_last_rcu(&rq->link, &tl->requests);
+}
+
#endif