Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
To: "Zbigniew Kempczyński" <zbigniew.kempczynski@intel.com>,
	igt-dev@lists.freedesktop.org
Subject: Re: [PATCH i-g-t v2] tests/api_intel_bb: Fix render-ccs subtest hang on DG2
Date: Wed, 19 Jun 2024 14:32:07 +0300	[thread overview]
Message-ID: <95ecfbd3-a8fc-4937-92c5-5369e7ad5302@gmail.com> (raw)
In-Reply-To: <20240619051801.229442-1-zbigniew.kempczynski@intel.com>

Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>

On 19.6.2024 8.18, Zbigniew Kempczyński wrote:
> Avoid hang by use appropriate compression tiling (Tile4) on DG2.
> Compressed surfaces also need to reside in vram for discrete so
> adjust this placement either.
> 
> Closes: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/10380
> Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
> Cc: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
> ---
>   tests/intel/api_intel_bb.c | 40 ++++++++++++++++++++++++--------------
>   1 file changed, 25 insertions(+), 15 deletions(-)
> 
> diff --git a/tests/intel/api_intel_bb.c b/tests/intel/api_intel_bb.c
> index 4158fa06c8..6cb5d4f9e9 100644
> --- a/tests/intel/api_intel_bb.c
> +++ b/tests/intel/api_intel_bb.c
> @@ -849,10 +849,15 @@ static void scratch_buf_init(struct buf_ops *bops,
>   			     uint32_t req_tiling,
>   			     enum i915_compression compression)
>   {
> +	int fd = buf_ops_get_fd(bops);
>   	int bpp = 32;
> +	uint32_t region = REGION_SMEM;
>   
> -	intel_buf_init(bops, buf, width, height, bpp, 0,
> -		       req_tiling, compression);
> +	if (compression && gem_has_lmem(fd))
> +		region = REGION_LMEM(0);
> +
> +	intel_buf_init_in_region(bops, buf, width, height, bpp, 0,
> +				 req_tiling, compression, region);
>   
>   	igt_assert(intel_buf_width(buf) == width);
>   	igt_assert(intel_buf_height(buf) == height);
> @@ -1419,6 +1424,7 @@ static void render_ccs(struct buf_ops *bops)
>   	uint32_t compressed = 0;
>   	uint32_t devid = intel_get_drm_devid(i915);
>   	igt_render_copyfunc_t render_copy = NULL;
> +	int tiling = IS_DG2(devid) ? I915_TILING_4 : I915_TILING_Y;
>   
>   	ibb = intel_bb_create(i915, PAGE_SIZE);
>   	if (debug_bb)
> @@ -1426,9 +1432,9 @@ static void render_ccs(struct buf_ops *bops)
>   
>   	scratch_buf_init(bops, &src, width, height, I915_TILING_NONE,
>   			 I915_COMPRESSION_NONE);
> -	scratch_buf_init(bops, &dst, width, height, I915_TILING_Y,
> +	scratch_buf_init(bops, &dst, width, height, tiling,
>   			 I915_COMPRESSION_RENDER);
> -	scratch_buf_init(bops, &dst2, width, height, I915_TILING_Y,
> +	scratch_buf_init(bops, &dst2, width, height, tiling,
>   			 I915_COMPRESSION_RENDER);
>   	scratch_buf_init(bops, &final, width, height, I915_TILING_NONE,
>   			 I915_COMPRESSION_NONE);
> @@ -1459,21 +1465,25 @@ static void render_ccs(struct buf_ops *bops)
>   		    0, 0);
>   
>   	intel_bb_sync(ibb);
> -
> -	fails = compare_bufs(&src, &final, true);
> -	compressed = count_compressed(ibb->gen, &dst);
> -
>   	intel_bb_destroy(ibb);
>   
> -	igt_debug("fails: %u, compressed: %u\n", fails, compressed);
> +	fails = compare_bufs(&src, &final, true);
> +	if (!HAS_FLATCCS(devid)) {
> +		compressed = count_compressed(ibb->gen, &dst);
> +		igt_debug("fails: %u, compressed: %u\n", fails, compressed);
> +	} else {
> +		igt_debug("fails: %u\n", fails);
> +	}
>   
>   	if (write_png) {
> -		intel_buf_write_to_png(&src, "render-ccs-src.png");
> -		intel_buf_write_to_png(&dst, "render-ccs-dst.png");
> -		intel_buf_write_to_png(&dst2, "render-ccs-dst2.png");
> -		intel_buf_write_aux_to_png(&dst, "render-ccs-dst-aux.png");
> -		intel_buf_write_aux_to_png(&dst2, "render-ccs-dst2-aux.png");
> -		intel_buf_write_to_png(&final, "render-ccs-final.png");
> +		intel_buf_raw_write_to_png(&src, "render-ccs-src.png");
> +		intel_buf_raw_write_to_png(&dst, "render-ccs-dst.png");
> +		intel_buf_raw_write_to_png(&dst2, "render-ccs-dst2.png");
> +		intel_buf_raw_write_to_png(&final, "render-ccs-final.png");
> +		if (!HAS_FLATCCS(devid)) {
> +			intel_buf_write_aux_to_png(&dst, "render-ccs-dst-aux.png");
> +			intel_buf_write_aux_to_png(&dst2, "render-ccs-dst2-aux.png");
> +		}
>   	}
>   
>   	intel_buf_close(bops, &src);


  parent reply	other threads:[~2024-06-19 11:32 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-19  5:18 [PATCH i-g-t v2] tests/api_intel_bb: Fix render-ccs subtest hang on DG2 Zbigniew Kempczyński
2024-06-19  6:28 ` ✓ CI.xeBAT: success for tests/api_intel_bb: Fix render-ccs subtest hang on DG2 (rev2) Patchwork
2024-06-19  6:35 ` ✓ Fi.CI.BAT: " Patchwork
2024-06-19  8:35 ` ✗ Fi.CI.IGT: failure " Patchwork
2024-06-19 11:32 ` Juha-Pekka Heikkila [this message]
2024-06-19 14:35 ` ✗ CI.xeFULL: " 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=95ecfbd3-a8fc-4937-92c5-5369e7ad5302@gmail.com \
    --to=juhapekka.heikkila@gmail.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