]> git.baikalelectronics.ru Git - kernel.git/commit
drm/i915: Suppress switch_mm emission between the same aliasing_ppgtt
authorChris Wilson <chris@chris-wilson.co.uk>
Sat, 12 Aug 2017 15:27:24 +0000 (16:27 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Sat, 12 Aug 2017 15:50:12 +0000 (16:50 +0100)
commit1255a143af39bf2f9522b12429301272f662da30
treeb83d1d3c066f4505bf7abe6db64edf56749ec7c9
parent8443ad6c46660581e4dec20f4425f084087f75b1
drm/i915: Suppress switch_mm emission between the same aliasing_ppgtt

When switching between contexts using the aliasing_ppgtt, the VM is
shared. We don't need to reload the PD registers unless they are dirty.

Martin Peres reported an issue that looks like corruption between
Haswell context switches, bisecting to commit 48cbbc71f970 ("drm/i915:
Rearrange switch_context to load the aliasing ppgtt on first use").
Switching between the same mm (the aliasing_ppgtt is used for all
contexts in this case) should be a nop, but appears to trigger some
side-effects in the context switch. However, as we know the switch
is redundant in this case, we can skip it and continue to ignore the
issue until somebody feels strong enough to investigate full-ppgtt on
gen7 again!

Except.. Martin was using full-ppgtt which is not supported as it
doesn't work correctly yet. So whilst the bisect did yield valuable
information about the failures, the fix should not have any user impact
under default settings, with the exception of a slightly lower
throughput on xcs as the VM would always be reloaded.

v2: Also remember to set the legacy_active_context following the switch
on xcs (commit c99ba9b84492 ("drm/i915: Unify active context tracking
between legacy/execlists/guc"))

Fixes: 48cbbc71f970 ("drm/i915: Rearrange switch_context to load the aliasing ppgtt on first use")
Fixes: c99ba9b84492 ("drm/i915: Unify active context tracking between legacy/execlists/guc")
Reported-by: Martin Peres <martin.peres@linux.intel.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Martin Peres <martin.peres@linux.intel.com>
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20170812152724.6883-1-chris@chris-wilson.co.uk
drivers/gpu/drm/i915/i915_gem_context.c