[PATCH i-g-t 1/4] lib/intel_blt: Use object pitch and aligned height on png write

Zbigniew Kempczyński zbigniew.kempczynski at intel.com
Wed Jan 31 10:51:45 UTC 2024


Pitch and buffer height on tiled surfaces might be bigger than
image width and height so dump memory to png using pitch size
instead width and aligned height instead height.

Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski at intel.com>
Cc: Karolina Drobnik <karolina.drobnik at intel.com>
---
 lib/intel_blt.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/lib/intel_blt.c b/lib/intel_blt.c
index 25d251c4f8..951c364d5f 100644
--- a/lib/intel_blt.c
+++ b/lib/intel_blt.c
@@ -2019,6 +2019,11 @@ void blt_surface_to_png(int fd, uint32_t run_id, const char *fileid,
 	char filename[FILENAME_MAX];
 	bool is_xe = is_xe_device(fd);
 
+	if (obj->tiling) {
+		width = obj->pitch;
+		height = blt_get_aligned_height(height, obj->tiling);
+	}
+
 	snprintf(filename, FILENAME_MAX-1, "%d-%s-%s-%ux%u-%s.png",
 		 run_id, fileid, blt_tiling_name(obj->tiling), width, height,
 		 obj->compression ? "compressed" : "uncompressed");
-- 
2.34.1



More information about the igt-dev mailing list