Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Teres Alexis, Alan Previn" <alan.previn.teres.alexis@intel.com>
To: "igt-dev@lists.freedesktop.org" <igt-dev@lists.freedesktop.org>,
	"Ceraolo Spurio, Daniele" <daniele.ceraolospurio@intel.com>
Subject: Re: [PATCH i-g-t] tests/intel/xe_query: Add test for PXP status query
Date: Thu, 6 Mar 2025 22:54:00 +0000	[thread overview]
Message-ID: <9ab5c579eb09cfc24a14f37ec0e71aabdceca0d3.camel@intel.com> (raw)
In-Reply-To: <20250306213309.3546278-1-daniele.ceraolospurio@intel.com>

Thanks for catching that ioctl return vs errno bug and the missing memory free - my bad for missing that:
Reviewed-by: Alan Previn <alan.previn.teres.alexis@intel.com>



On Thu, 2025-03-06 at 13:33 -0800, Ceraolo Spurio, Daniele wrote:
> Add a new test to exercise the PXP status query.
> 
> v2: fix ioctl error checking, free allocated mem
> 
> Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
> Reviewed-by: Alan Previn <alan.previn.teres.alexis@intel.com> #v1
> ---
>  tests/intel/xe_query.c | 65 ++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 65 insertions(+)
> 
> diff --git a/tests/intel/xe_query.c b/tests/intel/xe_query.c
> index f5aa4a572..9c7bf1d6f 100644
> --- a/tests/intel/xe_query.c
> +++ b/tests/intel/xe_query.c
> @@ -1062,6 +1062,70 @@ static void test_query_oa_units(int fd)
>         }
>  }
>  
> +/**
> + * SUBTEST: query-pxp-status
> + * Description: Display PXP supported types and current status
> + *
> + * SUBTEST: multigpu-query-pxp-status
> + * Description: Display fields for PXP unit query for all Xe devices
> + * Sub-category: MultiGPU
> + */
> +static void test_query_pxp_status(int fd)
> +{
> +       struct drm_xe_query_pxp_status *qpxp;
> +       struct drm_xe_device_query query = {
> +               .extensions = 0,
> +               .query = DRM_XE_DEVICE_QUERY_PXP_STATUS,
> +               .size = 0,
> +               .data = 0,
> +       };
> +       int ret;
> +
> +       /*
> +        * if we run this test on an older kernel that doesn't have the PXP
> +        * query, the ioctl will return -EINVAL.
> +        */
> +       errno = 0;
> +       ret = igt_ioctl(fd, DRM_IOCTL_XE_DEVICE_QUERY, &query);
> +       igt_require(errno != EINVAL);
> +       igt_assert_eq(ret, 0);
> +
> +       /* make sure the returned size is big enough */
> +       igt_assert(query.size >= sizeof(*qpxp));
> +
> +       qpxp = malloc(query.size);
> +       igt_assert(qpxp);
> +
> +       memset(qpxp, 0, query.size);
> +
> +       query.data = to_user_pointer(qpxp);
> +
> +       errno = 0;
> +       ret = igt_ioctl(fd, DRM_IOCTL_XE_DEVICE_QUERY, &query);
> +       if (errno == ENODEV) {
> +               igt_info("PXP not supported\n");
> +               free(qpxp);
> +               return;
> +       }
> +
> +       igt_assert_eq(ret, 0);
> +       igt_assert_neq(qpxp->supported_session_types, 0);
> +
> +       switch (qpxp->status) {
> +       case 0:
> +               igt_info("PXP initialization still in progress\n");
> +               break;
> +       case 1:
> +               igt_info("PXP initialization complete\n");
> +               break;
> +       default:
> +               igt_assert_f(0, "unexpected PXP status %u\n", qpxp->status);
> +       }
> +
> +       igt_info("PXP supported types mask 0x%x\n", qpxp->supported_session_types);
> +       free(qpxp);
> +}
> +
>  igt_main
>  {
>         const struct {
> @@ -1079,6 +1143,7 @@ igt_main
>                 { "query-uc-fw-version-guc", test_query_uc_fw_version_guc },
>                 { "query-uc-fw-version-huc", test_query_uc_fw_version_huc },
>                 { "query-oa-units", test_query_oa_units },
> +               { "query-pxp-status", test_query_pxp_status },
>                 { "query-invalid-cs-cycles", test_engine_cycles_invalid },
>                 { "query-invalid-query", test_query_invalid_query },
>                 { "query-invalid-size", test_query_invalid_size },


  reply	other threads:[~2025-03-06 22:54 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-05 23:39 [PATCH i-g-t v5 0/6] Xe: Add tests for PXP Daniele Ceraolo Spurio
2025-03-05 23:39 ` [PATCH i-g-t v5 1/6] tests/intel/xe_vm: Update invalid flag subtest with valid PXP flag Daniele Ceraolo Spurio
2025-03-05 23:39 ` [PATCH i-g-t v5 2/6] tests/intel/xe_query: Add test for PXP status query Daniele Ceraolo Spurio
2025-03-06 21:33   ` [PATCH i-g-t] " Daniele Ceraolo Spurio
2025-03-06 22:54     ` Teres Alexis, Alan Previn [this message]
2025-03-05 23:39 ` [PATCH i-g-t v5 3/6] tests/intel/xe_pxp: Add PXP object and queue creation tests Daniele Ceraolo Spurio
2025-03-05 23:39 ` [PATCH i-g-t v5 4/6] tests/intel/xe_pxp: Test PXP submissions Daniele Ceraolo Spurio
2025-03-05 23:39 ` [PATCH i-g-t v5 5/6] tests/intel/xe_pxp: Termination tests Daniele Ceraolo Spurio
2025-03-07  1:04   ` Teres Alexis, Alan Previn
2025-03-05 23:39 ` [PATCH i-g-t v5 6/6] tests/intel/xe_pxp: Test encrypted FBs Daniele Ceraolo Spurio
2025-03-06  8:21 ` ✓ Xe.CI.BAT: success for Xe: Add tests for PXP (rev5) Patchwork
2025-03-06  8:43 ` ✓ i915.CI.BAT: " Patchwork
2025-03-06 11:29 ` ✗ i915.CI.Full: failure " Patchwork
2025-03-06 16:18 ` ✗ Xe.CI.Full: " Patchwork
2025-03-07  7:42 ` ✓ Xe.CI.BAT: success for Xe: Add tests for PXP (rev6) Patchwork
2025-03-07  8:03 ` ✓ i915.CI.BAT: " Patchwork
2025-03-07  9:39 ` ✗ i915.CI.Full: failure " Patchwork
2025-03-07 22:15 ` ✗ 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=9ab5c579eb09cfc24a14f37ec0e71aabdceca0d3.camel@intel.com \
    --to=alan.previn.teres.alexis@intel.com \
    --cc=daniele.ceraolospurio@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    /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