In preparation for removing the has_initial_breadcrumb field, add a helper function for the existing callers. Signed-off-by: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx> Reviewed-by: Mika Kuoppala <mika.kuoppala@xxxxxxxxxxxxxxx> --- drivers/gpu/drm/i915/gt/intel_lrc.c | 2 +- drivers/gpu/drm/i915/gt/intel_ring_submission.c | 4 ++-- drivers/gpu/drm/i915/gt/intel_timeline.c | 6 +++--- drivers/gpu/drm/i915/gt/intel_timeline.h | 6 ++++++ drivers/gpu/drm/i915/gt/selftest_timeline.c | 5 +++-- 5 files changed, 15 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/i915/gt/intel_lrc.c b/drivers/gpu/drm/i915/gt/intel_lrc.c index 0565ae738a20..9a9cc29c8ffd 100644 --- a/drivers/gpu/drm/i915/gt/intel_lrc.c +++ b/drivers/gpu/drm/i915/gt/intel_lrc.c @@ -3573,7 +3573,7 @@ static int gen8_emit_init_breadcrumb(struct i915_request *rq) u32 *cs; GEM_BUG_ON(i915_request_has_initial_breadcrumb(rq)); - if (!i915_request_timeline(rq)->has_initial_breadcrumb) + if (!intel_timeline_has_initial_breadcrumb(i915_request_timeline(rq))) return 0; cs = intel_ring_begin(rq, 6); diff --git a/drivers/gpu/drm/i915/gt/intel_ring_submission.c b/drivers/gpu/drm/i915/gt/intel_ring_submission.c index a41b43f445b8..4744eeedc95b 100644 --- a/drivers/gpu/drm/i915/gt/intel_ring_submission.c +++ b/drivers/gpu/drm/i915/gt/intel_ring_submission.c @@ -945,7 +945,7 @@ static int ring_request_alloc(struct i915_request *request) int ret; GEM_BUG_ON(!intel_context_is_pinned(request->context)); - GEM_BUG_ON(i915_request_timeline(request)->has_initial_breadcrumb); + GEM_BUG_ON(intel_timeline_has_initial_breadcrumb(i915_request_timeline(request))); /* * Flush enough space to reduce the likelihood of waiting after @@ -1268,7 +1268,7 @@ int intel_ring_submission_setup(struct intel_engine_cs *engine) err = PTR_ERR(timeline); goto err; } - GEM_BUG_ON(timeline->has_initial_breadcrumb); + GEM_BUG_ON(intel_timeline_has_initial_breadcrumb(timeline)); err = intel_timeline_pin(timeline, NULL); if (err) diff --git a/drivers/gpu/drm/i915/gt/intel_timeline.c b/drivers/gpu/drm/i915/gt/intel_timeline.c index 2b4ed4b2b67c..85937f41cf8d 100644 --- a/drivers/gpu/drm/i915/gt/intel_timeline.c +++ b/drivers/gpu/drm/i915/gt/intel_timeline.c @@ -428,14 +428,14 @@ void intel_timeline_exit(struct intel_timeline *tl) static u32 timeline_advance(struct intel_timeline *tl) { GEM_BUG_ON(!atomic_read(&tl->pin_count)); - GEM_BUG_ON(tl->seqno & tl->has_initial_breadcrumb); + GEM_BUG_ON(tl->seqno & intel_timeline_has_initial_breadcrumb(tl)); - return tl->seqno += 1 + tl->has_initial_breadcrumb; + return tl->seqno += 1 + intel_timeline_has_initial_breadcrumb(tl); } static void timeline_rollback(struct intel_timeline *tl) { - tl->seqno -= 1 + tl->has_initial_breadcrumb; + tl->seqno -= 1 + intel_timeline_has_initial_breadcrumb(tl); } static noinline int diff --git a/drivers/gpu/drm/i915/gt/intel_timeline.h b/drivers/gpu/drm/i915/gt/intel_timeline.h index 9b88f220be2b..9b7f30c147c5 100644 --- a/drivers/gpu/drm/i915/gt/intel_timeline.h +++ b/drivers/gpu/drm/i915/gt/intel_timeline.h @@ -66,6 +66,12 @@ static inline void intel_timeline_put(struct intel_timeline *timeline) kref_put(&timeline->kref, __intel_timeline_free); } +static inline bool +intel_timeline_has_initial_breadcrumb(const struct intel_timeline *tl) +{ + return tl->has_initial_breadcrumb; +} + static inline int __intel_timeline_sync_set(struct intel_timeline *tl, u64 context, u32 seqno) { diff --git a/drivers/gpu/drm/i915/gt/selftest_timeline.c b/drivers/gpu/drm/i915/gt/selftest_timeline.c index 2edf2b15885f..8d7551c3834f 100644 --- a/drivers/gpu/drm/i915/gt/selftest_timeline.c +++ b/drivers/gpu/drm/i915/gt/selftest_timeline.c @@ -665,7 +665,7 @@ static int live_hwsp_wrap(void *arg) if (IS_ERR(tl)) return PTR_ERR(tl); - if (!tl->has_initial_breadcrumb || !tl->hwsp_cacheline) + if (!intel_timeline_has_initial_breadcrumb(tl) || !tl->hwsp_cacheline) goto out_free; err = intel_timeline_pin(tl, NULL); @@ -1235,7 +1235,8 @@ static int live_hwsp_rollover_user(void *arg) goto out; tl = ce->timeline; - if (!tl->has_initial_breadcrumb || !tl->hwsp_cacheline) + if (!intel_timeline_has_initial_breadcrumb(tl) || + !tl->hwsp_cacheline) goto out; timeline_rollback(tl); -- 2.20.1 _______________________________________________ Intel-gfx mailing list Intel-gfx@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/intel-gfx