[PATCH 3/4] lib/igt_draw: Add Y-tiling support for IGT_DRAW_BLT method

Praveen Paneri praveen.paneri at intel.com
Sat Oct 22 05:27:58 UTC 2016


From: Akash Goel <akash.goel at intel.com>

Signed-off-by: Akash Goel <akash.goel at intel.com>
---
 lib/igt_draw.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/lib/igt_draw.c b/lib/igt_draw.c
index 29a725f..8da0257 100644
--- a/lib/igt_draw.c
+++ b/lib/igt_draw.c
@@ -517,6 +517,15 @@ static void draw_rect_blt(int fd, struct cmd_data *cmd_data,
 	blt_cmd_tiling = (tiling) ? XY_COLOR_BLT_TILED : 0;
 	pitch = (tiling) ? buf->stride / 4 : buf->stride;
 
+	if (tiling == I915_TILING_Y) {
+		BEGIN_BATCH(4, 0);
+		OUT_BATCH(MI_LOAD_REGISTER_IMM);
+		OUT_BATCH(0x22200); /* BCS_SWCTRL */
+		OUT_BATCH(((0x3 << 16) | 0x3)); /* enable the Y tiling */
+		OUT_BATCH(MI_NOOP);
+		ADVANCE_BATCH();
+	}
+
 	BEGIN_BATCH(6, 1);
 	OUT_BATCH(XY_COLOR_BLT_CMD_NOLEN | XY_COLOR_BLT_WRITE_ALPHA |
 		  XY_COLOR_BLT_WRITE_RGB | blt_cmd_tiling | blt_cmd_len);
@@ -527,6 +536,15 @@ static void draw_rect_blt(int fd, struct cmd_data *cmd_data,
 	OUT_BATCH(color);
 	ADVANCE_BATCH();
 
+	if (tiling == I915_TILING_Y) {
+		BEGIN_BATCH(4, 0);
+		OUT_BATCH(MI_LOAD_REGISTER_IMM);
+		OUT_BATCH(0x22200); /* BCS_SWCTRL */
+		OUT_BATCH((0x3 << 16)); /* Reset back to X-Tiling (default) */
+		OUT_BATCH(MI_NOOP);
+		ADVANCE_BATCH();
+	}
+
 	intel_batchbuffer_flush(batch);
 	intel_batchbuffer_free(batch);
 }
-- 
1.9.1



More information about the Intel-gfx-trybot mailing list