[PATCH 27/27] drm/i915: Fix ggtt failing on execbuf without pins

Maarten Lankhorst maarten.lankhorst at linux.intel.com
Fri Oct 8 06:30:23 UTC 2021


Signed-off-by: Maarten Lankhorst <maarten.lankhorst at linux.intel.com>
---
 drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
index 5bcf71d398aa..856d7bf327ce 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
@@ -583,6 +583,15 @@ eb_add_vma(struct i915_execbuffer *eb,
 		if (eb->reloc_cache.has_fence)
 			ev->flags |= EXEC_OBJECT_NEEDS_FENCE;
 
+		/*
+		 * When pinning the batch buffer into ggtt, we may need to
+		 * update relocations. Put the batch inside mappable area,
+		 * because reloc_iomap() will unbind the batch buffer
+		 * otherwise, as we no longer pin buffers inside execbuf.
+		 */
+		if (i915_is_ggtt(eb->vm) && entry->relocation_count)
+			ev->flags |= __EXEC_OBJECT_NEEDS_MAP;
+
 		eb->batch = ev;
 	}
 }
-- 
2.33.0



More information about the Intel-gfx-trybot mailing list