From: Ashutosh Dixit <ashutosh.dixit@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>
Subject: [PATCH i-g-t 07/18] tests/intel/xe_query: Add OA units query test
Date: Fri, 16 Feb 2024 15:16:52 -0800 [thread overview]
Message-ID: <20240216231703.845644-8-ashutosh.dixit@intel.com> (raw)
In-Reply-To: <20240216231703.845644-1-ashutosh.dixit@intel.com>
Add test to exercise OA units query.
Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
---
tests/intel/xe_query.c | 53 ++++++++++++++++++++++++++++++++++++++++++
1 file changed, 53 insertions(+)
diff --git a/tests/intel/xe_query.c b/tests/intel/xe_query.c
index 9a6799c8473a..2005b8d20ae3 100644
--- a/tests/intel/xe_query.c
+++ b/tests/intel/xe_query.c
@@ -730,6 +730,58 @@ static void test_engine_cycles_invalid(int fd)
query_engine_cycles(fd, &ts);
}
+/**
+ * SUBTEST: query-oa-units
+ * Description: Display fields for OA unit query
+ *
+ * SUBTEST: multigpu-query-oa-units
+ * Description: Display fields for OA unit query for all GPU devices
+ * Sub-category: MultiGPU
+ */
+static void test_query_oa_units(int fd)
+{
+ struct drm_xe_query_oa_units *qoa;
+ struct drm_xe_device_query query = {
+ .extensions = 0,
+ .query = DRM_XE_DEVICE_QUERY_OA_UNITS,
+ .size = 0,
+ .data = 0,
+ };
+ struct drm_xe_oa_unit *oau;
+ int i, j;
+ u8 *poau;
+
+ igt_assert_eq(igt_ioctl(fd, DRM_IOCTL_XE_DEVICE_QUERY, &query), 0);
+
+ qoa = malloc(query.size);
+ igt_assert(qoa);
+
+ query.data = to_user_pointer(qoa);
+ igt_assert_eq(igt_ioctl(fd, DRM_IOCTL_XE_DEVICE_QUERY, &query), 0);
+
+ igt_info("num_oa_units %d\n", qoa->num_oa_units);
+
+ poau = (u8 *)&qoa->oa_units[0];
+ for (i = 0; i < qoa->num_oa_units; i++) {
+ oau = (struct drm_xe_oa_unit *)poau;
+
+ igt_info("-------------------------------\n");
+ igt_info("oa_unit %d\n", i);
+ igt_info("-------------------------------\n");
+ igt_info("oa_unit_id %d\n", oau->oa_unit_id);
+ igt_info("oa_unit_type %d\n", oau->oa_unit_type);
+ igt_info("capabilities %#llx\n", oau->capabilities);
+ igt_info("oa_timestamp_freq %lld\n", oau->oa_timestamp_freq);
+ igt_info("num_engines %lld\n", oau->num_engines);
+ igt_info("Engines:");
+ for (j = 0; j < oau->num_engines; j++)
+ igt_info(" (%d, %d)", oau->eci[j].engine_class,
+ oau->eci[j].engine_instance);
+ igt_info("\n");
+ poau += sizeof(*oau) + j * sizeof(oau->eci[0]);
+ }
+}
+
igt_main
{
const struct {
@@ -743,6 +795,7 @@ igt_main
{ "query-hwconfig", test_query_hwconfig },
{ "query-topology", test_query_gt_topology },
{ "query-cs-cycles", test_query_engine_cycles },
+ { "query-oa-units", test_query_oa_units },
{ "query-invalid-cs-cycles", test_engine_cycles_invalid },
{ "query-invalid-query", test_query_invalid_query },
{ "query-invalid-size", test_query_invalid_size },
--
2.41.0
next prev parent reply other threads:[~2024-02-16 23:17 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-16 23:16 [PATCH i-g-t 00/18] Intel Xe OA IGT's Ashutosh Dixit
2024-02-16 23:16 ` [PATCH i-g-t 01/18] lib/xe/oa: Import OA metric generation files from i915 Ashutosh Dixit
2024-02-16 23:16 ` [PATCH i-g-t 02/18] lib/xe/oa: Add LNL metric guids Ashutosh Dixit
2024-02-16 23:16 ` [PATCH i-g-t 03/18] lib/xe/oa: Add OA LNL metrics (oa_lnl.xml) Ashutosh Dixit
2024-02-16 23:16 ` [PATCH i-g-t 04/18] lib/xe/oa: Generate LNL metrics/registers files Ashutosh Dixit
2024-02-16 23:16 ` [PATCH i-g-t 05/18] drm-uapi/xe: Sync with Perf/OA changes Ashutosh Dixit
2024-02-16 23:16 ` [PATCH i-g-t 06/18] lib/xe: Complete xe_oa lib changes Ashutosh Dixit
2024-02-16 23:16 ` Ashutosh Dixit [this message]
2024-02-16 23:16 ` [PATCH i-g-t 08/18] tests/intel/xe_oa: Add first tests Ashutosh Dixit
2024-02-16 23:16 ` [PATCH i-g-t 09/18] tests/intel/xe_oa: Add some negative tests Ashutosh Dixit
2024-02-16 23:16 ` [PATCH i-g-t 10/18] tests/intel/xe_oa: Add "oa-formats" subtest Ashutosh Dixit
2024-02-16 23:16 ` [PATCH i-g-t 11/18] tests/intel/xe_oa: Add oa exponent tests Ashutosh Dixit
2024-02-16 23:16 ` [PATCH i-g-t 12/18] tests/intel/xe_oa: buffer-fill, non-zero-reason, enable-disable Ashutosh Dixit
2024-02-16 23:16 ` [PATCH i-g-t 13/18] tests/intel/xe_oa: blocking and polling tests Ashutosh Dixit
2024-02-16 23:16 ` [PATCH i-g-t 14/18] tests/intel/xe_oa: OAR/OAC tests Ashutosh Dixit
2024-02-16 23:17 ` [PATCH i-g-t 15/18] tests/intel/xe_oa: Exclusive/concurrent access, rc6 and stress open close Ashutosh Dixit
2024-02-16 23:17 ` [PATCH i-g-t 16/18] tests/intel/xe_oa: add remove OA config tests Ashutosh Dixit
2024-02-16 23:17 ` [PATCH i-g-t 17/18] tests/intel/xe_oa: OA buffer mmap tests Ashutosh Dixit
2024-02-16 23:17 ` [PATCH i-g-t 18/18] tests/intel/xe_oa: Register whitelisting and MMIO trigger tests Ashutosh Dixit
2024-02-16 23:39 ` ✗ GitLab.Pipeline: warning for Intel Xe OA IGT's Patchwork
2024-02-17 0:11 ` ✓ Fi.CI.BAT: success " Patchwork
2024-02-17 0:12 ` ✗ CI.xeBAT: failure " Patchwork
2024-02-17 17:10 ` ✗ Fi.CI.IGT: " 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=20240216231703.845644-8-ashutosh.dixit@intel.com \
--to=ashutosh.dixit@intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=umesh.nerlige.ramappa@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