summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSai Gowtham Ch <sai.gowtham.ch@intel.com>2023-10-01 00:07:09 +0530
committerSai Gowtham Ch <sai.gowtham.ch@intel.com>2023-10-01 00:07:09 +0530
commit8abfd4fd5c71c882e90410aac2afba7331904b2b (patch)
treed8bf5f8a7116e95608ecad370599633bfd6ef311
parent4fdf544bd0a38c5a100ef43c30171827e1c8c442 (diff)
lib/intel_blt: Add check to see if blt commands are supported by the platforms
This commit has following changes: 1. Add check to see if blt commands are supported by the platforms. 2. Add MEM_COPY and MEM_SET instructions. 3. Update cmd info for MEM_COPY and MEM_SET. 4. Add copy type used for MEM_COPY and MEM_SET. Cc: Karolina Stolarek <karolina.stolarek@intel.com> Cc: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com> Signed-off-by: Sai Gowtham Ch <sai.gowtham.ch@intel.com> Reviewed-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
-rw-r--r--lib/intel_blt.c32
-rw-r--r--lib/intel_blt.h2
-rw-r--r--lib/intel_cmds_info.c11
-rw-r--r--lib/intel_cmds_info.h7
4 files changed, 52 insertions, 0 deletions
diff --git a/lib/intel_blt.c b/lib/intel_blt.c
index 429511920..b55fa9b52 100644
--- a/lib/intel_blt.c
+++ b/lib/intel_blt.c
@@ -290,6 +290,38 @@ bool blt_has_block_copy(int fd)
}
/**
+ * blt_has_mem_copy
+ * @fd: drm fd
+ *
+ * Check if mem copy is supported by @fd device
+ *
+ * Returns:
+ * true if it does, false otherwise.
+ */
+bool blt_has_mem_copy(int fd)
+{
+ const struct intel_cmds_info *cmds_info = GET_CMDS_INFO(fd);
+
+ return blt_supports_command(cmds_info, MEM_COPY);
+}
+
+/**
+ * blt_has_mem_set
+ * @fd: drm fd
+ *
+ * Check if mem set is supported by @fd device
+ *
+ * Returns:
+ * true if it does, false otherwise.
+ */
+bool blt_has_mem_set(int fd)
+{
+ const struct intel_cmds_info *cmds_info = GET_CMDS_INFO(fd);
+
+ return blt_supports_command(cmds_info, MEM_SET);
+}
+
+/**
* blt_has_fast_copy
* @fd: drm fd
*
diff --git a/lib/intel_blt.h b/lib/intel_blt.h
index b8b3d724d..d9c8883c7 100644
--- a/lib/intel_blt.h
+++ b/lib/intel_blt.h
@@ -175,6 +175,8 @@ bool blt_cmd_has_property(const struct intel_cmds_info *cmds_info,
uint32_t prop);
bool blt_has_block_copy(int fd);
+bool blt_has_mem_copy(int fd);
+bool blt_has_mem_set(int fd);
bool blt_has_fast_copy(int fd);
bool blt_has_xy_src_copy(int fd);
bool blt_has_xy_color(int fd);
diff --git a/lib/intel_cmds_info.c b/lib/intel_cmds_info.c
index 366b37f2c..1bf13fdc1 100644
--- a/lib/intel_cmds_info.c
+++ b/lib/intel_cmds_info.c
@@ -83,6 +83,15 @@ static const struct blt_cmd_info
BLT_CMD_EXTENDED);
static const struct blt_cmd_info
+ pvc_mem_copy = BLT_INFO(MEM_COPY,
+ BIT(M_LINEAR));
+
+static const struct blt_cmd_info
+ pvc_mem_set = BLT_INFO(MEM_SET,
+ BIT(M_LINEAR) |
+ BIT(M_MATRIX));
+
+static const struct blt_cmd_info
pre_gen6_xy_color_blt = BLT_INFO(XY_COLOR_BLT,
BIT(T_LINEAR) |
BIT(T_XMAJOR));
@@ -154,6 +163,8 @@ const struct intel_cmds_info gen12_pvc_cmds_info = {
.blt_cmds = {
[XY_FAST_COPY] = &pvc_xy_fast_copy,
[XY_BLOCK_COPY] = &pvc_xy_block_copy,
+ [MEM_COPY] = &pvc_mem_copy,
+ [MEM_SET] = &pvc_mem_set,
}
};
diff --git a/lib/intel_cmds_info.h b/lib/intel_cmds_info.h
index 91d0f15ec..f9e3932d1 100644
--- a/lib/intel_cmds_info.h
+++ b/lib/intel_cmds_info.h
@@ -18,8 +18,15 @@ enum blt_tiling_type {
__BLT_MAX_TILING
};
+enum blt_memop_type {
+ M_LINEAR,
+ M_MATRIX,
+};
+
enum blt_cmd_type {
SRC_COPY,
+ MEM_SET,
+ MEM_COPY,
XY_SRC_COPY,
XY_FAST_COPY,
XY_BLOCK_COPY,