All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 01/33] drm/i915/execlists: Move RPCS setup to context pin
@ 2019-01-25  2:29 Chris Wilson
  2019-01-25  2:29 ` [PATCH 02/33] drm/i915: Measure the required reserved size for request emission Chris Wilson
                   ` (34 more replies)
  0 siblings, 35 replies; 50+ messages in thread
From: Chris Wilson @ 2019-01-25  2:29 UTC (permalink / raw)
  To: intel-gfx

From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Configuring RPCS in context image just before pin is sufficient and will
come extra handy in one of the following patches.

v2:
 * Split image setup a bit differently. (Chris Wilson)

v3:
 * Update context image after reset as well - otherwise the application
   of pinned default state clears the RPCS.

v4:
 * Use local variable throughout the function. (Chris Wilson)

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Suggested-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
---
 drivers/gpu/drm/i915/intel_lrc.c | 45 ++++++++++++++++++++------------
 1 file changed, 28 insertions(+), 17 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c
index 8aa8a4862543..9155cc675924 100644
--- a/drivers/gpu/drm/i915/intel_lrc.c
+++ b/drivers/gpu/drm/i915/intel_lrc.c
@@ -1173,6 +1173,24 @@ static int __context_pin(struct i915_gem_context *ctx, struct i915_vma *vma)
 	return i915_vma_pin(vma, 0, 0, flags);
 }
 
+static u32 make_rpcs(struct drm_i915_private *dev_priv);
+
+static void
+__execlists_update_reg_state(struct intel_engine_cs *engine,
+			     struct intel_context *ce)
+{
+	u32 *regs = ce->lrc_reg_state;
+	struct intel_ring *ring = ce->ring;
+
+	regs[CTX_RING_BUFFER_START + 1] = i915_ggtt_offset(ring->vma);
+	regs[CTX_RING_HEAD + 1] = ring->head;
+	regs[CTX_RING_TAIL + 1] = ring->tail;
+
+	/* RPCS */
+	if (engine->class == RENDER_CLASS)
+		regs[CTX_R_PWR_CLK_STATE + 1] = make_rpcs(engine->i915);
+}
+
 static struct intel_context *
 __execlists_context_pin(struct intel_engine_cs *engine,
 			struct i915_gem_context *ctx,
@@ -1211,10 +1229,8 @@ __execlists_context_pin(struct intel_engine_cs *engine,
 	GEM_BUG_ON(!intel_ring_offset_valid(ce->ring, ce->ring->head));
 
 	ce->lrc_reg_state = vaddr + LRC_STATE_PN * PAGE_SIZE;
-	ce->lrc_reg_state[CTX_RING_BUFFER_START+1] =
-		i915_ggtt_offset(ce->ring->vma);
-	ce->lrc_reg_state[CTX_RING_HEAD + 1] = ce->ring->head;
-	ce->lrc_reg_state[CTX_RING_TAIL + 1] = ce->ring->tail;
+
+	__execlists_update_reg_state(engine, ce);
 
 	ce->state->obj->pin_global++;
 	i915_gem_context_get(ctx);
@@ -1838,14 +1854,14 @@ static void execlists_reset(struct intel_engine_cs *engine,
 		       engine->pinned_default_state + LRC_STATE_PN * PAGE_SIZE,
 		       engine->context_size - PAGE_SIZE);
 	}
-	execlists_init_reg_state(regs,
-				 request->gem_context, engine, request->ring);
 
 	/* Move the RING_HEAD onto the breadcrumb, past the hanging batch */
-	regs[CTX_RING_BUFFER_START + 1] = i915_ggtt_offset(request->ring->vma);
-
 	request->ring->head = intel_ring_wrap(request->ring, request->postfix);
-	regs[CTX_RING_HEAD + 1] = request->ring->head;
+
+	execlists_init_reg_state(regs, request->gem_context, engine,
+				 request->ring);
+
+	__execlists_update_reg_state(engine, request->hw_context);
 
 	intel_ring_update_space(request->ring);
 
@@ -2534,8 +2550,7 @@ static void execlists_init_reg_state(u32 *regs,
 
 	if (rcs) {
 		regs[CTX_LRI_HEADER_2] = MI_LOAD_REGISTER_IMM(1);
-		CTX_REG(regs, CTX_R_PWR_CLK_STATE, GEN8_R_PWR_CLK_STATE,
-			make_rpcs(dev_priv));
+		CTX_REG(regs, CTX_R_PWR_CLK_STATE, GEN8_R_PWR_CLK_STATE, 0);
 
 		i915_oa_init_reg_state(engine, ctx, regs);
 	}
@@ -2696,12 +2711,8 @@ void intel_lr_context_resume(struct drm_i915_private *i915)
 
 			intel_ring_reset(ce->ring, 0);
 
-			if (ce->pin_count) { /* otherwise done in context_pin */
-				u32 *regs = ce->lrc_reg_state;
-
-				regs[CTX_RING_HEAD + 1] = ce->ring->head;
-				regs[CTX_RING_TAIL + 1] = ce->ring->tail;
-			}
+			if (ce->pin_count) /* otherwise done in context_pin */
+				__execlists_update_reg_state(engine, ce);
 		}
 	}
 }
-- 
2.20.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 50+ messages in thread

end of thread, other threads:[~2019-01-29 10:37 UTC | newest]

