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

Maarten Lankhorst maarten.lankhorst at linux.intel.com
Wed Oct 20 08:01:20 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 557017b28bcd..43b6babfc6ae 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
@@ -507,7 +507,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