[PATCH 26/30] drm/i915: Require softpin for all new platforms

Maarten Lankhorst maarten.lankhorst at linux.intel.com
Mon Oct 11 12:11:33 UTC 2021


We disallow relocations, but don't actually enforce
EXEC_OBJECT_PINNED being set. Require this.

Cc: Jason Ekstrand <jason at jlekstrand.net>
Signed-off-by: Maarten Lankhorst <maarten.lankhorst at linux.intel.com>
---
 drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
index c6df8af44ec6..e5a5bfbd79da 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
@@ -499,7 +499,9 @@ eb_validate_vma(struct i915_execbuffer *eb,
 		struct drm_i915_gem_exec_object2 *entry,
 		struct i915_vma *vma)
 {
-	if (entry->relocation_count && !platform_has_relocs_enabled(eb))
+	/* relocations are disallowed for newer platforms, require softpin for all */
+	if ((entry->relocation_count || !(entry->flags & EXEC_OBJECT_PINNED)) &&
+	    !platform_has_relocs_enabled(eb))
 		return -EINVAL;
 
 	if (unlikely(entry->flags & eb->invalid_flags))
-- 
2.33.0



More information about the Intel-gfx-trybot mailing list