[igt-dev] [PATCH i-g-t v8 14/16] lib/intel_batchbuffer: change alignment constraints on gen4

Zbigniew Kempczyński zbigniew.kempczynski at intel.com
Mon Jul 27 11:44:10 UTC 2020


Gen4 requires bigger alignment on tiled buffers. Change to 0x8000
(similar relocation code does for gen4).

Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski at intel.com>
---
 lib/intel_batchbuffer.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/lib/intel_batchbuffer.c b/lib/intel_batchbuffer.c
index 3ae369b7..e2cfcbbd 100644
--- a/lib/intel_batchbuffer.c
+++ b/lib/intel_batchbuffer.c
@@ -1578,6 +1578,12 @@ intel_bb_add_intel_buf(struct intel_bb *ibb, struct intel_buf *buf, bool write)
 		obj->alignment = 0x10000;
 	}
 
+	/* For gen4 ensure tiled buffers are aligned to 0x8000 */
+	if (ibb->gen == 4 && buf->tiling) {
+		obj->offset &= ~(0x8000 - 1);
+		obj->alignment = 0x8000;
+	}
+
 	/* Update address in intel_buf buffer */
 	buf->addr.offset = obj->offset;
 
-- 
2.26.0



More information about the igt-dev mailing list