public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
* [PATCH i-g-t] tests/intel/xe_oa: Extend enable-disable to read after disabling stream
@ 2026-03-17 22:39 Ashutosh Dixit
  2026-03-18  3:03 ` ✓ Xe.CI.BAT: success for " Patchwork
                   ` (8 more replies)
  0 siblings, 9 replies; 11+ messages in thread
From: Ashutosh Dixit @ 2026-03-17 22:39 UTC (permalink / raw)
  To: igt-dev; +Cc: Umesh Nerlige Ramappa

Extend enable-disable subtest to validate the new feature of reading after
disabling OA stream.

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

diff --git a/tests/intel/xe_oa.c b/tests/intel/xe_oa.c
index 387f29535e..6a602a014c 100644
--- a/tests/intel/xe_oa.c
+++ b/tests/intel/xe_oa.c
@@ -2774,6 +2774,31 @@ test_enable_disable(const struct drm_xe_oa_unit *oau)
 	get_stream_status(stream_fd);
 	igt_assert_eq(ret, sizeof(buf));
 
+	/*
+	 * Wait again for number of reports specified in
+	 * DRM_XE_OA_PROPERTY_WAIT_NUM_REPORTS
+	 */
+	pollfd.fd = stream_fd;
+	pollfd.events = POLLIN;
+	poll(&pollfd, 1, -1);
+	igt_assert(pollfd.revents & POLLIN);
+
+	do_ioctl(stream_fd, DRM_XE_OBSERVATION_IOCTL_DISABLE, 0);
+
+	/* Ensure num_reports can be read even with disabled stream */
+	while ((ret = read(stream_fd, buf, sizeof(buf))) < 0 && errno == EINTR)
+		;
+	get_stream_status(stream_fd);
+	igt_assert_eq(ret, sizeof(buf));
+
+	/* In non-blocking mode read till we see a -EAGAIN, signifying all available data is read */
+	set_fd_flags(stream_fd, O_CLOEXEC | O_NONBLOCK);
+	while ((ret = read(stream_fd, buf, sizeof(buf))) > 0 ||
+	       (ret == -1 && (errno == EINTR || errno == EIO)))
+		;
+	igt_assert_eq(ret, -1);
+	igt_assert_eq(errno, EAGAIN);
+
 	__perf_close(stream_fd);
 }
 
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2026-03-30 20:15 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-17 22:39 [PATCH i-g-t] tests/intel/xe_oa: Extend enable-disable to read after disabling stream Ashutosh Dixit
2026-03-18  3:03 ` ✓ Xe.CI.BAT: success for " Patchwork
2026-03-18  3:15 ` ✓ i915.CI.BAT: " Patchwork
2026-03-19  7:25 ` ✓ i915.CI.Full: " Patchwork
2026-03-19 16:07 ` ✗ Xe.CI.FULL: failure " Patchwork
2026-03-28  1:15 ` ✓ Xe.CI.BAT: success for tests/intel/xe_oa: Extend enable-disable to read after disabling stream (rev2) Patchwork
2026-03-28  1:46 ` ✓ i915.CI.BAT: " Patchwork
2026-03-28 20:08 ` ✗ Xe.CI.FULL: failure " Patchwork
2026-03-29  7:53 ` ✓ i915.CI.Full: success " Patchwork
2026-03-30 17:58 ` [PATCH i-g-t] tests/intel/xe_oa: Extend enable-disable to read after disabling stream Umesh Nerlige Ramappa
2026-03-30 20:14   ` Dixit, Ashutosh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox