[PATCH 84/94] drm/i915/gt: Pin all the siblings' breadcrumb irq on the virtual engine

Chris Wilson chris at chris-wilson.co.uk
Thu Jul 30 23:22:30 UTC 2020


Since the virtual engine is driven by interrupts, we will keep them
enabled whenever the engine is active. Let's try reducing the overhead
of enabling the interrupt on every request by pinning the interrupt
while the virtual engine is active.

Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/gt/intel_lrc.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/gt/intel_lrc.c b/drivers/gpu/drm/i915/gt/intel_lrc.c
index 0a51cf54cfa9..cfaeb9f82db9 100644
--- a/drivers/gpu/drm/i915/gt/intel_lrc.c
+++ b/drivers/gpu/drm/i915/gt/intel_lrc.c
@@ -5312,8 +5312,10 @@ static void virtual_context_enter(struct intel_context *ce)
 	struct virtual_engine *ve = container_of(ce, typeof(*ve), context);
 	unsigned int n;
 
-	for (n = 0; n < ve->num_siblings; n++)
+	for (n = 0; n < ve->num_siblings; n++) {
 		intel_engine_pm_get(ve->siblings[n]);
+		intel_breadcrumbs_pin_irq(ve->siblings[n]->breadcrumbs);
+	}
 
 	intel_timeline_enter(ce->timeline);
 }
@@ -5325,8 +5327,10 @@ static void virtual_context_exit(struct intel_context *ce)
 
 	intel_timeline_exit(ce->timeline);
 
-	for (n = 0; n < ve->num_siblings; n++)
+	for (n = 0; n < ve->num_siblings; n++) {
+		intel_breadcrumbs_unpin_irq(ve->siblings[n]->breadcrumbs);
 		intel_engine_pm_put(ve->siblings[n]);
+	}
 }
 
 static const struct intel_context_ops virtual_context_ops = {
-- 
2.20.1



More information about the Intel-gfx-trybot mailing list