[PATCH 4/4] hmm
Chris Wilson
chris at chris-wilson.co.uk
Fri Nov 22 17:28:14 UTC 2019
---
.../gpu/drm/i915/gt/intel_ring_submission.c | 37 ++++++++++++++-----
drivers/gpu/drm/i915/i915_pci.c | 4 +-
2 files changed, 29 insertions(+), 12 deletions(-)
diff --git a/drivers/gpu/drm/i915/gt/intel_ring_submission.c b/drivers/gpu/drm/i915/gt/intel_ring_submission.c
index f25ceccb335e..58154f5d06d6 100644
--- a/drivers/gpu/drm/i915/gt/intel_ring_submission.c
+++ b/drivers/gpu/drm/i915/gt/intel_ring_submission.c
@@ -1579,20 +1579,40 @@ static int switch_context(struct i915_request *rq)
{
struct intel_context *ce = rq->hw_context;
struct i915_address_space *vm = vm_alias(ce);
+ struct intel_engine_cs *engine = rq->engine;
+ u32 hw_flags = 0;
int ret;
GEM_BUG_ON(HAS_EXECLISTS(rq->i915));
if (vm) {
- ret = load_pd_dir(rq, i915_vm_to_ppgtt(vm));
- if (ret)
- return ret;
- }
+ struct i915_ppgtt *ppgtt = i915_vm_to_ppgtt(vm);
+ int loops;
+
+ /*
+ * Baytail takes a little more convincing that it really needs
+ * to reload the PD between contexts. It is not just a little
+ * longer, as adding more stalls after the load_pd_dir (i.e.
+ * adding a long loop around flush_pd_dir) is not as effective
+ * as reloading the PD umpteen times. 32 is derived from
+ * experimentation (gem_exec_parallel/fds) and has no good
+ * explanation.
+ */
+ loops = 1;
+ if (engine->id == BCS0 && IS_VALLEYVIEW(engine->i915))
+ loops = 32;
- if (ce->state) {
- u32 hw_flags;
+ do {
+ ret = load_pd_dir(rq, ppgtt);
+ if (ret)
+ return ret;
+ } while (--loops);
- GEM_BUG_ON(rq->engine->id != RCS0);
+ hw_flags = MI_FORCE_RESTORE;
+ }
+
+ if (rq->hw_context->state) {
+ GEM_BUG_ON(engine->id != RCS0);
/*
* The kernel context(s) is treated as pure scratch and is not
@@ -1601,7 +1621,6 @@ static int switch_context(struct i915_request *rq)
* as nothing actually executes using the kernel context; it
* is purely used for flushing user contexts.
*/
- hw_flags = 0;
if (i915_gem_context_is_kernel(rq->gem_context))
hw_flags = MI_RESTORE_INHIBIT;
@@ -1611,8 +1630,6 @@ static int switch_context(struct i915_request *rq)
}
if (vm) {
- struct intel_engine_cs *engine = rq->engine;
-
ret = engine->emit_flush(rq, EMIT_INVALIDATE);
if (ret)
return ret;
diff --git a/drivers/gpu/drm/i915/i915_pci.c b/drivers/gpu/drm/i915/i915_pci.c
index da3e9b5752ac..bba6b50e6beb 100644
--- a/drivers/gpu/drm/i915/i915_pci.c
+++ b/drivers/gpu/drm/i915/i915_pci.c
@@ -436,7 +436,7 @@ static const struct intel_device_info intel_sandybridge_m_gt2_info = {
.has_rc6 = 1, \
.has_rc6p = 1, \
.has_rps = true, \
- .ppgtt_type = INTEL_PPGTT_ALIASING, \
+ .ppgtt_type = INTEL_PPGTT_FULL, \
.ppgtt_size = 31, \
IVB_PIPE_OFFSETS, \
IVB_CURSOR_OFFSETS, \
@@ -493,7 +493,7 @@ static const struct intel_device_info intel_valleyview_info = {
.has_rps = true,
.display.has_gmch = 1,
.display.has_hotplug = 1,
- .ppgtt_type = INTEL_PPGTT_ALIASING,
+ .ppgtt_type = INTEL_PPGTT_FULL,
.ppgtt_size = 31,
.has_snoop = true,
.has_coherent_ggtt = false,
--
2.24.0
More information about the Intel-gfx-trybot
mailing list