[PATCH 1/1] i915/gem/i915_gem_execbuffer: Disallow passing alignment

Zbigniew Kempczyński zbigniew.kempczynski at intel.com
Mon Sep 27 11:18:06 UTC 2021


Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski at intel.com>
---
 drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
index 2f2434b52317..376e7ab2db4b 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
@@ -495,6 +495,14 @@ static bool platform_has_relocs_enabled(const struct i915_execbuffer *eb)
 	return false;
 }
 
+static bool platform_allows_pass_alignment(const struct i915_execbuffer *eb)
+{
+	if (GRAPHICS_VER(eb->i915) < 9)
+		return true;
+
+	return false;
+}
+
 static int
 eb_validate_vma(struct i915_execbuffer *eb,
 		struct drm_i915_gem_exec_object2 *entry,
@@ -503,6 +511,9 @@ eb_validate_vma(struct i915_execbuffer *eb,
 	if (entry->relocation_count && !platform_has_relocs_enabled(eb))
 		return -EINVAL;
 
+	if (entry->alignment && !platform_allows_pass_alignment(eb))
+		return -EINVAL;
+
 	if (unlikely(entry->flags & eb->invalid_flags))
 		return -EINVAL;
 
-- 
2.26.0



More information about the Intel-gfx-trybot mailing list