[PATCH 62/67] submit-engine

Chris Wilson chris at chris-wilson.co.uk
Sun Jan 31 21:37:05 UTC 2021


---
 .../gpu/drm/i915/gt/intel_execlists_submission.c  |  9 ++++-----
 drivers/gpu/drm/i915/gt/intel_reset.c             |  6 ++++--
 drivers/gpu/drm/i915/gt/intel_ring_scheduler.c    | 15 ++++++++-------
 drivers/gpu/drm/i915/gt/intel_ring_submission.c   |  6 ++++--
 drivers/gpu/drm/i915/gt/mock_engine.c             |  4 ++--
 drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c |  4 ++--
 drivers/gpu/drm/i915/i915_request.c               |  9 +++++----
 drivers/gpu/drm/i915/i915_request.h               |  6 ++++--
 8 files changed, 33 insertions(+), 26 deletions(-)

diff --git a/drivers/gpu/drm/i915/gt/intel_execlists_submission.c b/drivers/gpu/drm/i915/gt/intel_execlists_submission.c
index 16c63dd2b70d..a03ac987dfc5 100644
--- a/drivers/gpu/drm/i915/gt/intel_execlists_submission.c
+++ b/drivers/gpu/drm/i915/gt/intel_execlists_submission.c
@@ -1482,7 +1482,7 @@ static void execlists_dequeue(struct intel_engine_cs *engine)
 				merge = false;
 			}
 
