From: "Zbigniew Kempczyński" <zbigniew.kempczynski@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: "Zbigniew Kempczyński" <zbigniew.kempczynski@intel.com>,
"Karolina Stolarek" <karolina.stolarek@intel.com>
Subject: [PATCH i-g-t v3 09/11] lib/intel_blt: Add render tilings and compression support helper
Date: Tue, 7 May 2024 09:58:34 +0200 [thread overview]
Message-ID: <20240507075836.259581-10-zbigniew.kempczynski@intel.com> (raw)
In-Reply-To: <20240507075836.259581-1-zbigniew.kempczynski@intel.com>
Add function which is similar to already existing blt supports_tiling()
but returns tiling/compression capabilities of render engine.
Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
Reviewed-by: Karolina Stolarek <karolina.stolarek@intel.com>
---
lib/intel_blt.c | 29 +++++++++++++++++++++++++++++
lib/intel_blt.h | 1 +
2 files changed, 30 insertions(+)
diff --git a/lib/intel_blt.c b/lib/intel_blt.c
index 946adc538b..a8433387d2 100644
--- a/lib/intel_blt.c
+++ b/lib/intel_blt.c
@@ -495,6 +495,35 @@ bool blt_uses_extended_block_copy(int fd)
return blt_cmd_has_property(cmds_info, XY_BLOCK_COPY, BLT_CMD_EXTENDED);
}
+/**
+ * render_supports_tiling
+ * @fd: drm fd
+ * @tiling: tiling format
+ * @compression: check tiling which will be compressed
+ *
+ * Check if render provided by @fd device supports @tiling format wrt
+ * @compression
+ *
+ * Returns:
+ * true if it does, false otherwise.
+ */
+bool render_supports_tiling(int fd, enum blt_tiling_type tiling, bool compression)
+{
+ const struct intel_cmds_info *cmds_info = GET_CMDS_INFO(fd);
+
+ igt_assert(cmds_info);
+
+ if (!cmds_info->render_tilings) {
+ igt_warn("Render tilings are not defined\n");
+ return false;
+ }
+
+ if (!compression)
+ return cmds_info->render_tilings->supported_tiling & BIT(tiling);
+
+ return cmds_info->render_tilings->supported_compressed_tiling & BIT(tiling);
+}
+
/**
* blt_tiling_name:
* @tiling: tiling id
diff --git a/lib/intel_blt.h b/lib/intel_blt.h
index 6daf46aea4..edf75c0887 100644
--- a/lib/intel_blt.h
+++ b/lib/intel_blt.h
@@ -211,6 +211,7 @@ bool blt_xy_src_copy_supports_tiling(int fd, enum blt_tiling_type tiling);
bool blt_block_copy_supports_compression(int fd);
bool blt_platform_has_flat_ccs_enabled(int fd);
bool blt_uses_extended_block_copy(int fd);
+bool render_supports_tiling(int fd, enum blt_tiling_type tiling, bool compression);
const char *blt_tiling_name(enum blt_tiling_type tiling);
int blt_tile_to_i915_tile(enum blt_tiling_type tiling);
--
2.34.1
next prev parent reply other threads:[~2024-05-07 7:59 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-07 7:58 [PATCH i-g-t v3 00/11] Add render-copy compression on Xe+ Zbigniew Kempczyński
2024-05-07 7:58 ` [PATCH i-g-t v3 01/11] lib/intel_bufops: Store devid on buffer ops creation Zbigniew Kempczyński
2024-05-07 14:05 ` Juha-Pekka Heikkila
2024-05-07 7:58 ` [PATCH i-g-t v3 02/11] lib/intel_blt: Rename confusing fb tile to i915 tile Zbigniew Kempczyński
2024-05-07 7:58 ` [PATCH i-g-t v3 03/11] lib/intel_blt: Add i915 -> blt tile helper converter Zbigniew Kempczyński
2024-05-07 7:58 ` [PATCH i-g-t v3 04/11] lib/intel_bufops: Restrict tilings on non-flatccs platforms Zbigniew Kempczyński
2024-05-07 14:07 ` Juha-Pekka Heikkila
2024-05-07 7:58 ` [PATCH i-g-t v3 05/11] lib/intel_bufops: Start supporting compression on Xe2+ Zbigniew Kempczyński
2024-05-07 7:58 ` [PATCH i-g-t v3 06/11] lib/rendercopy_gen9: Allow to use all tilings on flatccs platforms Zbigniew Kempczyński
2024-05-07 12:59 ` Juha-Pekka Heikkila
2024-05-08 5:59 ` Zbigniew Kempczyński
2024-05-07 7:58 ` [PATCH i-g-t v3 07/11] lib/intel_cmds_info: Define tiling macros Zbigniew Kempczyński
2024-05-07 14:27 ` Juha-Pekka Heikkila
2024-05-08 7:13 ` Zbigniew Kempczyński
2024-05-08 11:53 ` Juha-Pekka Heikkila
2024-05-07 7:58 ` [PATCH i-g-t v3 08/11] lib/intel_cmds_info: Introduce render tilings Zbigniew Kempczyński
2024-05-07 7:58 ` Zbigniew Kempczyński [this message]
2024-05-07 7:58 ` [PATCH i-g-t v3 10/11] tests/xe_render_copy: Add subtest which exercises compression Zbigniew Kempczyński
2024-05-07 7:58 ` [PATCH i-g-t v3 11/11] tests/xe_intel_bb: Use supported tilings instead hardcoded ones Zbigniew Kempczyński
2024-05-07 9:25 ` ✓ Fi.CI.BAT: success for Add render-copy compression on Xe+ (rev3) Patchwork
2024-05-07 13:07 ` ✗ 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=20240507075836.259581-10-zbigniew.kempczynski@intel.com \
--to=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