Commit 4c6d51ea authored by Tvrtko Ursulin's avatar Tvrtko Ursulin
Browse files

drm/i915: Make timelines gt centric



Our timelines are stored inside intel_gt so we can convert the interface
to take exactly that and not i915.

At the same time re-order the params to our more typical layout and
replace the backpointer to the new containing structure.

Signed-off-by: default avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
Reviewed-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Link: https://patchwork.freedesktop.org/patch/msgid/20190621070811.7006-31-tvrtko.ursulin@linux.intel.com
parent ba4134a4
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -530,7 +530,7 @@ i915_gem_create_context(struct drm_i915_private *dev_priv, unsigned int flags)
	if (flags & I915_CONTEXT_CREATE_FLAGS_SINGLE_TIMELINE) {
		struct i915_timeline *timeline;

		timeline = i915_timeline_create(dev_priv, NULL);
		timeline = i915_timeline_create(&dev_priv->gt, NULL);
		if (IS_ERR(timeline)) {
			context_close(ctx);
			return ERR_CAST(timeline);
+2 −2
Original line number Diff line number Diff line
@@ -740,8 +740,8 @@ static int measure_breadcrumb_dw(struct intel_engine_cs *engine)
	if (!frame)
		return -ENOMEM;

	if (i915_timeline_init(engine->i915,
			       &frame->timeline,
	if (i915_timeline_init(&frame->timeline,
			       engine->gt,
			       engine->status_page.vma))
		goto out_frame;

+4 −3
Original line number Diff line number Diff line
@@ -3005,12 +3005,13 @@ populate_lr_context(struct intel_context *ce,
	return ret;
}

static struct i915_timeline *get_timeline(struct i915_gem_context *ctx)
static struct i915_timeline *
get_timeline(struct i915_gem_context *ctx, struct intel_gt *gt)
{
	if (ctx->timeline)
		return i915_timeline_get(ctx->timeline);
	else
		return i915_timeline_create(ctx->i915, NULL);
		return i915_timeline_create(gt, NULL);
}

static int execlists_context_deferred_alloc(struct intel_context *ce,
@@ -3044,7 +3045,7 @@ static int execlists_context_deferred_alloc(struct intel_context *ce,
		goto error_deref_obj;
	}

	timeline = get_timeline(ce->gem_context);
	timeline = get_timeline(ce->gem_context, engine->gt);
	if (IS_ERR(timeline)) {
		ret = PTR_ERR(timeline);
		goto error_deref_obj;
+1 −1
Original line number Diff line number Diff line
@@ -2273,7 +2273,7 @@ int intel_ring_submission_init(struct intel_engine_cs *engine)
	struct intel_ring *ring;
	int err;

	timeline = i915_timeline_create(engine->i915, engine->status_page.vma);
	timeline = i915_timeline_create(engine->gt, engine->status_page.vma);
	if (IS_ERR(timeline)) {
		err = PTR_ERR(timeline);
		goto err;
+1 −1
Original line number Diff line number Diff line
@@ -56,7 +56,7 @@ static struct intel_ring *mock_ring(struct intel_engine_cs *engine)
	if (!ring)
		return NULL;

	if (i915_timeline_init(engine->i915, &ring->timeline, NULL)) {
	if (i915_timeline_init(&ring->timeline, engine->gt, NULL)) {
		kfree(ring);
		return NULL;
	}
Loading