[PATCH v4 1/2] lib/intel_blt: Convert BB pointer to uint8_t* in emit_blt_fast_copy
From: Balasubramani Vivekanandan <hidden>
Date: 2025-11-17 10:18:01
Argument bb_pos is a byte offset. So the BB pointer should be defined as uint8_t*. Fix it by changing the BB pointer from uint32_t* to uint8_t*. Additional minor fix to change use of sizeof(uint32_t) to sizeof(bbe) while checking for size of BBE instruction. Cc: Ashutosh Dixit <redacted> Cc: Zbigniew Kempczyński <redacted> Signed-off-by: Balasubramani Vivekanandan <redacted> --- v2: - Same fix done at few places in the function (Ashutosh) v3: - Convert bb pointer from uint32_t* to uint8_t* (Ashutosh, Zbigniew) v4: - Return bb byte offset from emit_blt_fast_copy (Zbigniew) --- lib/intel_blt.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/lib/intel_blt.c b/lib/intel_blt.c
index 7f7f5485e..e63341a02 100644
--- a/lib/intel_blt.c
+++ b/lib/intel_blt.c@@ -1655,7 +1655,7 @@ uint64_t emit_blt_fast_copy(int fd, struct gen12_fast_copy_data data = {}; uint64_t dst_offset, src_offset, bb_offset; uint32_t bbe = MI_BATCH_BUFFER_END; - uint32_t *bb; + uint8_t *bb; data.dw00.client = 0x2; data.dw00.opcode = 0x42;
@@ -1717,9 +1717,9 @@ uint64_t emit_blt_fast_copy(int fd, bb_pos += sizeof(data); if (emit_bbe) { - igt_assert(bb_pos + sizeof(uint32_t) < blt->bb.size); + igt_assert(bb_pos + sizeof(bbe) < blt->bb.size); memcpy(bb + bb_pos, &bbe, sizeof(bbe)); - bb_pos += sizeof(uint32_t); + bb_pos += sizeof(bbe); } if (blt->print_bb) {
--
2.43.0