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 4/6] tests/gem_gpgpu_fill: Add command line switch to dump the surface
Date: Thu, 21 Nov 2024 15:07:53 +0000 [thread overview]
Message-ID: <44482bb81bd6844d82a35fc3f40a41331b336d7b.camel@intel.com> (raw)
In-Reply-To: <20241121123308.98158-5-zbigniew.kempczynski@intel.com>
On Thu, 2024-11-21 at 13:33 +0100, Zbigniew Kempczyński wrote:
> When implementation for new platform is added and shader + pipeline
> needs to be adopted there's useful to dump the surface data.
>
> 0xC4 pattern makes distinction from 0x4C written by the shader very
> hard so change it to 0x88 makes dump more clear.
>
> Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
> Cc: Dominik Grzegorzek <dominik.grzegorzek@intel.com>
Same as patch for xe_gpgpu_fill, it is:
Reviewed-by: Dominik Grzegorzek <dominik.grzegorzek@intel.com>
> ---
> tests/intel/gem_gpgpu_fill.c | 43 +++++++++++++++++++++++++++++++-----
> 1 file changed, 38 insertions(+), 5 deletions(-)
>
> diff --git a/tests/intel/gem_gpgpu_fill.c b/tests/intel/gem_gpgpu_fill.c
> index aa735e5395..36c60e75f0 100644
> --- a/tests/intel/gem_gpgpu_fill.c
> +++ b/tests/intel/gem_gpgpu_fill.c
> @@ -64,9 +64,11 @@
> #define HEIGHT 64
> #define STRIDE (WIDTH)
> #define SIZE (HEIGHT*STRIDE)
> -#define COLOR_C4 0xc4
> +#define COLOR_88 0x88
> #define COLOR_4C 0x4c
>
> +static bool dump_surface;
> +
> typedef struct {
> int drm_fd;
> uint32_t devid;
> @@ -117,27 +119,58 @@ static void gpgpu_fill(data_t *data, igt_fillfunc_t fill, uint32_t region)
> uint8_t *ptr;
> int i, j;
>
> - buf = create_buf(data, WIDTH, HEIGHT, COLOR_C4, region);
> + buf = create_buf(data, WIDTH, HEIGHT, COLOR_88, 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_C4);
> + buf_check(ptr, 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++) {
> + igt_info("[%04x] ", j);
> + for (i = 0; i < WIDTH; i++) {
> + igt_info("%02x", ptr[j * HEIGHT + i]);
> + if (i % 4 == 3)
> + igt_info(" ");
> + }
> + igt_info("\n");
> + }
> + }
> +
> 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);
> else
> - buf_check(ptr, i, j, COLOR_C4);
> + buf_check(ptr, i, j, COLOR_88);
>
> munmap(ptr, buf->surface[0].size);
> }
>
> -igt_main
> +static int opt_handler(int opt, int opt_index, void *data)
> +{
> + switch (opt) {
> + case 'd':
> + dump_surface = true;
> + break;
> + default:
> + return IGT_OPT_HANDLER_ERROR;
> + }
> +
> + return IGT_OPT_HANDLER_SUCCESS;
> +}
> +
> +
> +const char *help_str =
> + " -d\tDump surface\n"
> + ;
> +
> +
> +igt_main_args("d", NULL, help_str, opt_handler, NULL)
> {
> data_t data = {0, };
> igt_fillfunc_t fill_fn = NULL;
next prev parent reply other threads:[~2024-11-21 15:08 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 [this message]
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
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=44482bb81bd6844d82a35fc3f40a41331b336d7b.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