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

Maarten Lankhorst maarten.lankhorst at linux.intel.com
Tue Nov 23 12:45:41 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 33e17048dd9e..68eb5097abfc 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.34.0



More information about the Intel-gfx-trybot mailing list