From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.126]) by gabe.freedesktop.org (Postfix) with ESMTPS id 09B2810E329 for ; Mon, 4 Sep 2023 11:05:58 +0000 (UTC) From: sai.gowtham.ch@intel.com To: igt-dev@lists.freedesktop.org, karolina.stolarek@intel.com, sai.gowtham.ch@intel.com Date: Mon, 4 Sep 2023 16:34:56 +0530 Message-Id: <20230904110458.24177-3-sai.gowtham.ch@intel.com> In-Reply-To: <20230904110458.24177-1-sai.gowtham.ch@intel.com> References: <20230904110458.24177-1-sai.gowtham.ch@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [igt-dev] [PATCH i-g-t 2/4] lib/intel_blt: check if blt commands are supported by the platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: igt-dev-bounces@lists.freedesktop.org Sender: "igt-dev" List-ID: From: Sai Gowtham Ch Check if mem-copy/mem-set commands are supported by fd device. Signed-off-by: Sai Gowtham Ch --- lib/intel_blt.c | 32 ++++++++++++++++++++++++++++++++ lib/intel_blt.h | 2 ++ 2 files changed, 34 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); -- 2.39.1