Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 i-g-t] tests/intel/oa: Check exec_queue is usable after closing OA stream
@ 2024-10-03 18:40 Ashutosh Dixit
  2024-10-03 19:45 ` ✓ CI.xeBAT: success for tests/intel/oa: Check exec_queue is usable after closing OA stream (rev2) Patchwork
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Ashutosh Dixit @ 2024-10-03 18:40 UTC (permalink / raw)
  To: igt-dev

Add a test case to verify that batch buffers submitted on an exec_queue,
after closing the OA stream, do indeed complete. This test is in related to
https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/2821 where this was
first noticed.

v2: Submit batch buffers a few times rather than just once

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

diff --git a/tests/intel/xe_oa.c b/tests/intel/xe_oa.c
index 9be4fd6334..5a604ea38e 100644
--- a/tests/intel/xe_oa.c
+++ b/tests/intel/xe_oa.c
@@ -3017,13 +3017,36 @@ test_mi_rpc(struct drm_xe_engine_class_instance *hwe)
 	igt_assert_neq(report32[format.b_off >> 2], 0x80808080);
 	igt_assert_eq(report32[format_size_32], 0x80808080);
 
+	intel_buf_unmap(buf);
+	__perf_close(stream_fd);
+
+	/*
+	 * Re-do MI_RPC a few times after closing perf stream, and check
+	 * batch buffers submitted on exec_queue still complete
+	 */
+	buf_map(drm_fd, buf, true);
+	memset(buf->ptr, 0x80, 4096);
+	intel_buf_unmap(buf);
+
+	for (int i = 0; i < 16; i++) {
+		intel_bb_flush_render(ibb);
+		intel_bb_sync(ibb);
+	}
+
+	buf_map(drm_fd, buf, false);
+	report32 = buf->ptr;
+	format_size_32 = format.size >> 2;
+	dump_report(report32, format_size_32, "mi-rpc");
+
+	igt_assert_eq(report32[0], 0x80808080);
+	igt_assert_eq(oa_timestamp(report32, test_set->perf_oa_format), 0x80808080);
+
 	intel_buf_unmap(buf);
 	intel_buf_destroy(buf);
 	intel_bb_destroy(ibb);
 	xe_exec_queue_destroy(drm_fd, ctx_id);
 	xe_vm_destroy(drm_fd, vm);
 	buf_ops_destroy(bops);
-	__perf_close(stream_fd);
 }
 
 static void
-- 
2.41.0


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

end of thread, other threads:[~2024-10-03 22:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-03 18:40 [PATCH v2 i-g-t] tests/intel/oa: Check exec_queue is usable after closing OA stream Ashutosh Dixit
2024-10-03 19:45 ` ✓ CI.xeBAT: success for tests/intel/oa: Check exec_queue is usable after closing OA stream (rev2) Patchwork
2024-10-03 19:55 ` ✓ Fi.CI.BAT: " Patchwork
2024-10-03 22:37 ` ✗ CI.xeFULL: failure " Patchwork

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