[PATCH 08/10] drm/i915: Release the atomic kmap relocation cache around snb GTT w/a

Chris Wilson chris at chris-wilson.co.uk
Tue Feb 13 13:22:54 UTC 2018

When we need to rebind the vma into the global GTT for snb, we need to
drop the current reloc_cache as it will be holding a kmap_atomic() and
we may need to sleep for i915_vma_bind(). In practice, this is not an
issue as we already hold an rpm reference for the execbuffer, but with
tighter error checking around rpm we need to be more careful.

References: 31a39207f04a ("drm/i915: Cache kmap between relocations")
Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen at linux.intel.com>
 drivers/gpu/drm/i915/i915_gem_execbuffer.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
index b15305f2fb76..8c34b1b5a126 100644
--- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c
+++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
@@ -1315,6 +1315,12 @@ eb_relocate_entry(struct i915_execbuffer *eb,
 		if (reloc->write_domain == I915_GEM_DOMAIN_INSTRUCTION &&
 		    IS_GEN6(eb->i915)) {
+			/*
+			 * Release the kmap_atomic cache in order to allow the
+			 * i915_vma_bind() to sleep (if needs be).
+			 */
+			reloc_cache_reset(&eb->reloc_cache);
 			err = i915_vma_bind(target, target->obj->cache_level,
 			if (WARN_ONCE(err,

More information about the Intel-gfx-trybot mailing list