Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: sai.gowtham.ch@intel.com
To: igt-dev@lists.freedesktop.org, karolina.stolarek@intel.com,
	Zbigniew.Kempczynski@intel.com, sai.gowtham.ch@intel.com
Subject: [igt-dev] [PATCH i-g-t 1/3] lib/intel_blt: Add check to see if blt commands are supported by the platforms
Date: Tue, 26 Sep 2023 17:57:47 +0530	[thread overview]
Message-ID: <20230926122749.32460-2-sai.gowtham.ch@intel.com> (raw)
In-Reply-To: <20230926122749.32460-1-sai.gowtham.ch@intel.com>

From: Sai Gowtham Ch <sai.gowtham.ch@intel.com>

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.

Signed-off-by: Sai Gowtham Ch <sai.gowtham.ch@intel.com>
---
 lib/intel_blt.c       | 32 ++++++++++++++++++++++++++++++++
 lib/intel_blt.h       |  2 ++
 lib/intel_cmds_info.c | 12 ++++++++++++
 lib/intel_cmds_info.h |  7 +++++++
 4 files changed, 53 insertions(+)

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
@@ -289,6 +289,38 @@ bool blt_has_block_copy(int fd)
 	return blt_supports_command(cmds_info, XY_BLOCK_COPY);
 }
 
+/**
+ * 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..2e51ec081 100644
--- a/lib/intel_cmds_info.c
+++ b/lib/intel_cmds_info.c
@@ -82,6 +82,16 @@ static const struct blt_cmd_info
 						 BIT(T_TILE64),
 						 BLT_CMD_EXTENDED);
 
+static const struct blt_cmd_info
+		pvc_mem_copy = BLT_INFO(MEM_COPY,
+					BIT(M_LINEAR) |
+					BIT(M_MATRIX));
+
+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) |
@@ -154,6 +164,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..7396215e3 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_copy_type {
+	M_LINEAR,
+	M_MATRIX,
+};
+
 enum blt_cmd_type {
 	SRC_COPY,
+	MEM_SET,
+	MEM_COPY,
 	XY_SRC_COPY,
 	XY_FAST_COPY,
 	XY_BLOCK_COPY,
-- 
2.39.1

  reply	other threads:[~2023-09-26 12:29 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-26 12:27 [igt-dev] [PATCH i-g-t 0/3] Add copy basic test to exercise blt commands sai.gowtham.ch
2023-09-26 12:27 ` sai.gowtham.ch [this message]
2023-09-27 11:22   ` [igt-dev] [PATCH i-g-t 1/3] lib/intel_blt: Add check to see if blt commands are supported by the platforms Zbigniew Kempczyński
2023-09-26 12:27 ` [igt-dev] [PATCH i-g-t 2/3] lib/intel_blt: Add wrappers to prepare batch buffers and submit exec sai.gowtham.ch
2023-09-27 11:36   ` Zbigniew Kempczyński
2023-09-26 12:27 ` [igt-dev] [PATCH i-g-t 3/3] intel/xe_copy_basic: Add copy basic test to exercise blt commands sai.gowtham.ch
2023-09-26 13:49 ` [igt-dev] ✓ Fi.CI.BAT: success for Add copy basic test to exercise blt commands (rev4) Patchwork
2023-09-26 14:16 ` [igt-dev] ✓ CI.xeBAT: " Patchwork
2023-09-27  1:27 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230926122749.32460-2-sai.gowtham.ch@intel.com \
    --to=sai.gowtham.ch@intel.com \
    --cc=Zbigniew.Kempczynski@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=karolina.stolarek@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox