Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Grzegorzek, Dominik" <dominik.grzegorzek@intel.com>
To: "Kempczynski, Zbigniew" <zbigniew.kempczynski@intel.com>,
	"igt-dev@lists.freedesktop.org" <igt-dev@lists.freedesktop.org>
Subject: Re: [PATCH i-g-t v4 5/6] tests/gem_gpgpu_fill: Add width/height/x/y command line args
Date: Thu, 21 Nov 2024 15:15:18 +0000	[thread overview]
Message-ID: <404baf919685f2984cfaed17772af4c3b5b2f1b1.camel@intel.com> (raw)
In-Reply-To: <20241121123308.98158-6-zbigniew.kempczynski@intel.com>

On Thu, 2024-11-21 at 13:33 +0100, Zbigniew Kempczyński wrote:
> I've noticed shaders/pipelines have limitation to work on 16B
> boundaries (due to SIMD16). So to play with different surface sizes
> and offsets add W/H/X/Y switches.
> 
> There's no problem at all not all sizes/offsets are supported as we
> would like to have, we use gpgpu fill to verify compute workload so
> if we won't notice gpu hang that's fine.

This sentence sounds a bit unclear to me. May I ask you to rephrase that
that paragraph in both xe and gem patches.

Anyway it is:
Reviewed-by: Dominik Grzegorzek <dominik.grzegorzek@intel.com>
> 
> Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
> Cc: Dominik Grzegorzek <dominik.grzegorzek@intel.com>
> ---
>  tests/intel/gem_gpgpu_fill.c | 62 ++++++++++++++++++++++++++----------
>  1 file changed, 46 insertions(+), 16 deletions(-)
> 
> diff --git a/tests/intel/gem_gpgpu_fill.c b/tests/intel/gem_gpgpu_fill.c
> index 36c60e75f0..ec34e95844 100644
> --- a/tests/intel/gem_gpgpu_fill.c
> +++ b/tests/intel/gem_gpgpu_fill.c
> @@ -68,6 +68,10 @@
>  #define COLOR_4C	0x4c
>  
>  static bool dump_surface;
> +static uint32_t surfwidth = WIDTH;
> +static uint32_t surfheight = HEIGHT;
> +static uint32_t start_x;
> +static uint32_t start_y;
>  
>  typedef struct {
>  	int drm_fd;
> @@ -103,17 +107,20 @@ create_buf(data_t *data, int width, int height, uint8_t color, uint32_t region)
>  	return buf;
>  }
>  
> -static void buf_check(uint8_t *ptr, int x, int y, uint8_t color)
> +static void buf_check(uint8_t *ptr, int width, int x, int y, uint8_t color)
>  {
>  	uint8_t val;
>  
> -	val = ptr[y * WIDTH + x];
> +	val = ptr[y * width + x];
>  	igt_assert_f(val == color,
>  		     "Expected 0x%02x, found 0x%02x at (%d,%d)\n",
>  		     color, val, x, y);
>  }
>  
> -static void gpgpu_fill(data_t *data, igt_fillfunc_t fill, uint32_t region)
> +static void gpgpu_fill(data_t *data, igt_fillfunc_t fill, uint32_t region,
> +		       uint32_t surf_width, uint32_t surf_height,
> +		       uint32_t x, uint32_t y,
> +		       uint32_t width, uint32_t height)
>  {
>  	struct intel_buf *buf;
>  	uint8_t *ptr;
> @@ -123,17 +130,17 @@ static void gpgpu_fill(data_t *data, igt_fillfunc_t fill, uint32_t region)
>  	ptr = gem_mmap__device_coherent(data->drm_fd, buf->handle, 0,
>  					buf->surface[0].size, PROT_READ);
>  
> -	for (i = 0; i < WIDTH; i++)
> -		for (j = 0; j < HEIGHT; j++)
> -			buf_check(ptr, i, j, COLOR_88);
> +	for (i = 0; i < surf_width; i++)
> +		for (j = 0; j < surf_height; j++)
> +			buf_check(ptr, surf_width, i, j, COLOR_88);
>  
>  	fill(data->drm_fd, buf, 0, 0, WIDTH / 2, HEIGHT / 2, COLOR_4C);
>  
>  	if (dump_surface) {
> -		for (j = 0; j < HEIGHT; j++) {
> +		for (j = 0; j < surf_height; j++) {
>  			igt_info("[%04x] ", j);
> -			for (i = 0; i < WIDTH; i++) {
> -				igt_info("%02x", ptr[j * HEIGHT + i]);
> +			for (i = 0; i < surf_width; i++) {
> +				igt_info("%02x", ptr[j * surf_height + i]);
>  				if (i % 4 == 3)
>  					igt_info(" ");
>  			}
> @@ -141,12 +148,13 @@ static void gpgpu_fill(data_t *data, igt_fillfunc_t fill, uint32_t region)
>  		}
>  	}
>  
> -	for (i = 0; i < WIDTH; i++)
> -		for (j = 0; j < HEIGHT; j++)
> -			if (i < WIDTH / 2 && j < HEIGHT / 2)
> -				buf_check(ptr, i, j, COLOR_4C);
> +	for (i = 0; i < surf_width; i++)
> +		for (j = 0; j < surf_height; j++)
> +			if (i >= x && i < width + x &&
> +			    j >= y && j < height + y)
> +				buf_check(ptr, surf_width, i, j, COLOR_4C);
>  			else
> -				buf_check(ptr, i, j, COLOR_88);
> +				buf_check(ptr, surf_height, i, j, COLOR_88);
>  
>  	munmap(ptr, buf->surface[0].size);
>  }
> @@ -157,6 +165,18 @@ static int opt_handler(int opt, int opt_index, void *data)
>  	case 'd':
>  		dump_surface = true;
>  		break;
> +	case 'W':
> +		surfwidth = atoi(optarg);
> +		break;
> +	case 'H':
> +		surfheight = atoi(optarg);
> +		break;
> +	case 'X':
> +		start_x = atoi(optarg);
> +		break;
> +	case 'Y':
> +		start_y = atoi(optarg);
> +		break;
>  	default:
>  		return IGT_OPT_HANDLER_ERROR;
>  	}
> @@ -167,10 +187,14 @@ static int opt_handler(int opt, int opt_index, void *data)
>  
>  const char *help_str =
>  	"  -d\tDump surface\n"
> +	"  -W\tWidth (default 64)\n"
> +	"  -H\tHeight (default 64)\n"
> +	"  -X\tX start (aligned to 4)\n"
> +	"  -Y\tY start (aligned to 1)\n"
>  	;
>  
>  
> -igt_main_args("d", NULL, help_str, opt_handler, NULL)
> +igt_main_args("dW:H:X:Y:", NULL, help_str, opt_handler, NULL)
>  {
>  	data_t data = {0, };
>  	igt_fillfunc_t fill_fn = NULL;
> @@ -193,6 +217,8 @@ igt_main_args("d", NULL, help_str, opt_handler, NULL)
>  		region_set = get_memory_region_set(region_info,
>  						   I915_SYSTEM_MEMORY,
>  						   I915_DEVICE_MEMORY);
> +
> +		start_x = ALIGN(start_x, 16);
>  	}
>  
>  	igt_subtest_with_dynamic("basic") {
> @@ -203,7 +229,11 @@ igt_main_args("d", NULL, help_str, opt_handler, NULL)
>  			uint32_t id = igt_collection_get_value(region, 0);
>  
>  			igt_dynamic(name)
> -				gpgpu_fill(&data, fill_fn, id);
> +				gpgpu_fill(&data, fill_fn, id,
> +					   surfwidth, surfheight,
> +					   start_x, start_y,
> +					   surfwidth / 2,
> +					   surfheight / 2);
>  
>  			free(name);
>  		}


  reply	other threads:[~2024-11-21 15:15 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-21 12:33 [PATCH i-g-t v4 0/6] GPGPU fill improvements Zbigniew Kempczyński
2024-11-21 12:33 ` [PATCH i-g-t v4 1/6] tests/xe_gpgpu_fill: Add command line switch to dump the surface Zbigniew Kempczyński
2024-11-21 12:33 ` [PATCH i-g-t v4 2/6] tests/xe_gpgpu_fill: Add width/height/x/y command line args Zbigniew Kempczyński
2024-11-21 12:33 ` [PATCH i-g-t v4 3/6] tests/xe_gpgpu_fill: Add offset-16x16 subtest Zbigniew Kempczyński
2024-11-21 12:33 ` [PATCH i-g-t v4 4/6] tests/gem_gpgpu_fill: Add command line switch to dump the surface Zbigniew Kempczyński
2024-11-21 15:07   ` Grzegorzek, Dominik
2024-11-21 12:33 ` [PATCH i-g-t v4 5/6] tests/gem_gpgpu_fill: Add width/height/x/y command line args Zbigniew Kempczyński
2024-11-21 15:15   ` Grzegorzek, Dominik [this message]
2024-11-22  7:09     ` Zbigniew Kempczyński
2024-11-21 12:33 ` [PATCH i-g-t v4 6/6] tests/gem_gpgpu_fill: Add offset-16x16 subtest Zbigniew Kempczyński
2024-11-21 15:28   ` Grzegorzek, Dominik
2024-11-22  7:12     ` Zbigniew Kempczyński
2024-11-21 15:49 ` ✓ Xe.CI.BAT: success for GPGPU fill improvements (rev4) Patchwork
2024-11-21 16:05 ` ✗ i915.CI.BAT: failure " Patchwork
2024-11-21 21:19 ` ✓ Xe.CI.BAT: success for GPGPU fill improvements (rev5) Patchwork
2024-11-21 21:33 ` ✗ i915.CI.BAT: failure " Patchwork
2024-11-22  7:06   ` Zbigniew Kempczyński
2024-11-21 23:25 ` ✗ Xe.CI.Full: failure for GPGPU fill improvements (rev4) Patchwork
2024-11-22  9:12 ` ✗ Xe.CI.Full: failure for GPGPU fill improvements (rev5) 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=404baf919685f2984cfaed17772af4c3b5b2f1b1.camel@intel.com \
    --to=dominik.grzegorzek@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --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