From: "Jahagirdar, Akshata" <akshata.jahagirdar@intel.com>
To: "Zbigniew Kempczyński" <zbigniew.kempczynski@intel.com>
Cc: <igt-dev@lists.freedesktop.org>
Subject: Re: [PATCH i-g-t v6 2/2] tests/xe_ccs: Update compression check based on flat-ccs enablement
Date: Mon, 22 Apr 2024 20:31:38 -0700 [thread overview]
Message-ID: <0b7e2820-4a1e-47a0-b182-cb0d4646420e@intel.com> (raw)
In-Reply-To: <20240422071337.4oodeuj4qi2ckmsr@zkempczy-mobl2>
On 4/22/2024 12:13 AM, Zbigniew Kempczyński wrote:
> On Fri, Apr 19, 2024 at 08:36:17PM -0700, Akshata Jahagirdar wrote:
>> In Xe2+ platforms,we need to run this test regardless of the status of flat-ccs.
>> Check if the platform supports compression and has flat ccs enabled, and if it
>> doesn't, then update the checks accordingly and proceed with the test.
>>
>> Additionally, On Xe2 dGPU, compression is only supported with VRAM. When copying
>> from VRAM -> sysmem the KMD uses mapping with uncompressed PAT so the copy
>> in system memory is guaranteed to be uncompressed. When restoring such buffers
>> from sysmem -> VRAM the KMD can't easily know which pages were originally
>> compressed, so we always use uncompressed -> uncompressed here. so this means
>> there's no need for extra CCS storage on such platforms.
>> Thats why we shouldn't need to run suspend-resume on xe2 dgpu.
>>
>> Signed-off-by: Akshata Jahagirdar <akshata.jahagirdar@intel.com>
>> Acked-by: Jonathan Cavitt <jonathan.cavitt@intel.com>
>> ---
>> tests/intel/xe_ccs.c | 40 +++++++++++++++++++++++++++++++++-------
>> 1 file changed, 33 insertions(+), 7 deletions(-)
>>
>> diff --git a/tests/intel/xe_ccs.c b/tests/intel/xe_ccs.c
>> index b3bf97af7..7b6cf231e 100644
>> --- a/tests/intel/xe_ccs.c
>> +++ b/tests/intel/xe_ccs.c
>> @@ -114,10 +114,11 @@ static void surf_copy(int xe,
>> uint32_t sysmem = system_memory(xe);
>> uint8_t comp_pat_index = DEFAULT_PAT_INDEX;
>> uint16_t cpu_caching = __xe_default_cpu_caching(xe, sysmem, 0);
>> + uint32_t devid = intel_get_drm_devid(xe);
>> int result;
>>
>> igt_assert(mid->compression);
>> - if (AT_LEAST_GEN(intel_get_drm_devid(xe), 20) && mid->compression) {
>> + if (AT_LEAST_GEN(devid, 20) && mid->compression) {
>> comp_pat_index = intel_get_pat_idx_uc_comp(xe);
>> cpu_caching = DRM_XE_GEM_CPU_CACHING_WC;
>> }
>> @@ -162,8 +163,24 @@ static void surf_copy(int xe,
>> (void *)mid->ptr, mid->size);
>>
>> munmap(ccsmap2, ccssize);
>> - igt_assert(!strcmp(orig, newsum));
>> - igt_assert(!strcmp(orig2, newsum2));
>> + if (blt_platform_has_flat_ccs_enabled(xe)) {
>> + if (IS_GEN(devid, 12) && is_intel_dgfx(xe)) {
>> + igt_assert(!strcmp(orig, newsum));
>> + igt_assert(!strcmp(orig2, newsum2));
>> + } else if (AT_LEAST_GEN(devid, 20)) {
>> + if (is_intel_dgfx(xe)) {
>> + /* buffer object would become
>> + * uncompressed in xe2+ dgfx
>> + */
>> + igt_assert(!blt_surface_is_compressed(xe, ctx,
>> + NULL, ahnd, mid));
>> + } else {
>> + /* ccs should be present in xe2+ igfx */
>> + igt_assert(blt_surface_is_compressed(xe, ctx,
>> + NULL, ahnd, mid));
>> + }
>> + }
>> + }
>> g_free(orig);
>> g_free(orig2);
>> g_free(newsum);
>> @@ -193,10 +210,18 @@ static void surf_copy(int xe,
>> intel_ctx_xe_sync(ctx, true);
>> WRITE_PNG(xe, run_id, "corrupted", &blt.dst, dst->x2, dst->y2, bpp);
>> result = memcmp(src->ptr, dst->ptr, src->size);
>> - igt_assert(result != 0);
>> + if (!blt_platform_has_flat_ccs_enabled(xe))
>> + igt_assert(result != 0);
> Why there's negation? If platorm has no flat ccs that means we have no
> compression and src will equal dst.
Oh yes, Thank you so much for catching this! Will update it.
Akshata
>>
>> - /* retrieve back ccs */
>> - memcpy(ccsmap, ccscopy, ccssize);
>> + /* In case of suspend_resume, buffer object would become
>> + * uncompressed in xe2+ dgfx, and therefore retrieve the
>> + * ccs by copying 0 to ccsmap
>> + */
>> + if (suspend_resume && AT_LEAST_GEN(devid, 20) && is_intel_dgfx(xe))
>> + memset(ccsmap, 0, ccssize);
>> + else
>> + /* retrieve back ccs */
>> + memcpy(ccsmap, ccscopy, ccssize);
>> blt_ctrl_surf_copy(xe, ctx, NULL, ahnd, &surf);
>>
>> blt_block_copy(xe, ctx, NULL, ahnd, &blt, &ext);
>> @@ -365,7 +390,8 @@ static void block_copy(int xe,
>> * 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(xe, ctx, NULL, ahnd, mid));
>> + if (!blt_platform_has_flat_ccs_enabled(xe))
>> + igt_assert(blt_surface_is_compressed(xe, ctx, NULL, ahnd, mid));
> Same here, we should check if surface is compressed when platform
> has flat ccs turned on.
>
> --
> Zbigniew
Will update this too, Thanks
Akshata
>
>>
>> WRITE_PNG(xe, run_id, "mid", &blt.dst, width, height, bpp);
>>
>> --
>> 2.34.1
>>
next prev parent reply other threads:[~2024-04-23 3:32 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-20 3:36 [PATCH i-g-t v6 0/2] Update compression check based on platform Akshata Jahagirdar
2024-04-19 18:31 ` ✓ Fi.CI.BAT: success for " Patchwork
2024-04-19 18:59 ` ✓ CI.xeBAT: " Patchwork
2024-04-20 1:48 ` ✓ Fi.CI.IGT: " Patchwork
2024-04-20 3:36 ` [PATCH i-g-t v6 1/2] lib/intel_blt: Add helper function to ensure platform has flat-ccs enabled Akshata Jahagirdar
2024-04-20 3:36 ` [PATCH i-g-t v6 2/2] tests/xe_ccs: Update compression check based on flat-ccs enablement Akshata Jahagirdar
2024-04-22 7:13 ` Zbigniew Kempczyński
2024-04-23 3:31 ` Jahagirdar, Akshata [this message]
2024-04-23 4:12 ` ✓ CI.xeBAT: success for Update compression check based on platform (rev2) Patchwork
2024-04-23 4:21 ` ✓ Fi.CI.BAT: " Patchwork
2024-04-23 6:43 ` ✗ CI.xeFULL: failure " Patchwork
2024-04-23 8:03 ` Jahagirdar, Akshata
2024-04-23 11:56 ` Illipilli, TejasreeX
2024-04-23 15:36 ` [PATCH i-g-t v6 0/2] Update compression check based on platform Akshata Jahagirdar
2024-04-23 15:37 ` [PATCH i-g-t v7 1/2] lib/intel_blt: Add helper function to ensure platform has flat-ccs enabled Akshata Jahagirdar
2024-04-23 15:37 ` [PATCH i-g-t v7 2/2] tests/xe_ccs: Update compression check based on flat-ccs enablement Akshata Jahagirdar
2024-04-23 6:10 ` Zbigniew Kempczyński
2024-04-23 20:56 ` ✗ Fi.CI.IGT: failure for Update compression check based on platform (rev2) Patchwork
-- strict thread matches above, loose matches on Subject: below --
2024-04-18 8:46 [PATCH i-g-t v6 0/2] Update compression check based on platform Akshata Jahagirdar
2024-04-18 8:46 ` [PATCH i-g-t v6 2/2] tests/xe_ccs: Update compression check based on flat-ccs enablement Akshata Jahagirdar
2024-04-18 13:59 ` Zbigniew Kempczyński
2024-04-19 6:36 ` Jahagirdar, Akshata
2024-04-19 7:41 ` Zbigniew Kempczyński
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=0b7e2820-4a1e-47a0-b182-cb0d4646420e@intel.com \
--to=akshata.jahagirdar@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