From: "Zbigniew Kempczyński" <zbigniew.kempczynski@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: "Zbigniew Kempczyński" <zbigniew.kempczynski@intel.com>,
"Karolina Stolarek" <karolina.stolarek@intel.com>,
"Akshata Jahagirdar" <akshata.jahagirdar@intel.com>
Subject: [PATCH i-g-t v2 2/2] tests/gem|xe_ccs: Check surface ccs data instead of naive comparison
Date: Wed, 10 Apr 2024 12:09:15 +0200 [thread overview]
Message-ID: <20240410100915.48541-3-zbigniew.kempczynski@intel.com> (raw)
In-Reply-To: <20240410100915.48541-1-zbigniew.kempczynski@intel.com>
Start using function which extracts ccs data from the surface and
determines its compression.
Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
Cc: Karolina Stolarek <karolina.stolarek@intel.com>
Cc: Akshata Jahagirdar <akshata.jahagirdar@intel.com>
---
v2: rephrase comment (Karolina)
---
tests/intel/gem_ccs.c | 16 +++++++++++++---
tests/intel/xe_ccs.c | 14 ++++++--------
2 files changed, 19 insertions(+), 11 deletions(-)
diff --git a/tests/intel/gem_ccs.c b/tests/intel/gem_ccs.c
index e4126bcaa8..a8e7e8a747 100644
--- a/tests/intel/gem_ccs.c
+++ b/tests/intel/gem_ccs.c
@@ -305,6 +305,10 @@ static int blt_block_copy3(int i915,
return ret;
}
+#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 i915,
const intel_ctx_t *ctx,
const struct intel_execution_engine2 *e,
@@ -359,9 +363,15 @@ static void block_copy(int i915,
blt_block_copy(i915, ctx, e, ahnd, &blt, pext);
gem_sync(i915, mid->handle);
- /* We expect mid != src if there's compression */
- if (mid->compression)
- igt_assert(memcmp(src->ptr, mid->ptr, src->size) != 0);
+ /*
+ * If there's a compression we expect ctrl surface is not fully zeroed.
+ * Gradient image used as the reference may be not compressible for
+ * smaller sizes. Let's use some 'safe' size we're sure compression
+ * occurs and ctrl surface will be filled with some not-zeroed values.
+ */
+ if (mid->compression && FROM_EXP_WH(width, height))
+ igt_assert(blt_surface_is_compressed(i915, (intel_ctx_t *)ctx, e,
+ ahnd, mid));
WRITE_PNG(i915, run_id, "mid", &blt.dst, width, height, bpp);
diff --git a/tests/intel/xe_ccs.c b/tests/intel/xe_ccs.c
index 7d0f2f2a11..b3bf97af7e 100644
--- a/tests/intel/xe_ccs.c
+++ b/tests/intel/xe_ccs.c
@@ -359,15 +359,13 @@ static void block_copy(int xe,
intel_ctx_xe_sync(ctx, true);
/*
- * 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 there's a compression we expect ctrl surface is not fully zeroed.
+ * Gradient image used as the reference may be not compressible for
+ * smaller sizes. Let's use some 'safe' size we're sure compression
+ * occurs and ctrl surface will be filled with some not-zeroed values.
*/
- 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);
- }
+ if (mid->compression && FROM_EXP_WH(width, height))
+ igt_assert(blt_surface_is_compressed(xe, ctx, NULL, ahnd, mid));
WRITE_PNG(xe, run_id, "mid", &blt.dst, width, height, bpp);
--
2.34.1
next prev parent reply other threads:[~2024-04-10 10:09 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-10 10:09 [PATCH i-g-t v2 0/2] Add surface flat ccs check Zbigniew Kempczyński
2024-04-10 10:09 ` [PATCH i-g-t v2 1/2] lib/intel_blt: Add functions which extract and check object ccs data Zbigniew Kempczyński
2024-04-10 10:51 ` Karolina Stolarek
2024-04-10 14:36 ` Jahagirdar, Akshata
2024-04-10 10:09 ` Zbigniew Kempczyński [this message]
2024-04-10 14:36 ` [PATCH i-g-t v2 2/2] tests/gem|xe_ccs: Check surface ccs data instead of naive comparison Jahagirdar, Akshata
2024-04-10 23:24 ` ✓ CI.xeBAT: success for Add surface flat ccs check (rev2) Patchwork
2024-04-10 23:35 ` ✗ Fi.CI.BAT: failure " Patchwork
2024-04-11 6:20 ` ✓ CI.xeBAT: success for Add surface flat ccs check (rev3) Patchwork
2024-04-11 6:25 ` ✓ Fi.CI.BAT: " Patchwork
2024-04-11 9:41 ` ✗ CI.xeFULL: failure for Add surface flat ccs check (rev2) Patchwork
2024-04-11 15:12 ` ✗ Fi.CI.IGT: failure for Add surface flat ccs check (rev3) Patchwork
2024-04-11 15:25 ` Zbigniew Kempczyński
2024-04-11 15:32 ` ✗ 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=20240410100915.48541-3-zbigniew.kempczynski@intel.com \
--to=zbigniew.kempczynski@intel.com \
--cc=akshata.jahagirdar@intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=karolina.stolarek@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