-			if (__i915_request_submit(rq)) {
+			if (__i915_request_submit(rq, engine)) {
 				if (!merge) {
 					*port++ = i915_request_get(last);
 					last = NULL;
@@ -2719,7 +2719,7 @@ static void execlists_reset_cancel(struct intel_engine_cs *engine)
 	for_each_priolist(pl, &se->queue) {
 		priolist_for_each_request_safe(rq, rn, pl) {
 			if (i915_request_mark_eio(rq)) {
-				__i915_request_submit(rq);
+				__i915_request_submit(rq, engine);
 				i915_request_put(rq);
 			}
 		}
@@ -2743,8 +2743,7 @@ static void execlists_reset_cancel(struct intel_engine_cs *engine)
 		for_each_priolist(pl, &ve->base.sched.queue) {
 			priolist_for_each_request_safe(rq, rn, pl) {
 				if (i915_request_mark_eio(rq)) {
-					rq->engine = engine;
-					__i915_request_submit(rq);
+					__i915_request_submit(rq, engine);
 					i915_request_put(rq);
 				}
 			}
@@ -3083,7 +3082,7 @@ static void rcu_virtual_context_destroy(struct work_struct *wrk)
 		spin_lock_irq(&se->lock);
 		for_each_priolist(pl, &se->queue) {
 			priolist_for_each_request_safe(rq, rn, pl)
-				__i915_request_submit(rq);
+				__i915_request_submit(rq, &ve->base);
 			i915_priolist_advance(&se->queue, pl);
 		}
 		spin_unlock_irq(&se->lock);
diff --git a/drivers/gpu/drm/i915/gt/intel_reset.c b/drivers/gpu/drm/i915/gt/intel_reset.c
index e5cb92c7d0f8..3ba0e271832a 100644
--- a/drivers/gpu/drm/i915/gt/intel_reset.c
+++ b/drivers/gpu/drm/i915/gt/intel_reset.c
@@ -790,8 +790,10 @@ static void nop_submit_request(struct i915_request *request)
 
 	request = i915_request_mark_eio(request);
 	if (request) {
-		i915_request_submit(request);
-		intel_engine_signal_breadcrumbs(request->engine);
+		struct intel_engine_cs *engine = request->engine;
+
+		i915_request_submit(request, engine);
+		intel_engine_signal_breadcrumbs(engine);
 
 		i915_request_put(request);
 	}
diff --git a/drivers/gpu/drm/i915/gt/intel_ring_scheduler.c b/drivers/gpu/drm/i915/gt/intel_ring_scheduler.c
index 25acf0d8e49a..a7b81b86d04f 100644
--- a/drivers/gpu/drm/i915/gt/intel_ring_scheduler.c
+++ b/drivers/gpu/drm/i915/gt/intel_ring_scheduler.c
@@ -453,15 +453,16 @@ static void switch_context(struct intel_ring *ring, struct i915_request *rq)
 	remap_l3(ring, engine, ce);
 }
 
-static struct i915_request *ring_submit(struct i915_request *rq)
+static struct i915_request *
+ring_submit(struct intel_engine_cs *engine, struct i915_request *rq)
 {
-	struct intel_ring *ring = rq->engine->legacy.ring;
+	struct intel_ring *ring = engine->legacy.ring;
 
-	__i915_request_submit(rq);
+	__i915_request_submit(rq, engine);
 
-	if (rq->engine->legacy.context != rq->context) {
+	if (engine->legacy.context != rq->context) {
 		switch_context(ring, rq);
-		set_current_context(&rq->engine->legacy.context, rq->context);
+		set_current_context(&engine->legacy.context, rq->context);
 	}
 
 	ring_copy(ring, rq->ring, rq->head, rq->tail);
@@ -557,7 +558,7 @@ static void dequeue(struct i915_sched *se, struct intel_engine_cs *engine)
 				*port++ = i915_request_get(last);
 			}
 
-			last = ring_submit(rq);
+			last = ring_submit(engine, rq);
 		}
 
 		i915_priolist_advance(&se->queue, p);
@@ -726,7 +727,7 @@ static void ring_reset_cancel(struct intel_engine_cs *engine)
 	for_each_priolist(p, &se->queue) {
 		priolist_for_each_request_safe(rq, rn, p) {
 			i915_request_mark_eio(rq);
-			__i915_request_submit(rq);
+			__i915_request_submit(rq, engine);
 		}
 		i915_priolist_advance(&se->queue, p);
 	}
diff --git a/drivers/gpu/drm/i915/gt/intel_ring_submission.c b/drivers/gpu/drm/i915/gt/intel_ring_submission.c
index 10a85110b70e..f69c05433fc7 100644
--- a/drivers/gpu/drm/i915/gt/intel_ring_submission.c
+++ b/drivers/gpu/drm/i915/gt/intel_ring_submission.c
@@ -413,10 +413,12 @@ static void reset_cancel(struct intel_engine_cs *engine)
 
 static void i9xx_submit_request(struct i915_request *request)
 {
-	i915_request_submit(request);
+	struct intel_engine_cs *engine = request->engine;
+
+	i915_request_submit(request, engine);
 	wmb(); /* paranoid flush writes out of the WCB before mmio */
 
-	ENGINE_WRITE(request->engine, RING_TAIL,
+	ENGINE_WRITE(engine, RING_TAIL,
 		     intel_ring_set_tail(request->ring, request->tail));
 }
 
diff --git a/drivers/gpu/drm/i915/gt/mock_engine.c b/drivers/gpu/drm/i915/gt/mock_engine.c
index 8c66c1e9fa09..cb5c5721623a 100644
--- a/drivers/gpu/drm/i915/gt/mock_engine.c
+++ b/drivers/gpu/drm/i915/gt/mock_engine.c
@@ -208,7 +208,7 @@ static void mock_submit_request(struct i915_request *request)
 		container_of(request->engine, typeof(*engine), base);
 	unsigned long flags;
 
-	i915_request_submit(request);
+	i915_request_submit(request, &engine->base);
 
 	spin_lock_irqsave(&engine->hw_lock, flags);
 	list_add_tail(&request->mock.link, &engine->hw_queue);
@@ -251,7 +251,7 @@ static void mock_reset_cancel(struct intel_engine_cs *engine)
 	/* Cancel and submit all pending requests. */
 	list_for_each_entry(rq, &mock->hw_queue, mock.link) {
 		if (i915_request_mark_eio(rq)) {
-			__i915_request_submit(rq);
+			__i915_request_submit(rq, engine);
 			i915_request_put(rq);
 		}
 	}
diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c b/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c
index d7772fa20f88..2b708298d37f 100644
--- a/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c
+++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c
@@ -213,7 +213,7 @@ static void __guc_dequeue(struct intel_engine_cs *engine)
 			}
 
 			list_del_init(&rq->sched.link);
-			__i915_request_submit(rq);
+			__i915_request_submit(rq, engine);
 			submit = true;
 			last = rq;
 		}
@@ -351,7 +351,7 @@ static void guc_reset_cancel(struct intel_engine_cs *engine)
 	for_each_priolist(p, &se->queue) {
 		priolist_for_each_request_safe(rq, rn, p) {
 			list_del_init(&rq->sched.link);
-			__i915_request_submit(rq);
+			__i915_request_submit(rq, engine);
 			dma_fence_set_error(&rq->fence, -EIO);
 			i915_request_mark_complete(rq);
 		}
diff --git a/drivers/gpu/drm/i915/i915_request.c b/drivers/gpu/drm/i915/i915_request.c
index e0ebdefd35ee..46ae475c84f2 100644
--- a/drivers/gpu/drm/i915/i915_request.c
+++ b/drivers/gpu/drm/i915/i915_request.c
@@ -461,9 +461,9 @@ struct i915_request *i915_request_mark_eio(struct i915_request *rq)
 	return rq;
 }
 
-bool __i915_request_submit(struct i915_request *request)
+bool __i915_request_submit(struct i915_request *request,
+			   struct intel_engine_cs *engine)
 {
-	struct intel_engine_cs *engine = request->engine;
 	struct i915_sched *se = intel_engine_get_scheduler(engine);
 	bool result = false;
 
@@ -550,7 +550,8 @@ bool __i915_request_submit(struct i915_request *request)
 	return result;
 }
 
-void i915_request_submit(struct i915_request *request)
+void i915_request_submit(struct i915_request *request,
+			 struct intel_engine_cs *engine)
 {
 	struct i915_sched *se = i915_request_get_scheduler(request);
 	unsigned long flags;
@@ -558,7 +559,7 @@ void i915_request_submit(struct i915_request *request)
 	/* Will be called from irq-context when using foreign fences. */
 	spin_lock_irqsave(&se->lock, flags);
 
-	__i915_request_submit(request);
+	__i915_request_submit(request, engine);
 
 	spin_unlock_irqrestore(&se->lock, flags);
 }
diff --git a/drivers/gpu/drm/i915/i915_request.h b/drivers/gpu/drm/i915/i915_request.h
index 62840206e3dd..45c494035cdd 100644
--- a/drivers/gpu/drm/i915/i915_request.h
+++ b/drivers/gpu/drm/i915/i915_request.h
@@ -362,8 +362,10 @@ int i915_request_await_execution(struct i915_request *rq,
 
 void i915_request_add(struct i915_request *rq);
 
-bool __i915_request_submit(struct i915_request *request);
-void i915_request_submit(struct i915_request *request);
+bool __i915_request_submit(struct i915_request *request,
+			   struct intel_engine_cs *engine);
+void i915_request_submit(struct i915_request *request,
+			 struct intel_engine_cs *engine);
 
 void __i915_request_unsubmit(struct i915_request *request);
 void i915_request_unsubmit(struct i915_request *request);
-- 
2.20.1



More information about the Intel-gfx-trybot mailing list