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 3/7] tests/intel/xe_query: Add test for PXP status query
Date: Wed, 15 Jan 2025 05:38:16 +0000	[thread overview]
Message-ID: <77885790bca81c9cd4030ee784147c3fa632247b.camel@intel.com> (raw)
In-Reply-To: <20241212001829.2082490-4-daniele.ceraolospurio@intel.com>

looks good.
Reviewed-by: Alan Previn <alan.previn.teres.alexis@intel.com>

On Wed, 2024-12-11 at 16:18 -0800, Daniele Ceraolo Spurio wrote:
> Add a new test to exercise the PXP status query.
> 
> Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
> ---
>  tests/intel/xe_query.c | 61 ++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 61 insertions(+)
> 
> diff --git a/tests/intel/xe_query.c b/tests/intel/xe_query.c
> index 1566680e7..0a2ff8d7f 100644
> --- a/tests/intel/xe_query.c
> +++ b/tests/intel/xe_query.c
> @@ -1077,6 +1077,66 @@ 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);
> +       ret = igt_ioctl(fd, DRM_IOCTL_XE_DEVICE_QUERY, &query);
> +       if (ret == -ENODEV) {
> +               igt_info("PXP not supported\n");
> +               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);
> +}
> +
>  igt_main
>  {
>         const struct {
> @@ -1094,6 +1154,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-01-15  5:38 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-12  0:18 [PATCH i-g-t 0/7] Xe: Add tests for PXP Daniele Ceraolo Spurio
2024-12-12  0:18 ` [PATCH i-g-t 1/7] drm-uapi/xe: Sync PXP uapi updates Daniele Ceraolo Spurio
2025-01-15  2:25   ` Teres Alexis, Alan Previn
2025-01-15 23:26     ` Daniele Ceraolo Spurio
2024-12-12  0:18 ` [PATCH i-g-t 2/7] tests/intel/xe_vm: Update invalid flag subtest Daniele Ceraolo Spurio
2024-12-12  0:24   ` Daniele Ceraolo Spurio
2025-01-15  5:09     ` Teres Alexis, Alan Previn
2024-12-12  0:18 ` [PATCH i-g-t 3/7] tests/intel/xe_query: Add test for PXP status query Daniele Ceraolo Spurio
2025-01-15  5:38   ` Teres Alexis, Alan Previn [this message]
2024-12-12  0:18 ` [PATCH i-g-t 4/7] tests/intel/xe_pxp: Add PXP object and queue creation tests Daniele Ceraolo Spurio
2025-01-15  6:17   ` Teres Alexis, Alan Previn
2024-12-12  0:18 ` [PATCH i-g-t 5/7] tests/intel/xe_pxp: Test PXP submissions Daniele Ceraolo Spurio
2024-12-12  0:18 ` [PATCH i-g-t 6/7] tests/intel/xe_pxp: Termination tests Daniele Ceraolo Spurio
2024-12-12  0:18 ` [PATCH i-g-t 7/7] tests/intel/xe_pxp: Test encrypted FBs Daniele Ceraolo Spurio
2024-12-12  1:11 ` ✗ i915.CI.BAT: failure for Xe: Add tests for PXP Patchwork
2024-12-12  2:30 ` ✓ Xe.CI.BAT: success " Patchwork
2024-12-12  8:04 ` ✗ Xe.CI.Full: failure " 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=77885790bca81c9cd4030ee784147c3fa632247b.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