Commit 274cbf20 authored by Chris Wilson's avatar Chris Wilson
Browse files

drm/i915: Push the i915_active.retire into a worker



As we need to use a mutex to serialise i915_active activation
(because we want to allow the callback to sleep), we need to push the
i915_active.retire into a worker callback in case we get need to retire
from an atomic context.

Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: default avatarMatthew Auld <matthew.auld@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20191004134015.13204-5-chris@chris-wilson.co.uk
parent 2850748e
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -206,6 +206,7 @@ static int frontbuffer_active(struct i915_active *ref)
	return 0;
}

__i915_active_call
static void frontbuffer_retire(struct i915_active *ref)
{
	struct intel_frontbuffer *front =
@@ -257,7 +258,8 @@ intel_frontbuffer_get(struct drm_i915_gem_object *obj)
	kref_init(&front->ref);
	atomic_set(&front->bits, 0);
	i915_active_init(i915, &front->write,
			 frontbuffer_active, frontbuffer_retire);
			 frontbuffer_active,
			 i915_active_may_sleep(frontbuffer_retire));

	spin_lock(&i915->fb_tracking.lock);
	if (obj->frontbuffer) {
+1 −0
Original line number Diff line number Diff line
@@ -848,6 +848,7 @@ struct context_barrier_task {
	void *data;
};

__i915_active_call
static void cb_retire(struct i915_active *base)
{
	struct context_barrier_task *cb = container_of(base, typeof(*cb), base);
+2 −0
Original line number Diff line number Diff line
@@ -138,6 +138,7 @@ static void __context_unpin_state(struct i915_vma *vma)
	__i915_vma_unpin(vma);
}

__i915_active_call
static void __intel_context_retire(struct i915_active *active)
{
	struct intel_context *ce = container_of(active, typeof(*ce), active);
@@ -150,6 +151,7 @@ static void __intel_context_retire(struct i915_active *active)

	intel_timeline_unpin(ce->timeline);
	intel_ring_unpin(ce->ring);

	intel_context_put(ce);
}

+1 −0
Original line number Diff line number Diff line
@@ -61,6 +61,7 @@ static int pool_active(struct i915_active *ref)
	return 0;
}

__i915_active_call
static void pool_retire(struct i915_active *ref)
{
	struct intel_engine_pool_node *node =
+1 −0
Original line number Diff line number Diff line
@@ -136,6 +136,7 @@ static void __idle_cacheline_free(struct intel_timeline_cacheline *cl)
	kfree(cl);
}

__i915_active_call
static void __cacheline_retire(struct i915_active *active)
{
	struct intel_timeline_cacheline *cl =
Loading