Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Karolina Stolarek <karolina.stolarek@intel.com>
To: "Zbigniew Kempczyński" <zbigniew.kempczynski@intel.com>,
	igt-dev@lists.freedesktop.org
Cc: Karolina Drobnik <karolina.drobnik@intel.com>
Subject: Re: [PATCH i-g-t v4 5/5] tests/xe_exercise_blt: Exercise small to large fast-copy blits
Date: Thu, 1 Feb 2024 15:18:02 +0100	[thread overview]
Message-ID: <d4c9ad75-66b1-4959-a4f5-120ae7524453@intel.com> (raw)
In-Reply-To: <20240201100724.257845-6-zbigniew.kempczynski@intel.com>


On 1.02.2024 11:07, Zbigniew Kempczyński wrote:
> Testing blitter with large size like 512x512 may be not enough
> to verify small or unaligned blits works properly. Add subtest
> which spread fast-copy blits from small to large.
> 
> Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
> Cc: Karolina Drobnik <karolina.drobnik@intel.com>
> ---
>   tests/intel/xe_exercise_blt.c | 63 +++++++++++++++++++++++++++++------
>   1 file changed, 52 insertions(+), 11 deletions(-)
> 
> diff --git a/tests/intel/xe_exercise_blt.c b/tests/intel/xe_exercise_blt.c
> index ddf9d188a7..8b4bae282b 100644
> --- a/tests/intel/xe_exercise_blt.c
> +++ b/tests/intel/xe_exercise_blt.c
> @@ -25,6 +25,10 @@
>    *   Check fast-copy blit
>    *   blitter
>    *
> + * SUBTEST: fast-copy-inc-dimension
> + * Description:
> + *   Check fast-copy blit with sizes from small to large
> + *
>    * SUBTEST: fast-copy-emit
>    * Description:
>    *   Check multiple fast-copy in one batch
> @@ -40,6 +44,8 @@ static struct param {
>   	bool print_surface_info;
>   	int width;
>   	int height;
> +	int width_increment;
> +	int width_steps;
>   } param = {
>   	.tiling = -1,
>   	.write_png = false,
> @@ -111,6 +117,7 @@ static int fast_copy_one_bb(int xe,
>   }
>   
>   static void fast_copy_emit(int xe, const intel_ctx_t *ctx,
> +			   uint32_t width, uint32_t height,
>   			   uint32_t region1, uint32_t region2,
>   			   enum blt_tiling_type mid_tiling)
>   {
> @@ -122,7 +129,7 @@ static void fast_copy_emit(int xe, const intel_ctx_t *ctx,
>   	uint64_t ahnd = intel_allocator_open_full(xe, ctx->vm, 0, 0,
>   						  INTEL_ALLOCATOR_SIMPLE,
>   						  ALLOC_STRATEGY_LOW_TO_HIGH, 0);
> -	uint32_t bb, width = param.width, height = param.height;
> +	uint32_t bb;
>   	int result;
>   
>   	bb = xe_bo_create(xe, 0, bb_size, region1, 0);
> @@ -170,6 +177,7 @@ static void fast_copy_emit(int xe, const intel_ctx_t *ctx,
>   }
>   
>   static void fast_copy(int xe, const intel_ctx_t *ctx,
> +		      uint32_t width, uint32_t height,
>   		      uint32_t region1, uint32_t region2,
>   		      enum blt_tiling_type mid_tiling)
>   {
> @@ -181,7 +189,6 @@ static void fast_copy(int xe, const intel_ctx_t *ctx,
>   						  INTEL_ALLOCATOR_SIMPLE,
>   						  ALLOC_STRATEGY_LOW_TO_HIGH, 0);
>   	uint32_t bb;
> -	uint32_t width = param.width, height = param.height;
>   	int result;
>   
>   	bb = xe_bo_create(xe, 0, bb_size, region1, 0);
> @@ -241,14 +248,20 @@ enum fast_copy_func {
>   };
>   
>   static char
> -	*full_subtest_str(char *regtxt, enum blt_tiling_type tiling,
> +	*full_subtest_str(char *regtxt, uint32_t width, uint32_t height,
> +			  enum blt_tiling_type tiling,
>   			  enum fast_copy_func func)
>   {
>   	char *name;
>   	uint32_t len;
>   
> -	len = asprintf(&name, "%s-%s%s", blt_tiling_name(tiling), regtxt,
> -		       func == FAST_COPY_EMIT ? "-emit" : "");
> +	if (!width || !height)
> +		len = asprintf(&name, "%s-%s%s", blt_tiling_name(tiling), regtxt,
> +			       func == FAST_COPY_EMIT ? "-emit" : "");
> +	else
> +		len = asprintf(&name, "%s-%s%s-%ux%u", blt_tiling_name(tiling), regtxt,
> +			       func == FAST_COPY_EMIT ? "-emit" : "",
> +			       width, height);
>   
>   	igt_assert_f(len >= 0, "asprintf failed!\n");
>   
> @@ -264,6 +277,7 @@ static void fast_copy_test(int xe,
>   	};
>   	struct igt_collection *regions;
>   	void (*copy_func)(int xe, const intel_ctx_t *ctx,
> +			  uint32_t width, uint32_t height,
>   			  uint32_t r1, uint32_t r2, enum blt_tiling_type tiling);
>   	intel_ctx_t *ctx;
>   	int tiling;
> @@ -286,16 +300,32 @@ static void fast_copy_test(int xe,
>   
>   			copy_func = (func == FAST_COPY) ? fast_copy : fast_copy_emit;
>   			regtxt = xe_memregion_dynamic_subtest_name(xe, regions);
> -			test_name = full_subtest_str(regtxt, tiling, func);
>   
> -			igt_dynamic_f("%s", test_name) {
> -				copy_func(xe, ctx,
> -					  region1, region2,
> -					  tiling);
> +			if (!param.width_increment) {
> +				test_name = full_subtest_str(regtxt, 0, 0, tiling, func);

I'd simply pass param.width and param.height here and use the common
name for both width_increment and fixed size test cases. We don't have
to keep the same "%s-%s%s" format, extending it would be fine (and
helpful, I think).

All the best,
Karolina

> +				igt_dynamic_f("%s", test_name) {
> +					copy_func(xe, ctx,
> +						  param.width, param.height,
> +						  region1, region2,
> +						  tiling);
> +				}
> +				free(test_name);
> +			} else {
> +				for (int w = param.width;
> +				     w < param.width + param.width_steps;
> +				     w += param.width_increment) {
> +					test_name = full_subtest_str(regtxt, w, w, tiling, func);
> +					igt_dynamic_f("%s", test_name) {
> +						copy_func(xe, ctx,
> +							  w, w,
> +							  region1, region2,
> +							  tiling);
> +					}
> +					free(test_name);
> +				}
>   			}
>   
>   			free(regtxt);
> -			free(test_name);
>   			xe_exec_queue_destroy(xe, exec_queue);
>   			xe_vm_destroy(xe, vm);
>   			free(ctx);
> @@ -367,6 +397,17 @@ igt_main_args("b:pst:W:H:", NULL, help_str, opt_handler, NULL)
>   		fast_copy_test(xe, set, FAST_COPY);
>   	}
>   
> +	igt_describe("Check fast-copy with increment width/height");
> +	igt_subtest_with_dynamic("fast-copy-inc-dimension") {
> +		param.width = 1;
> +		param.height = 1;
> +		param.width_increment = 15;
> +		param.width_steps = 512;
> +
> +		fast_copy_test(xe, set, FAST_COPY);
> +	}
> +
> +
>   	igt_describe("Check multiple fast-copy in one batch");
>   	igt_subtest_with_dynamic("fast-copy-emit") {
>   		fast_copy_test(xe, set, FAST_COPY_EMIT);

  reply	other threads:[~2024-02-01 14:18 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 ` [PATCH i-g-t v4 4/5] tests/xe-ccs: Add tests which exercise small to large blit sizes Zbigniew Kempczyński
2024-02-01 14:09   ` 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 [this message]
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=d4c9ad75-66b1-4959-a4f5-120ae7524453@intel.com \
    --to=karolina.stolarek@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=karolina.drobnik@intel.com \
    --cc=zbigniew.kempczynski@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