Thread overview: 50+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-25  2:29 [PATCH 01/33] drm/i915/execlists: Move RPCS setup to context pin Chris Wilson
2019-01-25  2:29 ` [PATCH 02/33] drm/i915: Measure the required reserved size for request emission Chris Wilson
2019-01-25  8:34   ` Mika Kuoppala
2019-01-25  9:52     ` Chris Wilson
2019-01-25  2:29 ` [PATCH 03/33] drm/i915: Remove manual breadcumb counting Chris Wilson
2019-01-25  9:21   ` Mika Kuoppala
2019-01-25  2:29 ` [PATCH 04/33] drm/i915: Compute the HWS offsets explicitly Chris Wilson
2019-01-25  9:26   ` Mika Kuoppala
2019-01-25  2:29 ` [PATCH 05/33] drm/i915/execlists: Suppress preempting self Chris Wilson
2019-01-25  2:29 ` [PATCH 06/33] drm/i915/execlists: Suppress redundant preemption Chris Wilson
2019-01-25  2:29 ` [PATCH 07/33] drm/i915/selftests: Apply a subtest filter Chris Wilson
2019-01-25 11:44   ` Mika Kuoppala
2019-01-25 11:48     ` Chris Wilson
2019-01-29 10:37   ` Joonas Lahtinen
2019-01-25  2:29 ` [PATCH 08/33] drm/i915: Make all GPU resets atomic Chris Wilson
2019-01-25  2:29 ` [PATCH 09/33] drm/i915/guc: Disable global reset Chris Wilson
2019-01-25  2:29 ` [PATCH 10/33] drm/i915: Remove GPU reset dependence on struct_mutex Chris Wilson
2019-01-25 12:50   ` Mika Kuoppala
2019-01-25  2:29 ` [PATCH 11/33] drm/i915/selftests: Trim struct_mutex duration for set-wedged selftest Chris Wilson
2019-01-25  2:29 ` [PATCH 12/33] drm/i915: Issue engine resets onto idle engines Chris Wilson
2019-01-25  2:29 ` [PATCH 13/33] drm/i915: Stop tracking MRU activity on VMA Chris Wilson
2019-01-25  2:29 ` [PATCH 14/33] drm/i915: Pull VM lists under the VM mutex Chris Wilson
2019-01-25  2:29 ` [PATCH 15/33] drm/i915: Move vma lookup to its own lock Chris Wilson
2019-01-25  2:29 ` [PATCH 16/33] drm/i915: Always allocate an object/vma for the HWSP Chris Wilson
2019-01-25  2:29 ` [PATCH 17/33] drm/i915: Add timeline barrier support Chris Wilson
2019-01-25  2:29 ` [PATCH 18/33] drm/i915: Move list of timelines under its own lock Chris Wilson
2019-01-25  2:29 ` [PATCH 19/33] drm/i915: Introduce concept of per-timeline (context) HWSP Chris Wilson
2019-01-25  2:29 ` [PATCH 20/33] drm/i915: Enlarge vma->pin_count Chris Wilson
2019-01-25  2:29 ` [PATCH 21/33] drm/i915: Allocate a status page for each timeline Chris Wilson
2019-01-25  2:29 ` [PATCH 22/33] drm/i915: Share per-timeline HWSP using a slab suballocator Chris Wilson
2019-01-25  2:29 ` [PATCH 23/33] drm/i915: Track the context's seqno in its own timeline HWSP Chris Wilson
2019-01-25  2:29 ` [PATCH 24/33] drm/i915: Track active timelines Chris Wilson
2019-01-25  2:29 ` [PATCH 25/33] drm/i915: Identify active requests Chris Wilson
2019-01-25  2:29 ` [PATCH 26/33] drm/i915: Remove the intel_engine_notify tracepoint Chris Wilson
2019-01-25 14:10   ` Tvrtko Ursulin
2019-01-25  2:29 ` [PATCH 27/33] drm/i915: Replace global breadcrumbs with per-context interrupt tracking Chris Wilson
2019-01-25 13:54   ` Tvrtko Ursulin
2019-01-25 14:26     ` Chris Wilson
2019-01-25 14:39       ` Chris Wilson
2019-01-25  2:30 ` [PATCH 28/33] drm/i915: Drop fake breadcrumb irq Chris Wilson
2019-01-25 11:07   ` Tvrtko Ursulin
2019-01-25  2:30 ` [PATCH 29/33] drm/i915: Implement an "idle" barrier Chris Wilson
2019-01-25  8:43   ` Chris Wilson
2019-01-25  2:30 ` [PATCH 30/33] drm/i915: Keep timeline HWSP allocated until the system is idle Chris Wilson
2019-01-25  2:30 ` [PATCH 31/33] drm/i915/execlists: Refactor out can_merge_rq() Chris Wilson
2019-01-25  2:30 ` [PATCH 32/33] drm/i915: Use HW semaphores for inter-engine synchronisation on gen8+ Chris Wilson
2019-01-25  2:30 ` [PATCH 33/33] drm/i915: Prioritise non-busywait semaphore workloads Chris Wilson
2019-01-25  3:13 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [01/33] drm/i915/execlists: Move RPCS setup to context pin Patchwork
2019-01-25  3:27 ` ✗ Fi.CI.SPARSE: " Patchwork
2019-01-25  3:34 ` ✗ Fi.CI.BAT: failure " Patchwork

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.