public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Matthew Auld <matthew.auld@intel.com>
To: "Zbigniew Kempczyński" <zbigniew.kempczynski@intel.com>,
	igt-dev@lists.freedesktop.org
Cc: Matt Roper <matthew.d.roper@intel.com>
Subject: Re: [PATCH i-g-t v4 5/5] tests/xe_pat: Verify PAT registers are properly programmed
Date: Mon, 30 Mar 2026 16:04:49 +0100	[thread overview]
Message-ID: <264a31ab-ce70-4a95-b931-dfb57d20502e@intel.com> (raw)
In-Reply-To: <20260330144032.1954771-12-zbigniew.kempczynski@intel.com>

On 30/03/2026 15:40, Zbigniew Kempczyński wrote:
> Debugfs exposes file which reflects current PAT registers settings.
> Verify these registers matches predefined PAT config.
> 
> Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
> Cc: Matthew Auld <matthew.auld@intel.com>
> Cc: Matt Roper <matthew.d.roper@intel.com>

Is the suspend case not applicable for non-PTA?

> ---
>   tests/intel/xe_pat.c | 50 ++++++++++++++++++++++++++++++++++++++++++++
>   1 file changed, 50 insertions(+)
> 
> diff --git a/tests/intel/xe_pat.c b/tests/intel/xe_pat.c
> index a845541e6f..e2b6682449 100644
> --- a/tests/intel/xe_pat.c
> +++ b/tests/intel/xe_pat.c
> @@ -238,6 +238,50 @@ static void pat_sanity(int fd)
>   	}
>   }
>   
> +#define GT_RESET 1
> +/**
> + * SUBTEST: pat-sw-hw-compare
> + * Description: verify debugfs 'pat' reflects 'pat_sw_config'
> + *
> + * SUBTEST: pat-sw-hw-reset-compare
> + * Description: verify debugfs 'pat' reflects 'pat_sw_config' after gt reset
> + */
> +static void pat_sw_hw_compare(int fd, uint32_t flags)
> +{
> +	bool matches = true;
> +	int gt;
> +
> +	xe_for_each_gt(fd, gt) {
> +		struct intel_pat_cache pat_hw_config = {};
> +		struct intel_pat_cache pat_sw_config = {};
> +		int hw_entries, sw_entries;
> +
> +		if (flags & GT_RESET)
> +			xe_force_gt_reset_sync(fd, gt);
> +
> +		hw_entries = xe_get_pat_hw_config(fd, &pat_hw_config, gt);
> +		sw_entries = xe_get_pat_sw_config(fd, &pat_sw_config, gt);
> +		igt_assert_eq(hw_entries, sw_entries);
> +
> +		igt_debug("[GT%d] hw_entries: %d, sw_entries: %d\n", gt, hw_entries, sw_entries);
> +
> +		for (int i = 0; i < hw_entries; i++) {
> +			uint32_t hw_pat, sw_pat;
> +
> +			hw_pat = pat_hw_config.entries[i].pat;
> +			sw_pat = pat_sw_config.entries[i].pat;
> +			if (hw_pat != sw_pat) {
> +				igt_debug("[GT%d] Mismatch of pat register vs sw config "
> +					  "- index: %i, entries: %08x <> %08x\n",
> +					  gt, i, hw_pat, sw_pat);
> +				matches = false;
> +			}
> +		}
> +	}
> +
> +	igt_assert_eq(matches, true);
> +}
> +
>   /**
>    * SUBTEST: pat-index-all
>    * Test category: functionality test
> @@ -2204,6 +2248,12 @@ int igt_main_args("V", NULL, help_str, opt_handler, NULL)
>   	igt_subtest("pat-sanity")
>   		pat_sanity(fd);
>   
> +	igt_subtest("pat-sw-hw-compare")
> +		pat_sw_hw_compare(fd, 0);
> +
> +	igt_subtest("pat-sw-hw-reset-compare")
> +		pat_sw_hw_compare(fd, GT_RESET);
> +
>   	igt_subtest("pat-index-all")
>   		pat_index_all(fd);
>   


  reply	other threads:[~2026-03-30 15:05 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-30 14:40 [PATCH i-g-t v4 0/5] Verify PTA entries contains expected values Zbigniew Kempczyński
2026-03-30 14:40 ` [PATCH i-g-t v4 1/5] lib/intel_pat: Support other than gt0 during parsing debugfs PAT Zbigniew Kempczyński
2026-03-30 14:51   ` Matthew Auld
2026-03-30 14:40 ` [PATCH i-g-t v4 2/5] lib/intel_pat: Expose getter of PAT registers Zbigniew Kempczyński
2026-03-30 14:55   ` Matthew Auld
2026-03-30 14:40 ` [PATCH i-g-t v4 3/5] lib/intel_pat: Set PTA + ATS PAT entries to invalid value Zbigniew Kempczyński
2026-03-30 14:58   ` Matthew Auld
2026-03-30 14:40 ` [PATCH i-g-t v4 4/5] tests/xe_pat: Verify PTA PAT entries contain expected values Zbigniew Kempczyński
2026-03-30 15:02   ` Matthew Auld
2026-03-30 14:40 ` [PATCH i-g-t v4 5/5] tests/xe_pat: Verify PAT registers are properly programmed Zbigniew Kempczyński
2026-03-30 15:04   ` Matthew Auld [this message]
2026-03-31  3:09 ` ✓ Xe.CI.BAT: success for Verify PTA entries contains expected values (rev4) Patchwork
2026-03-31  3:25 ` ✓ i915.CI.BAT: " Patchwork
2026-03-31  8:26 ` ✓ Xe.CI.FULL: " Patchwork
2026-03-31 12:26 ` ✓ i915.CI.Full: " Patchwork
2026-04-01  5:50 ` ✓ Xe.CI.FULL: " 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=264a31ab-ce70-4a95-b931-dfb57d20502e@intel.com \
    --to=matthew.auld@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=matthew.d.roper@intel.com \
    --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