igt-dev.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
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 1/5] tests/intel/xe_oa: Drop oa-unit-exclusive-stream-exec-q
Date: Tue, 25 Nov 2025 19:50:08 -0800	[thread overview]
Message-ID: <20251126035012.12967-2-ashutosh.dixit@intel.com> (raw)
In-Reply-To: <20251126035012.12967-1-ashutosh.dixit@intel.com>

In the kernel we have restricted exec_queue's to be specified only for the
OAG unit. Therefore the "oa-unit-exclusive-stream-exec-q" IGT test needs to
be modified. However, the main purpose of the "oa-unit-exclusive-stream"
tests is to ensure that only a single OA stream can be opened on an OA
unit. For this an exec_queue is not needed, just the sampling mode is
sufficient. Therefore, discontinue oa-unit-exclusive-stream-exec-q test. It
can be added back later if it is determined that it is really needed.

Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
---
 tests/intel/xe_oa.c | 70 +++++++--------------------------------------
 1 file changed, 10 insertions(+), 60 deletions(-)

diff --git a/tests/intel/xe_oa.c b/tests/intel/xe_oa.c
index 0c9e693f7d..9302d1c83a 100644
--- a/tests/intel/xe_oa.c
+++ b/tests/intel/xe_oa.c
@@ -4254,111 +4254,64 @@ test_sysctl_defaults(void)
 }
 
 /**
- * SUBTEST: oa-unit-exclusive-stream-sample-oa
- * Description: Check that only a single stream can be opened on an OA unit (with sampling)
- *
- * SUBTEST: oa-unit-exclusive-stream-exec-q
- * Description: Check that only a single stream can be opened on an OA unit (for OAR/OAC)
+ * SUBTEST: oa-unit-exclusive-stream
+ * Description: Check that only a single stream can be opened on an OA unit
 */
 /*
  * Test if OA buffer streams can be independently opened on OA unit. Once a user
  * opens a stream, that oa unit is exclusive to the user, other users get -EBUSY on
  * trying to open a stream.
  */
