[igt-dev] [PATCH i-g-t 1/3] lib/intel_blt: Add offset to block and fast copy

Juha-Pekka Heikkila juhapekka.heikkila at gmail.com
Mon Jun 26 19:57:23 UTC 2023


Add offset to src and dst blits, this allow to use intel_blt with multiplane
framebuffers.

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila at gmail.com>
Reviewed-by: Zbigniew Kempczyński <zbigniew.kempczynski at intel.com>
---
 lib/intel_blt.c | 12 ++++++++----
 lib/intel_blt.h |  3 +++
 2 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/lib/intel_blt.c b/lib/intel_blt.c
index 28a740094..998c16939 100644
--- a/lib/intel_blt.c
+++ b/lib/intel_blt.c
@@ -708,8 +708,10 @@ uint64_t emit_blt_block_copy(int fd,
 	igt_assert_f(blt, "block-copy requires data to do blit\n");
 
 	alignment = gem_detect_safe_alignment(fd);
-	src_offset = get_offset(ahnd, blt->src.handle, blt->src.size, alignment);
-	dst_offset = get_offset(ahnd, blt->dst.handle, blt->dst.size, alignment);
+	src_offset = get_offset(ahnd, blt->src.handle, blt->src.size, alignment)
+		     + blt->src.plane_offset;
+	dst_offset = get_offset(ahnd, blt->dst.handle, blt->dst.size, alignment)
+		     + blt->dst.plane_offset;
 	bb_offset = get_offset(ahnd, blt->bb.handle, blt->bb.size, alignment);
 
 	fill_data(&data, blt, src_offset, dst_offset, ext);
@@ -1179,8 +1181,10 @@ uint64_t emit_blt_fast_copy(int fd,
 	data.dw03.dst_x2 = blt->dst.x2;
 	data.dw03.dst_y2 = blt->dst.y2;
 
-	src_offset = get_offset(ahnd, blt->src.handle, blt->src.size, alignment);
-	dst_offset = get_offset(ahnd, blt->dst.handle, blt->dst.size, alignment);
+	src_offset = get_offset(ahnd, blt->src.handle, blt->src.size, alignment)
+		     + blt->src.plane_offset;
+	dst_offset = get_offset(ahnd, blt->dst.handle, blt->dst.size, alignment)
+		     + blt->dst.plane_offset;
 	bb_offset = get_offset(ahnd, blt->bb.handle, blt->bb.size, alignment);
 
 	data.dw04.dst_address_lo = dst_offset;
diff --git a/lib/intel_blt.h b/lib/intel_blt.h
index 0cbe881f4..62cc835fd 100644
--- a/lib/intel_blt.h
+++ b/lib/intel_blt.h
@@ -88,6 +88,9 @@ struct blt_copy_object {
 
 	/* mapping or null */
 	uint32_t *ptr;
+
+	/* enable to use multiplane framebuffers */
+	uint32_t plane_offset;
 };
 
 struct blt_copy_batch {
-- 
2.25.1



More information about the igt-dev mailing list