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

Maarten Lankhorst maarten.lankhorst at linux.intel.com
Fri Oct 8 10:22: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 92d4c8cd5493..5bcf71d398aa 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