-static void
-test_oa_unit_exclusive_stream(bool exponent)
+static void test_oa_unit_exclusive_stream(void)
 {
 	struct drm_xe_query_oa_units *qoa = xe_oa_units(drm_fd);
-	const struct drm_xe_engine_class_instance *hwe;
 	const struct drm_xe_oa_unit *oau;
 	uint64_t properties[] = {
 		DRM_XE_OA_PROPERTY_OA_UNIT_ID, 0,
 		DRM_XE_OA_PROPERTY_SAMPLE_OA, true,
 		DRM_XE_OA_PROPERTY_OA_METRIC_SET, 0,
 		DRM_XE_OA_PROPERTY_OA_FORMAT, __ff(0),
-		DRM_XE_OA_PROPERTY_OA_ENGINE_INSTANCE, 0,
 		DRM_XE_OA_PROPERTY_OA_PERIOD_EXPONENT, oa_exponent_default,
 	};
 	struct intel_xe_oa_open_prop param = {
 		.num_properties = ARRAY_SIZE(properties) / 2,
 		.properties_ptr = to_user_pointer(properties),
 	};
-	uint32_t *exec_q = calloc(qoa->num_oa_units, sizeof(u32));
 	uint32_t *perf_fd = calloc(qoa->num_oa_units, sizeof(u32));
-	u32 vm = xe_vm_create(drm_fd, 0, 0);
 	struct intel_xe_perf_metric_set *test_set;
 	uint32_t i;
 
-	/* for each oa unit, open one random perf stream with sample OA */
+	/* for each oa unit, open one stream with sample OA */
 	for (i = 0; i < qoa->num_oa_units; i++) {
 		oau = oa_unit_by_id(drm_fd, i);
-		hwe = oa_unit_engine(oau);
-
-		if (!hwe)
-			continue;
 		test_set = oa_unit_metric_set(oau);
 
-		igt_debug("opening OA buffer with c:i %d:%d\n",
-			  hwe->engine_class, hwe->engine_instance);
-		exec_q[i] = xe_exec_queue_create_deconst(drm_fd, vm, hwe, 0);
-		if (!exponent) {
-			properties[10] = DRM_XE_OA_PROPERTY_EXEC_QUEUE_ID;
-			properties[11] = exec_q[i];
-		}
+		igt_debug("Opening OA stream on OA unit id:type %d:%d\n", i, oau->oa_unit_type);
 
 		properties[1] = oau->oa_unit_id;
 		properties[5] = test_set->perf_oa_metrics_set;
 		properties[7] = __ff(test_set->perf_oa_format);
-		properties[9] = hwe->engine_instance;
 		perf_fd[i] = intel_xe_perf_ioctl(drm_fd, DRM_XE_OBSERVATION_OP_STREAM_OPEN, &param);
 		igt_assert(perf_fd[i] >= 0);
 	}
 
-	/* Xe KMD holds reference to the exec_q's so they shouldn't be really destroyed */
-	for (i = 0; i < qoa->num_oa_units; i++)
-		if (exec_q[i])
-			xe_exec_queue_destroy(drm_fd, exec_q[i]);
-
 	/* for each oa unit make sure no other streams can be opened */
 	for (i = 0; i < qoa->num_oa_units; i++) {
-		int err;
-
 		oau = oa_unit_by_id(drm_fd, i);
-		hwe = oa_unit_engine(oau);
-
-		if (!hwe)
-			continue;
 		test_set = oa_unit_metric_set(oau);
 
-		igt_debug("try with exp with c:i %d:%d\n",
-			  hwe->engine_class, hwe->engine_instance);
+		igt_debug("Try on OA unit id:type %d:%d\n", i, oau->oa_unit_type);
+
 		/* case 1: concurrent access to OAG should fail */
 		properties[1] = oau->oa_unit_id;
 		properties[5] = test_set->perf_oa_metrics_set;
 		properties[7] = __ff(test_set->perf_oa_format);
-		properties[9] = hwe->engine_instance;
-		properties[10] = DRM_XE_OA_PROPERTY_OA_PERIOD_EXPONENT;
-		properties[11] = oa_exponent_default;
 		intel_xe_perf_ioctl_err(drm_fd, DRM_XE_OBSERVATION_OP_STREAM_OPEN, &param, EBUSY);
-
-		/* case 2: concurrent access to non-OAG unit should fail */
-		igt_debug("try with exec_q with c:i %d:%d\n",
-			  hwe->engine_class, hwe->engine_instance);
-		exec_q[i] = xe_exec_queue_create_deconst(drm_fd, vm, hwe, 0);
-		properties[10] = DRM_XE_OA_PROPERTY_EXEC_QUEUE_ID;
-		properties[11] = exec_q[i];
-		errno = 0;
-		err = intel_xe_perf_ioctl(drm_fd, DRM_XE_OBSERVATION_OP_STREAM_OPEN, &param);
-		igt_assert_lt(err, 0);
-		igt_assert(errno == EBUSY || errno == ENODEV);
 	}
 
-	for (i = 0; i < qoa->num_oa_units; i++) {
+	for (i = 0; i < qoa->num_oa_units; i++)
 		if (perf_fd[i])
 			close(perf_fd[i]);
-		if (exec_q[i])
-			xe_exec_queue_destroy(drm_fd, exec_q[i]);
-	}
 }
 
 /**
@@ -5151,11 +5104,8 @@ igt_main_args("b:t", long_options, help_str, opt_handler, NULL)
 	}
 
 	igt_subtest_group {
-		igt_subtest("oa-unit-exclusive-stream-sample-oa")
-			test_oa_unit_exclusive_stream(true);
-
-		igt_subtest("oa-unit-exclusive-stream-exec-q")
-			test_oa_unit_exclusive_stream(false);
+		igt_subtest("oa-unit-exclusive-stream")
+			test_oa_unit_exclusive_stream();
 
 		igt_subtest("oa-unit-concurrent-oa-buffer-read") {
 			igt_require(!igt_run_in_simulation());
-- 
2.48.1


  reply	other threads:[~2025-11-26  3:50 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-26  3:50 [PATCH i-g-t 0/5] OA: Run MMIO trigger tests on all OA units Ashutosh Dixit
2025-11-26  3:50 ` Ashutosh Dixit [this message]
2025-12-02 21:32   ` [PATCH i-g-t 1/5] tests/intel/xe_oa: Drop oa-unit-exclusive-stream-exec-q Umesh Nerlige Ramappa
2025-11-26  3:50 ` [PATCH i-g-t 2/5] drm-uapi/xe: Sync with DRM_XE_OA_CAPS_OA_UNIT_GT_ID definition Ashutosh Dixit
2025-11-27 17:24   ` Kamil Konieczny
2025-11-26  3:50 ` [PATCH i-g-t 3/5] tests/intel/xe_oa: Return hwe from same gt from oa_unit_engine() Ashutosh Dixit
2025-11-26  3:50 ` [PATCH i-g-t 4/5] tests/intel/xe_oa: Run mmio-trigger tests on all OA units Ashutosh Dixit
2025-12-02 21:37   ` Umesh Nerlige Ramappa
2025-11-26  3:50 ` [PATCH i-g-t 5/5] tests/intel/xe_oa: Use separate oa unit variables for caps and iterator Ashutosh Dixit
2025-12-02 21:59   ` Umesh Nerlige Ramappa
2025-11-26  4:27 ` ✓ Xe.CI.BAT: success for OA: Run MMIO trigger tests on all OA units Patchwork
2025-11-26  4:41 ` ✓ i915.CI.BAT: " Patchwork
2025-11-26  7:27 ` ✗ Xe.CI.Full: failure " Patchwork
2025-11-26 15:01 ` ✗ i915.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=20251126035012.12967-2-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;
as well as URLs for NNTP newsgroup(s).