[PATCH 18/22] drm/i915: Require softpin for all new platforms
Maarten Lankhorst
maarten.lankhorst at linux.intel.com
Thu Nov 25 13:50:46 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 eeda24d57381..a4d065972b9d 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
@@ -504,7 +504,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