From: "Zbigniew Kempczyński" <zbigniew.kempczynski@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: Karolina Drobnik <karolina.drobnik@intel.com>
Subject: [PATCH i-g-t v4 4/5] tests/xe-ccs: Add tests which exercise small to large blit sizes
Date: Thu, 1 Feb 2024 11:07:23 +0100 [thread overview]
Message-ID: <20240201100724.257845-5-zbigniew.kempczynski@intel.com> (raw)
In-Reply-To: <20240201100724.257845-1-zbigniew.kempczynski@intel.com>
Testing block-copy for 512 x 512 x 32bpp is not enough to verify
blit is working for different (small) and not always aligned
resolutions. Add 'increment' subtests which checks blits from
small (1x1) to large (512x512) resolutions.
To avoid too long execution resolution increment equals 15x15 pixels.
Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
Cc: Karolina Drobnik <karolina.drobnik@intel.com>
---
tests/intel/xe_ccs.c | 144 +++++++++++++++++++++++++++++++++----------
1 file changed, 112 insertions(+), 32 deletions(-)
diff --git a/tests/intel/xe_ccs.c b/tests/intel/xe_ccs.c
index a7785edcb1..627976049c 100644
--- a/tests/intel/xe_ccs.c
+++ b/tests/intel/xe_ccs.c
@@ -28,9 +28,15 @@
* SUBTEST: block-copy-compressed
* Description: Check block-copy flatccs compressed blit
*
+ * SUBTEST: block-copy-compressed-inc-dimension
+ * Description: Check block-copy compressed blit for different sizes
+ *
* SUBTEST: block-copy-uncompressed
* Description: Check block-copy uncompressed blit
*
+ * SUBTEST: block-copy-uncompressed-inc-dimension
+ * Description: Check block-copy uncompressed blit for different sizes
+ *
* SUBTEST: block-multicopy-compressed
* Description: Check block-multicopy flatccs compressed blit
*
@@ -73,6 +79,8 @@ struct test_config {
bool surfcopy;
bool new_ctx;
bool suspend_resume;
+ int width_increment;
+ int width_steps;
};
#define PRINT_SURFACE_INFO(name, obj) do { \
@@ -286,9 +294,17 @@ static int blt_block_copy3(int xe,
return ret;
}
+#define CHECK_MIN_WIDTH 2
+#define CHECK_MIN_HEIGHT 2
+#define MIN_EXP_WH(w, h) ((w) >= CHECK_MIN_WIDTH && (h) >= CHECK_MIN_HEIGHT)
+#define CHECK_FROM_WIDTH 256
+#define CHECK_FROM_HEIGHT 256
+#define FROM_EXP_WH(w, h) ((w) >= CHECK_FROM_WIDTH && (h) >= CHECK_FROM_HEIGHT)
+
static void block_copy(int xe,
intel_ctx_t *ctx,
uint32_t region1, uint32_t region2,
+ uint32_t width, uint32_t height,
enum blt_tiling_type mid_tiling,
const struct test_config *config)
{
@@ -301,7 +317,7 @@ static void block_copy(int xe,
uint32_t run_id = mid_tiling;
uint32_t mid_region = (AT_LEAST_GEN(intel_get_drm_devid(xe), 20) &
!xe_has_vram(xe)) ? region1 : region2;
- uint32_t width = param.width, height = param.height, bb;
+ uint32_t bb;
enum blt_compression mid_compression = config->compression;
int mid_compression_format = param.compression_format;
enum blt_compression_type comp_type = COMPRESSION_TYPE_3D;
@@ -339,9 +355,16 @@ static void block_copy(int xe,
blt_block_copy(xe, ctx, NULL, ahnd, &blt, pext);
intel_ctx_xe_sync(ctx, true);
- /* We expect mid != src if there's compression */
- if (mid->compression)
- igt_assert(memcmp(src->ptr, mid->ptr, src->size) != 0);
+ /*
+ * We expect mid != src if there's compression. Ignore this for small
+ * width x height for linear as compression for gradient occurs in the
+ * middle for bigger sizes. We also ignore 1x1 as this looks same for
+ * xmajor.
+ */
+ if (mid->compression && MIN_EXP_WH(width, height)) {
+ if (mid_tiling != T_LINEAR || FROM_EXP_WH(width, height))
+ igt_assert(memcmp(src->ptr, mid->ptr, src->size) != 0);
+ }
WRITE_PNG(xe, run_id, "mid", &blt.dst, width, height, bpp);
@@ -416,6 +439,7 @@ static void block_copy(int xe,
static void block_multicopy(int xe,
intel_ctx_t *ctx,
uint32_t region1, uint32_t region2,
+ uint32_t width, uint32_t height,
enum blt_tiling_type mid_tiling,
const struct test_config *config)
{
@@ -429,7 +453,7 @@ static void block_multicopy(int xe,
uint32_t run_id = mid_tiling;
uint32_t mid_region = (AT_LEAST_GEN(intel_get_drm_devid(xe), 20) &
!xe_has_vram(xe)) ? region1 : region2;
- uint32_t width = param.width, height = param.height, bb;
+ uint32_t bb;
enum blt_compression mid_compression = config->compression;
int mid_compression_format = param.compression_format;
enum blt_compression_type comp_type = COMPRESSION_TYPE_3D;
@@ -521,6 +545,7 @@ static const struct {
void (*copyfn)(int fd,
intel_ctx_t *ctx,
uint32_t region1, uint32_t region2,
+ uint32_t width, uint32_t height,
enum blt_tiling_type btype,
const struct test_config *config);
} copyfns[] = {
@@ -528,17 +553,44 @@ static const struct {
[BLOCK_MULTICOPY] = { "-multicopy", block_multicopy },
};
-static void block_copy_test(int xe,
- const struct test_config *config,
- struct igt_collection *set,
- enum copy_func copy_function)
+static void single_copy(int xe, const struct test_config *config,
+ int32_t region1, uint32_t region2,
+ uint32_t width, uint32_t height,
+ int tiling, enum copy_func copy_function)
{
struct drm_xe_engine_class_instance inst = {
.engine_class = DRM_XE_ENGINE_CLASS_COPY,
};
+ uint32_t vm, exec_queue;
+ uint32_t sync_bind, sync_out;
intel_ctx_t *ctx;
+
+ vm = xe_vm_create(xe, 0, 0);
+ exec_queue = xe_exec_queue_create(xe, vm, &inst, 0);
+ sync_bind = syncobj_create(xe, 0);
+ sync_out = syncobj_create(xe, 0);
+ ctx = intel_ctx_xe(xe, vm, exec_queue,
+ 0, sync_bind, sync_out);
+
+ copyfns[copy_function].copyfn(xe, ctx,
+ region1, region2,
+ width, height,
+ tiling, config);
+
+ xe_exec_queue_destroy(xe, exec_queue);
+ xe_vm_destroy(xe, vm);
+ syncobj_destroy(xe, sync_bind);
+ syncobj_destroy(xe, sync_out);
+ free(ctx);
+}
+
+static void block_copy_test(int xe,
+ const struct test_config *config,
+ struct igt_collection *set,
+ enum copy_func copy_function)
+{
+
struct igt_collection *regions;
- uint32_t vm, exec_queue;
int tiling;
if (config->compression && !blt_block_copy_supports_compression(xe))
@@ -555,6 +607,7 @@ static void block_copy_test(int xe,
for_each_variation_r(regions, 2, set) {
uint32_t region1, region2;
char *regtxt;
+ char testname[256];
region1 = igt_collection_get_value(regions, 0);
region2 = igt_collection_get_value(regions, 1);
@@ -566,30 +619,36 @@ static void block_copy_test(int xe,
regtxt = xe_memregion_dynamic_subtest_name(xe, regions);
- igt_dynamic_f("%s-%s-compfmt%d-%s%s",
- blt_tiling_name(tiling),
- config->compression ?
- "compressed" : "uncompressed",
- param.compression_format, regtxt,
- copyfns[copy_function].suffix) {
- uint32_t sync_bind, sync_out;
+ snprintf(testname, sizeof(testname),
+ "%s-%s-compfmt%d-%s%s",
+ blt_tiling_name(tiling),
+ config->compression ?
+ "compressed" : "uncompressed",
+ param.compression_format, regtxt,
+ copyfns[copy_function].suffix);
- vm = xe_vm_create(xe, 0, 0);
- exec_queue = xe_exec_queue_create(xe, vm, &inst, 0);
- sync_bind = syncobj_create(xe, 0);
- sync_out = syncobj_create(xe, 0);
- ctx = intel_ctx_xe(xe, vm, exec_queue,
- 0, sync_bind, sync_out);
+ if (!config->width_increment) {
+ igt_dynamic(testname)
+ single_copy(xe, config, region1, region2,
+ param.width, param.height,
+ tiling, copy_function);
+ } else {
+ for (int w = param.width;
+ w < param.width + config->width_steps;
+ w += config->width_increment) {
+ snprintf(testname, sizeof(testname),
+ "%s-%s-compfmt%d-%s%s-%dx%d",
+ blt_tiling_name(tiling),
+ config->compression ?
+ "compressed" : "uncompressed",
+ param.compression_format, regtxt,
+ copyfns[copy_function].suffix,
+ w, w);
+ igt_dynamic(testname)
+ single_copy(xe, config, region1, region2,
+ w, w, tiling, copy_function);
+ }
- copyfns[copy_function].copyfn(xe, ctx,
- region1, region2,
- tiling, config);
-
- xe_exec_queue_destroy(xe, exec_queue);
- xe_vm_destroy(xe, vm);
- syncobj_destroy(xe, sync_bind);
- syncobj_destroy(xe, sync_out);
- free(ctx);
}
free(regtxt);
@@ -669,6 +728,16 @@ igt_main_args("bf:pst:W:H:", NULL, help_str, opt_handler, NULL)
block_copy_test(xe, &config, set, BLOCK_COPY);
}
+ igt_describe("Check block-copy uncompressed blit with increment width/height");
+ igt_subtest_with_dynamic("block-copy-uncompressed-inc-dimension") {
+ struct test_config config = { .width_increment = 15,
+ .width_steps = 512 };
+ param.width = 1;
+ param.height = 1;
+
+ block_copy_test(xe, &config, set, BLOCK_COPY);
+ }
+
igt_describe("Check block-copy flatccs compressed blit");
igt_subtest_with_dynamic("block-copy-compressed") {
struct test_config config = { .compression = true };
@@ -676,6 +745,17 @@ igt_main_args("bf:pst:W:H:", NULL, help_str, opt_handler, NULL)
block_copy_test(xe, &config, set, BLOCK_COPY);
}
+ igt_describe("Check block-copy compressed blit with increment width/height");
+ igt_subtest_with_dynamic("block-copy-compressed-inc-dimension") {
+ struct test_config config = { .compression = true,
+ .width_increment = 15,
+ .width_steps = 512 };
+ param.width = 1;
+ param.height = 1;
+
+ block_copy_test(xe, &config, set, BLOCK_COPY);
+ }
+
igt_describe("Check block-multicopy flatccs compressed blit");
igt_subtest_with_dynamic("block-multicopy-compressed") {
struct test_config config = { .compression = true };
--
2.34.1
next prev parent reply other threads:[~2024-02-01 10:07 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-01 10:07 [PATCH i-g-t v4 0/5] Fill block-copy test gap for unaligned sizes Zbigniew Kempczyński
2024-02-01 10:07 ` [PATCH i-g-t v4 1/5] lib/intel_blt: Add helpers for calculating stride and aligned height Zbigniew Kempczyński
2024-02-01 12:05 ` Karolina Stolarek
2024-02-01 19:07 ` Zbigniew Kempczyński
2024-02-01 10:07 ` [PATCH i-g-t v4 2/5] lib/intel_blt: Change surface size calculation Zbigniew Kempczyński
2024-02-01 13:44 ` Karolina Stolarek
2024-02-01 19:27 ` Zbigniew Kempczyński
2024-02-01 10:07 ` [PATCH i-g-t v4 3/5] lib/intel_blt: Use object pitch and aligned height on png write Zbigniew Kempczyński
2024-02-01 13:51 ` Karolina Stolarek
2024-02-01 10:07 ` Zbigniew Kempczyński [this message]
2024-02-01 14:09 ` [PATCH i-g-t v4 4/5] tests/xe-ccs: Add tests which exercise small to large blit sizes Karolina Stolarek
2024-02-01 19:32 ` Zbigniew Kempczyński
2024-02-01 14:10 ` Karolina Stolarek
2024-02-01 19:54 ` Zbigniew Kempczyński
2024-02-01 10:07 ` [PATCH i-g-t v4 5/5] tests/xe_exercise_blt: Exercise small to large fast-copy blits Zbigniew Kempczyński
2024-02-01 14:18 ` Karolina Stolarek
2024-02-01 19:57 ` Zbigniew Kempczyński
2024-02-01 14:23 ` Karolina Stolarek
2024-02-01 19:58 ` Zbigniew Kempczyński
2024-02-01 11:43 ` ✓ CI.xeBAT: success for Fill block-copy test gap for unaligned sizes (rev4) 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=20240201100724.257845-5-zbigniew.kempczynski@intel.com \
--to=zbigniew.kempczynski@intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=karolina.drobnik@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