[igt-dev] [PATCH i-g-t] lib/batchbuffer: Ensure obj.alignment is zeroed for softpinning

Zbigniew Kempczyński zbigniew.kempczynski at intel.com
Thu Jul 28 12:06:20 UTC 2022


Passing obj.alignment doesn't make sense for softpinning as offsets
are under full control of allocator.

Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski at intel.com>
Cc: Ashutosh Dixit <ashutosh.dixit at intel.com>
---
 lib/intel_batchbuffer.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/lib/intel_batchbuffer.c b/lib/intel_batchbuffer.c
index 36cb55048d..ef1b594771 100644
--- a/lib/intel_batchbuffer.c
+++ b/lib/intel_batchbuffer.c
@@ -1346,7 +1346,6 @@ __intel_bb_create(int i915, uint32_t ctx, uint32_t size, bool do_relocs,
 
 	igt_assert(ibb);
 
-	ibb->allows_obj_alignment = gem_allows_obj_alignment(i915);
 	ibb->uses_full_ppgtt = gem_uses_full_ppgtt(i915);
 	ibb->devid = intel_get_drm_devid(i915);
 	ibb->gen = intel_gen(ibb->devid);
@@ -1359,6 +1358,13 @@ __intel_bb_create(int i915, uint32_t ctx, uint32_t size, bool do_relocs,
 	if (!ibb->uses_full_ppgtt)
 		do_relocs = true;
 
+	/*
+	 * For softpin mode allocator has full control over offsets allocation
+	 * so we want kernel to not interfere with this.
+	 */
+	if (do_relocs)
+		ibb->allows_obj_alignment = gem_allows_obj_alignment(i915);
+
 	/* Use safe start offset instead assuming 0x0 is safe */
 	start = max_t(uint64_t, start, gem_detect_safe_start_offset(i915));
 
-- 
2.34.1



More information about the igt-dev mailing list