[igt-dev] [PATCH i-g-t v2 4/6] lib/intel_cmds_info: Add flags field to describe command properties

Karolina Stolarek karolina.stolarek at intel.com
Wed Feb 8 13:47:37 UTC 2023


Blitter commands may have different properties depending on the
platform. Add a new field to blt_cmd_info struct to describe
their properties. Update block-copy definitions for DG2 and MTL
to use that field.

Signed-off-by: Karolina Stolarek <karolina.stolarek at intel.com>
---
 lib/i915/intel_cmds_info.c | 28 ++++++++++++++++++++++------
 lib/i915/intel_cmds_info.h |  4 ++++
 2 files changed, 26 insertions(+), 6 deletions(-)

diff --git a/lib/i915/intel_cmds_info.c b/lib/i915/intel_cmds_info.c
index d99b3131..f79a8e86 100644
--- a/lib/i915/intel_cmds_info.c
+++ b/lib/i915/intel_cmds_info.c
@@ -12,6 +12,12 @@
 		.supported_tiling = _tiling \
 	}
 
+#define BLT_INFO_EXT(_cmd, _tiling, _flags)  { \
+		.blt_cmd_type = _cmd, \
+		.supported_tiling = _tiling, \
+		.flags = _flags, \
+	}
+
 static const struct blt_cmd_info src_copy = BLT_INFO(SRC_COPY, BIT(T_LINEAR));
 static const struct blt_cmd_info
 		pre_gen8_xy_src_copy = BLT_INFO(XY_SRC_COPY,
@@ -45,11 +51,21 @@ static const struct blt_cmd_info
 					       BIT(T_LINEAR) |
 					       BIT(T_YMAJOR));
 static const struct blt_cmd_info
-		dg2_xy_block_copy = BLT_INFO(XY_BLOCK_COPY,
-					     BIT(T_LINEAR) |
-					     BIT(T_XMAJOR) |
-					     BIT(T_TILE4)  |
-					     BIT(T_TILE64));
+		dg2_xy_block_copy = BLT_INFO_EXT(XY_BLOCK_COPY,
+						 BIT(T_LINEAR) |
+						 BIT(T_XMAJOR) |
+						 BIT(T_TILE4)  |
+						 BIT(T_TILE64),
+						 BLT_CMD_EXTENDED |
+						 BLT_CMD_SUPPORTS_COMPRESSION);
+
+static const struct blt_cmd_info
+		mtl_xy_block_copy = BLT_INFO_EXT(XY_BLOCK_COPY,
+						 BIT(T_LINEAR) |
+						 BIT(T_XMAJOR) |
+						 BIT(T_TILE4)  |
+						 BIT(T_TILE64),
+						 BLT_CMD_EXTENDED);
 
 const struct blt_cmds_desc pre_gen8_blt_info = {
 	.supported_cmds = {
@@ -90,6 +106,6 @@ const struct blt_cmds_desc gen12_dg2_blt_info = {
 const struct blt_cmds_desc gen12_mtl_blt_info = {
 	.supported_cmds = {
 		[XY_FAST_COPY] = &dg2_xy_fast_copy,
-		[XY_BLOCK_COPY] = &dg2_xy_block_copy
+		[XY_BLOCK_COPY] = &mtl_xy_block_copy
 	}
 };
diff --git a/lib/i915/intel_cmds_info.h b/lib/i915/intel_cmds_info.h
index e86b6dd4..37cfca84 100644
--- a/lib/i915/intel_cmds_info.h
+++ b/lib/i915/intel_cmds_info.h
@@ -29,6 +29,10 @@ enum blt_cmd_type {
 struct blt_cmd_info {
 	enum blt_cmd_type blt_cmd_type;
 	uint32_t supported_tiling;
+
+	uint32_t flags;
+#define BLT_CMD_EXTENDED               (1 << 0)
+#define BLT_CMD_SUPPORTS_COMPRESSION   (1 << 1)
 };
 
 struct blt_cmds_desc {
-- 
2.25.1



More information about the igt-dev mailing list