Skip to contentSkip to conversation

i915/perf: Add test to query CS timestamp

PATCH New Umesh Nerlige Ramappa 2 participants 2 messages Mar 2, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 i915/perf: Add test to query CS timestamp

Add tests to query CS timestamps for different engines.

v2:
- remove flag parameter
- assert for minimum usable values rather than maximum

v3:
- use clock id for cpu timestamps (Lionel)
- check if query is supported (Ashutosh)
- test bad queries

v4: (Chris, Tvrtko)
- cs_timestamp is a misnomer, use cs_cycles instead
- use cs cycle frequency returned in the query
- omit size parameter

v5:
- use __for_each_physical_engine (Lionel)
- check for ENODEV (Umesh)

---
 include/drm-uapi/i915_drm.h |  43 +++++++++
 tests/i915/i915_query.c     | 186 ++++++++++++++++++++++++++++++++++++
 2 files changed, 229 insertions(+)
include/drm-uapi/i915_drm.h +43 -0
index bf9ea471..a29f8578 100644
@@ -2176,6 +2176,10 @@ struct drm_i915_query_item {
 #define DRM_I915_QUERY_TOPOLOGY_INFO    1
 #define DRM_I915_QUERY_ENGINE_INFO	2
 #define DRM_I915_QUERY_PERF_CONFIG      3
+	/**
+	 * Query Command Streamer timestamp register.
+	 */
+#define DRM_I915_QUERY_CS_CYCLES	4
 /* Must be kept compact -- no holes and well documented */
 
 	/*
@@ -2309,6 +2313,45 @@ struct drm_i915_engine_info {
 	__u64 rsvd1[4];
 };
 
+/**
+ * struct drm_i915_query_cs_cycles
+ *
+ * The query returns the command streamer cycles and the frequency that can be
+ * used to calculate the command streamer timestamp. In addition the query
+ * returns the cpu timestamp that indicates when the command streamer cycle
+ * count was captured.
+ */
+struct drm_i915_query_cs_cycles {
+	/** Engine for which command streamer cycles is queried. */
+	struct i915_engine_class_instance engine;
+
+	/** Must be zero. */
+	__u32 flags;
+
+	/**
+	 * Command streamer cycles as read from the command streamer
+	 * register at 0x358 offset.
+	 */
+	__u64 cs_cycles;
+
+	/** Frequency of the cs cycles in Hz. */
+	__u64 cs_frequency;
+
+	/** CPU timestamp in nanoseconds. */
+	__u64 cpu_timestamp;
+
+	/**
+	 * Reference clock id for CPU timestamp. For definition, see
+	 * clock_gettime(2) and perf_event_open(2). Supported clock ids are
+	 * CLOCK_MONOTONIC, CLOCK_MONOTONIC_RAW, CLOCK_REALTIME, CLOCK_BOOTTIME,
+	 * CLOCK_TAI.
+	 */
+	__s32 clockid;
+
+	/** Must be zero. */
+	__u32 rsvd;
+};
+
 /**
  * struct drm_i915_query_engine_info
  *
tests/i915/i915_query.c +186 -0

198 lines not on this page · raw message

Signature · 6 lines
2.20.1

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
#1 lore raw

[igt-dev] ✗ Fi.CI.BAT: failure for i915/perf: Add test to query CS timestamp

== Series Details ==

== Series Details ==

Series: i915/perf: Add test to query CS timestamp
URL : https://patchwork.freedesktop.org/series/87553/
State : failure

== Summary ==

CI Bug Log - changes from IGT_6019 -> IGTPW_5564
====================================================

Summary
-------

**FAILURE**

Serious unknown changes coming with IGTPW_5564 absolutely need to be verified manually.

If you think the reported changes have nothing to do with the changes introduced in IGTPW_5564, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI.

External URL: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5564/index.html

Known issues
------------

Here are the changes found in IGTPW_5564 that come from known issues:

### IGT changes ###

#### Issues hit ####

* igt@gem_linear_blits@basic:
- fi-kbl-8809g: [PASS][1] -> [TIMEOUT][2] ([i915#2502])
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_6019/fi-kbl-8809g/igt@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5564/fi-kbl-8809g/igt@[email protected]

#### Possible fixes ####

* igt@gem_exec_gttfill@basic:
- fi-kbl-8809g: [TIMEOUT][3] ([i915#3145]) -> [PASS][4]
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_6019/fi-kbl-8809g/igt@[email protected]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5564/fi-kbl-8809g/igt@[email protected]

[i915#2502]: https://gitlab.freedesktop.org/drm/intel/issues/2502
[i915#3145]: https://gitlab.freedesktop.org/drm/intel/issues/3145

Participating hosts (45 -> 14)
------------------------------

ERROR: It appears as if the changes made in IGTPW_5564 prevented too many machines from booting.

Missing (31): fi-kbl-soraka fi-icl-y fi-skl-6600u fi-cml-u2 fi-cml-s fi-bsw-n3050 fi-byt-j1900 fi-tgl-u2 fi-glk-dsi fi-ctg-p8600 fi-hsw-4770 fi-elk-e7500 fi-tgl-y fi-bsw-nick fi-ilk-m540 fi-ehl-1 fi-tgl-dsi fi-skl-guc fi-cfl-8700k fi-dg1-1 fi-ehl-2 fi-hsw-gt1 fi-jsl-1 fi-rkl-11500t fi-bsw-cyan fi-cfl-guc fi-kbl-guc fi-kbl-x1275 fi-cfl-8109u fi-bsw-kefka fi-bdw-samus

Build changes
-------------

* CI: CI-20190529 -> None
* IGT: IGT_6019 -> IGTPW_5564

CI-20190529: 20190529
CI_DRM_9821: 2eaa470f08c2bc15cc2c17da08c232ac46721e54 @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_5564: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5564/index.html
IGT_6019: 970aae7166c50851b62ed94f02964f402fa4b701 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools

== Testlist changes ==

+igt@i915_query@cs-cycles
+igt@i915_query@cs-cycles-invalid

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5564/index.html

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev