Skip to contentSkip to conversation

i915/query: Correlate engine and cpu timestamps with better accuracy

PATCH In review Umesh Nerlige Ramappa 5 participants 11 messages Mar 3, 2021 – Mar 4, 2021

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 i915/query: Correlate engine and cpu timestamps with better accuracy

Perf measurements rely on CPU and engine timestamps to correlate events of interest across these time domains. Current mechanisms get these timestamps separately and the calculated delta between these timestamps lack enough accuracy.

To improve the accuracy of these time measurements to within a few us, add a query that returns the engine and cpu timestamps captured as close to each other as possible.

v2: (Tvrtko)
- document clock reference used
- return cpu timestamp always
- capture cpu time just before lower dword of cs timestamp

v3: (Chris)
- use uncore-rpm
- use __query_cs_timestamp helper

v4: (Lionel)
- Kernel perf subsytem allows users to specify the clock id to be used in perf_event_open. This clock id is used by the perf subsystem to return the appropriate cpu timestamp in perf events. Similarly, let the user pass the clockid to this query so that cpu timestamp corresponds to the clock id requested.

v5: (Tvrtko)
- Use normal ktime accessors instead of fast versions
- Add more uApi documentation

v6: (Lionel)
- Move switch out of spinlock

v7: (Chris)
- cs_timestamp is a misnomer, use cs_cycles instead
- return the cs cycle frequency as well in the query

v8:
- Add platform and engine specific checks

v9: (Lionel)
- Return 2 cpu timestamps in the query - captured before and after the register read

---
 drivers/gpu/drm/i915/i915_query.c | 144 ++++++++++++++++++++++++++++++
 include/uapi/drm/i915_drm.h       |  47 ++++++++++
 2 files changed, 191 insertions(+)
drivers/gpu/drm/i915/i915_query.c +144 -0
index fed337ad7b68..acca22ee6014 100644
@@ -6,6 +6,8 @@
 
 #include <linux/nospec.h>
 
+#include "gt/intel_engine_pm.h"
+#include "gt/intel_engine_user.h"
 #include "i915_drv.h"
 #include "i915_perf.h"
 #include "i915_query.h"
@@ -90,6 +92,147 @@ static int query_topology_info(struct drm_i915_private *dev_priv,
 	return total_length;
 }
 
+typedef u64 (*__ktime_func_t)(void);
+static __ktime_func_t __clock_id_to_func(clockid_t clk_id)
+{
+	/*
+	 * Use logic same as the perf subsystem to allow user to select the
+	 * reference clock id to be used for timestamps.
+	 */
+	switch (clk_id) {
+	case CLOCK_MONOTONIC:
+		return &ktime_get_ns;
+	case CLOCK_MONOTONIC_RAW:
+		return &ktime_get_raw_ns;
+	case CLOCK_REALTIME:
+		return &ktime_get_real_ns;
+	case CLOCK_BOOTTIME:
+		return &ktime_get_boottime_ns;
+	case CLOCK_TAI:
+		return &ktime_get_clocktai_ns;
+	default:
+		return NULL;
+	}
+}
+
+static inline int
+__read_timestamps(struct intel_uncore *uncore,
+		  i915_reg_t lower_reg,
+		  i915_reg_t upper_reg,
+		  u64 *cs_ts,
+		  u64 *cpu_ts,
+		  __ktime_func_t cpu_clock)
+{
+	u32 upper, lower, old_upper, loop = 0;
+
+	upper = intel_uncore_read_fw(uncore, upper_reg);
+	do {
+		cpu_ts[0] = cpu_clock();
+		lower = intel_uncore_read_fw(uncore, lower_reg);
+		cpu_ts[1] = cpu_clock();
+		old_upper = upper;
+		upper = intel_uncore_read_fw(uncore, upper_reg);
+	} while (upper != old_upper && loop++ < 2);
+
+	*cs_ts = (u64)upper << 32 | lower;
+
+	return 0;
+}
+
+static int
+__query_cs_cycles(struct intel_engine_cs *engine,
+		  u64 *cs_ts, u64 *cpu_ts,
+		  __ktime_func_t cpu_clock)
+{
+	struct intel_uncore *uncore = engine->uncore;
+	enum forcewake_domains fw_domains;
+	u32 base = engine->mmio_base;
+	intel_wakeref_t wakeref;
+	int ret;
+
+	fw_domains = intel_uncore_forcewake_for_reg(uncore,
+						    RING_TIMESTAMP(base),
+						    FW_REG_READ);
+
+	with_intel_runtime_pm(uncore->rpm, wakeref) {
+		spin_lock_irq(&uncore->lock);
+		intel_uncore_forcewake_get__locked(uncore, fw_domains);
+
+		ret = __read_timestamps(uncore,
+					RING_TIMESTAMP(base),
+					RING_TIMESTAMP_UDW(base),
+					cs_ts,
+					cpu_ts,
+					cpu_clock);
+
+		intel_uncore_forcewake_put__locked(uncore, fw_domains);
+		spin_unlock_irq(&uncore->lock);
+	}
+
+	return ret;
+}
+
+static int
+query_cs_cycles(struct drm_i915_private *i915,
+		struct drm_i915_query_item *query_item)
+{
+	struct drm_i915_query_cs_cycles __user *query_ptr;
+	struct drm_i915_query_cs_cycles query;
+	struct intel_engine_cs *engine;
+	__ktime_func_t cpu_clock;
+	int ret;
+
+	if (INTEL_GEN(i915) < 6)
+		return -ENODEV;
+
+	query_ptr = u64_to_user_ptr(query_item->data_ptr);
+	ret = copy_query_item(&query, sizeof(query), sizeof(query), query_item);
+	if (ret != 0)
+		return ret;
+
+	if (query.flags)
+		return -EINVAL;
+
+	if (query.rsvd)
+		return -EINVAL;
+
+	cpu_clock = __clock_id_to_func(query.clockid);
+	if (!cpu_clock)
+		return -EINVAL;
+
+	engine = intel_engine_lookup_user(i915,
+					  query.engine.engine_class,
+					  query.engine.engine_instance);
+	if (!engine)
+		return -EINVAL;
+
+	if (IS_GEN(i915, 6) &&
+	    query.engine.engine_class != I915_ENGINE_CLASS_RENDER)
+		return -ENODEV;
+
+	query.cs_frequency = engine->gt->clock_frequency;
+	ret = __query_cs_cycles(engine,
+				&query.cs_cycles,
+				query.cpu_timestamp,
+				cpu_clock);
+	if (ret)
+		return ret;
+
+	if (put_user(query.cs_frequency, &query_ptr->cs_frequency))
+		return -EFAULT;
+
+	if (put_user(query.cpu_timestamp[0], &query_ptr->cpu_timestamp[0]))
+		return -EFAULT;
+
+	if (put_user(query.cpu_timestamp[1], &query_ptr->cpu_timestamp[1]))
+		return -EFAULT;
+
+	if (put_user(query.cs_cycles, &query_ptr->cs_cycles))
+		return -EFAULT;
+
+	return sizeof(query);
+}
+
 static int
 query_engine_info(struct drm_i915_private *i915,
 		  struct drm_i915_query_item *query_item)
@@ -424,6 +567,7 @@ static int (* const i915_query_funcs[])(struct drm_i915_private *dev_priv,
 	query_topology_info,
 	query_engine_info,
 	query_perf_config,
+	query_cs_cycles,
 };
 
 int i915_query_ioctl(struct drm_device *dev, void *data, struct drm_file *file)
include/uapi/drm/i915_drm.h +47 -0

59 lines not on this page · raw message

Signature · 6 lines
2.20.1

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

[Intel-gfx] ✓ Fi.CI.BAT: success for i915/query: Correlate engine and cpu timestamps with better accuracy (rev2)

== Series Details ==

== Series Details ==

Series: i915/query: Correlate engine and cpu timestamps with better accuracy (rev2)
URL : https://patchwork.freedesktop.org/series/87552/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_9825 -> Patchwork_19753
====================================================

Summary
-------

**WARNING**

Minor unknown changes coming with Patchwork_19753 need to be verified manually.

If you think the reported changes have nothing to do with the changes introduced in Patchwork_19753, 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/Patchwork_19753/index.html

Possible new issues
-------------------

Here are the unknown changes that may have been introduced in Patchwork_19753:

### IGT changes ###

#### Warnings ####

* igt@i915_pm_rpm@module-reload:
- fi-glk-dsi: [DMESG-WARN][1] ([i915#1982]) -> [DMESG-WARN][2]
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9825/fi-glk-dsi/igt@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19753/fi-glk-dsi/igt@[email protected]

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

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

### IGT changes ###

#### Issues hit ####

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

* igt@kms_chamelium@dp-crc-fast:
- fi-kbl-7500u: [PASS][5] -> [FAIL][6] ([i915#1372])
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9825/fi-kbl-7500u/igt@[email protected]
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19753/fi-kbl-7500u/igt@[email protected]

* igt@runner@aborted:
- fi-bdw-5557u: NOTRUN -> [FAIL][7] ([i915#1602] / [i915#2029] / [i915#2369])
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19753/fi-bdw-5557u/igt@[email protected]

#### Possible fixes ####

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

[i915#1372]: https://gitlab.freedesktop.org/drm/intel/issues/1372
[i915#1602]: https://gitlab.freedesktop.org/drm/intel/issues/1602
[i915#1982]: https://gitlab.freedesktop.org/drm/intel/issues/1982
[i915#2029]: https://gitlab.freedesktop.org/drm/intel/issues/2029
[i915#2369]: https://gitlab.freedesktop.org/drm/intel/issues/2369
[i915#3145]: https://gitlab.freedesktop.org/drm/intel/issues/3145

Participating hosts (42 -> 36)
------------------------------

Missing (6): fi-ilk-m540 fi-hsw-4200u fi-bsw-n3050 fi-bsw-cyan fi-ctg-p8600 fi-bdw-samus

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

* Linux: CI_DRM_9825 -> Patchwork_19753

CI-20190529: 20190529
CI_DRM_9825: 51348fd0276ac3c65e3ba55c5639d26859cddfaa @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_6020: 8382d9e87bba39ecc6fa879b2491e28c7fb2e3c7 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_19753: 7cfab0e4392411c1d9cd3e0f54be8751d21da679 @ git://anongit.freedesktop.org/gfx-ci/linux

== Linux commits ==

7cfab0e43924 i915/query: Correlate engine and cpu timestamps with better accuracy

== Logs ==

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

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#2 lore raw
In reply to Umesh Nerlige Ramappa

Quoting Umesh Nerlige Ramappa (2021-03-03 21:28:00)

Quoted 96 lines

Perf measurements rely on CPU and engine timestamps to correlate events of interest across these time domains. Current mechanisms get these timestamps separately and the calculated delta between these timestamps lack enough accuracy.

To improve the accuracy of these time measurements to within a few us, add a query that returns the engine and cpu timestamps captured as close to each other as possible.

v2: (Tvrtko)
- document clock reference used
- return cpu timestamp always
- capture cpu time just before lower dword of cs timestamp

v3: (Chris)
- use uncore-rpm
- use __query_cs_timestamp helper

v4: (Lionel)
- Kernel perf subsytem allows users to specify the clock id to be used in perf_event_open. This clock id is used by the perf subsystem to return the appropriate cpu timestamp in perf events. Similarly, let the user pass the clockid to this query so that cpu timestamp corresponds to the clock id requested.

v5: (Tvrtko)
- Use normal ktime accessors instead of fast versions
- Add more uApi documentation

v6: (Lionel)
- Move switch out of spinlock

v7: (Chris)
- cs_timestamp is a misnomer, use cs_cycles instead
- return the cs cycle frequency as well in the query

v8:
- Add platform and engine specific checks

v9: (Lionel)
- Return 2 cpu timestamps in the query - captured before and after the register read

---
 drivers/gpu/drm/i915/i915_query.c | 144 ++++++++++++++++++++++++++++++
 include/uapi/drm/i915_drm.h       |  47 ++++++++++
 2 files changed, 191 insertions(+)
drivers/gpu/drm/i915/i915_query.c +32 -0
index fed337ad7b68..acca22ee6014 100644
@@ -6,6 +6,8 @@
 
 #include <linux/nospec.h>
 
+#include "gt/intel_engine_pm.h"
+#include "gt/intel_engine_user.h"
 #include "i915_drv.h"
 #include "i915_perf.h"
 #include "i915_query.h"
@@ -90,6 +92,147 @@ static int query_topology_info(struct drm_i915_private *dev_priv,
        return total_length;
 }
 
+typedef u64 (*__ktime_func_t)(void);
+static __ktime_func_t __clock_id_to_func(clockid_t clk_id)
+{
+       /*
+        * Use logic same as the perf subsystem to allow user to select the
+        * reference clock id to be used for timestamps.
+        */
+       switch (clk_id) {
+       case CLOCK_MONOTONIC:
+               return &ktime_get_ns;
+       case CLOCK_MONOTONIC_RAW:
+               return &ktime_get_raw_ns;
+       case CLOCK_REALTIME:
+               return &ktime_get_real_ns;
+       case CLOCK_BOOTTIME:
+               return &ktime_get_boottime_ns;
+       case CLOCK_TAI:
+               return &ktime_get_clocktai_ns;
+       default:
+               return NULL;
+       }
+}
+
+static inline int
+__read_timestamps(struct intel_uncore *uncore,
+                 i915_reg_t lower_reg,
+                 i915_reg_t upper_reg,
+                 u64 *cs_ts,
+                 u64 *cpu_ts,
+                 __ktime_func_t cpu_clock)

drivers/gpu/drm/i915/i915_query.c static int query_topology_info(struct drm_i915_private *dev_priv, · line 134

Quoted 10 lines
drivers/gpu/drm/i915/i915_query.c +10 -0
+{
+       u32 upper, lower, old_upper, loop = 0;
+
+       upper = intel_uncore_read_fw(uncore, upper_reg);
+       do {
+               cpu_ts[0] = cpu_clock();
+               lower = intel_uncore_read_fw(uncore, lower_reg);
+               cpu_ts[1] = cpu_clock();
+               old_upper = upper;
+               upper = intel_uncore_read_fw(uncore, upper_reg);

Both register reads comprise the timestamp returned to userspace, so presumably you want cpu_ts[] to wrap both.

       do {
               old_upper = upper;

               cpu_ts[0] = cpu_clock();
               lower = intel_uncore_read_fw(uncore, lower_reg);
               upper = intel_uncore_read_fw(uncore, upper_reg);
               cpu_ts[1] = cpu_clock();
       } while (upper != old_upper && loop++ < 2);

---------------------------------------------------------------------
Intel Corporation (UK) Limited
Registered No. 1134945 (England)
Registered Office: Pipers Way, Swindon SN3 1RJ
VAT No: 860 2173 47

This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#3 lore raw
Quoted 110 lines · Chris Wilson

Quoting Umesh Nerlige Ramappa (2021-03-03 21:28:00)

Quoted 96 lines

Perf measurements rely on CPU and engine timestamps to correlate events of interest across these time domains. Current mechanisms get these timestamps separately and the calculated delta between these timestamps lack enough accuracy.

To improve the accuracy of these time measurements to within a few us, add a query that returns the engine and cpu timestamps captured as close to each other as possible.

v2: (Tvrtko)
- document clock reference used
- return cpu timestamp always
- capture cpu time just before lower dword of cs timestamp

v3: (Chris)
- use uncore-rpm
- use __query_cs_timestamp helper

v4: (Lionel)
- Kernel perf subsytem allows users to specify the clock id to be used in perf_event_open. This clock id is used by the perf subsystem to return the appropriate cpu timestamp in perf events. Similarly, let the user pass the clockid to this query so that cpu timestamp corresponds to the clock id requested.

v5: (Tvrtko)
- Use normal ktime accessors instead of fast versions
- Add more uApi documentation

v6: (Lionel)
- Move switch out of spinlock

v7: (Chris)
- cs_timestamp is a misnomer, use cs_cycles instead
- return the cs cycle frequency as well in the query

v8:
- Add platform and engine specific checks

v9: (Lionel)
- Return 2 cpu timestamps in the query - captured before and after the register read

---
  drivers/gpu/drm/i915/i915_query.c | 144 ++++++++++++++++++++++++++++++
  include/uapi/drm/i915_drm.h       |  47 ++++++++++
  2 files changed, 191 insertions(+)
drivers/gpu/drm/i915/i915_query.c +32 -0
index fed337ad7b68..acca22ee6014 100644
@@ -6,6 +6,8 @@
 
  #include <linux/nospec.h>
 
+#include "gt/intel_engine_pm.h"
+#include "gt/intel_engine_user.h"
  #include "i915_drv.h"
  #include "i915_perf.h"
  #include "i915_query.h"
@@ -90,6 +92,147 @@ static int query_topology_info(struct drm_i915_private *dev_priv,
         return total_length;
  }
 
+typedef u64 (*__ktime_func_t)(void);
+static __ktime_func_t __clock_id_to_func(clockid_t clk_id)
+{
+       /*
+        * Use logic same as the perf subsystem to allow user to select the
+        * reference clock id to be used for timestamps.
+        */
+       switch (clk_id) {
+       case CLOCK_MONOTONIC:
+               return &ktime_get_ns;
+       case CLOCK_MONOTONIC_RAW:
+               return &ktime_get_raw_ns;
+       case CLOCK_REALTIME:
+               return &ktime_get_real_ns;
+       case CLOCK_BOOTTIME:
+               return &ktime_get_boottime_ns;
+       case CLOCK_TAI:
+               return &ktime_get_clocktai_ns;
+       default:
+               return NULL;
+       }
+}
+
+static inline int
+__read_timestamps(struct intel_uncore *uncore,
+                 i915_reg_t lower_reg,
+                 i915_reg_t upper_reg,
+                 u64 *cs_ts,
+                 u64 *cpu_ts,
+                 __ktime_func_t cpu_clock)

drivers/gpu/drm/i915/i915_query.c static int query_topology_info(struct drm_i915_private *dev_priv, · line 134

Quoted 10 lines
drivers/gpu/drm/i915/i915_query.c +10 -0
+{
+       u32 upper, lower, old_upper, loop = 0;
+
+       upper = intel_uncore_read_fw(uncore, upper_reg);
+       do {
+               cpu_ts[0] = cpu_clock();
+               lower = intel_uncore_read_fw(uncore, lower_reg);
+               cpu_ts[1] = cpu_clock();
+               old_upper = upper;
+               upper = intel_uncore_read_fw(uncore, upper_reg);

Both register reads comprise the timestamp returned to userspace, so presumably you want cpu_ts[] to wrap both.

Quoted 8 lines
        do {
                old_upper = upper;

                cpu_ts[0] = cpu_clock();
                lower = intel_uncore_read_fw(uncore, lower_reg);
                upper = intel_uncore_read_fw(uncore, upper_reg);
                cpu_ts[1] = cpu_clock();
        } while (upper != old_upper && loop++ < 2);

Actually if we want the best accuracy we can just deal with the lower dword.

We can check the upper one hasn't changed outside of the 2 cpu_clock() calls.

-Lionel

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#4 lore raw

Quoting Lionel Landwerlin (2021-03-04 08:28:59)

Quoted 114 lines · Chris Wilson
Quoted 113 lines

Quoting Umesh Nerlige Ramappa (2021-03-03 21:28:00)

Quoted 96 lines

Perf measurements rely on CPU and engine timestamps to correlate events of interest across these time domains. Current mechanisms get these timestamps separately and the calculated delta between these timestamps lack enough accuracy.

To improve the accuracy of these time measurements to within a few us, add a query that returns the engine and cpu timestamps captured as close to each other as possible.

v2: (Tvrtko)
- document clock reference used
- return cpu timestamp always
- capture cpu time just before lower dword of cs timestamp

v3: (Chris)
- use uncore-rpm
- use __query_cs_timestamp helper

v4: (Lionel)
- Kernel perf subsytem allows users to specify the clock id to be used in perf_event_open. This clock id is used by the perf subsystem to return the appropriate cpu timestamp in perf events. Similarly, let the user pass the clockid to this query so that cpu timestamp corresponds to the clock id requested.

v5: (Tvrtko)
- Use normal ktime accessors instead of fast versions
- Add more uApi documentation

v6: (Lionel)
- Move switch out of spinlock

v7: (Chris)
- cs_timestamp is a misnomer, use cs_cycles instead
- return the cs cycle frequency as well in the query

v8:
- Add platform and engine specific checks

v9: (Lionel)
- Return 2 cpu timestamps in the query - captured before and after the register read

---
  drivers/gpu/drm/i915/i915_query.c | 144 ++++++++++++++++++++++++++++++
  include/uapi/drm/i915_drm.h       |  47 ++++++++++
  2 files changed, 191 insertions(+)
drivers/gpu/drm/i915/i915_query.c +32 -0
index fed337ad7b68..acca22ee6014 100644
@@ -6,6 +6,8 @@
 
  #include <linux/nospec.h>
 
+#include "gt/intel_engine_pm.h"
+#include "gt/intel_engine_user.h"
  #include "i915_drv.h"
  #include "i915_perf.h"
  #include "i915_query.h"
@@ -90,6 +92,147 @@ static int query_topology_info(struct drm_i915_private *dev_priv,
         return total_length;
  }
 
+typedef u64 (*__ktime_func_t)(void);
+static __ktime_func_t __clock_id_to_func(clockid_t clk_id)
+{
+       /*
+        * Use logic same as the perf subsystem to allow user to select the
+        * reference clock id to be used for timestamps.
+        */
+       switch (clk_id) {
+       case CLOCK_MONOTONIC:
+               return &ktime_get_ns;
+       case CLOCK_MONOTONIC_RAW:
+               return &ktime_get_raw_ns;
+       case CLOCK_REALTIME:
+               return &ktime_get_real_ns;
+       case CLOCK_BOOTTIME:
+               return &ktime_get_boottime_ns;
+       case CLOCK_TAI:
+               return &ktime_get_clocktai_ns;
+       default:
+               return NULL;
+       }
+}
+
+static inline int
+__read_timestamps(struct intel_uncore *uncore,
+                 i915_reg_t lower_reg,
+                 i915_reg_t upper_reg,
+                 u64 *cs_ts,
+                 u64 *cpu_ts,
+                 __ktime_func_t cpu_clock)

drivers/gpu/drm/i915/i915_query.c static int query_topology_info(struct drm_i915_private *dev_priv, · line 134

Quoted 10 lines
drivers/gpu/drm/i915/i915_query.c +10 -0
+{
+       u32 upper, lower, old_upper, loop = 0;
+
+       upper = intel_uncore_read_fw(uncore, upper_reg);
+       do {
+               cpu_ts[0] = cpu_clock();
+               lower = intel_uncore_read_fw(uncore, lower_reg);
+               cpu_ts[1] = cpu_clock();
+               old_upper = upper;
+               upper = intel_uncore_read_fw(uncore, upper_reg);

Both register reads comprise the timestamp returned to userspace, so presumably you want cpu_ts[] to wrap both.

        do {
                old_upper = upper;
Quoted 7 lines
Quoted 5 lines
                cpu_ts[0] = cpu_clock();
                lower = intel_uncore_read_fw(uncore, lower_reg);
                upper = intel_uncore_read_fw(uncore, upper_reg);
                cpu_ts[1] = cpu_clock();
        } while (upper != old_upper && loop++ < 2);

Actually if we want the best accuracy we can just deal with the lower dword.

Accuracy of what? The lower dword read perhaps, or the accuracy of the sample point for the combined reads for the timestamp, which is closer to an external observer (cpu_clock() implies reference to an external observer).

The two clock samples are not even necessarily closely related due to the nmi adjustments. If you wanted an unadjusted elapsed time for the read you can use local_clock() then return the chosen cpu_clock() before plus the elapsed delta from around the read as the estimated error.

cpu_ts[1] = local_clock();
cpu_ts[0] = cpu_clock();
lower = intel_uncore_read_fw(uncore, lower_reg);
cpu_ts[1] = local_clock() - cpu_ts[1];
-Chris
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#5 lore raw
Quoted 131 lines · Chris Wilson

Quoting Lionel Landwerlin (2021-03-04 08:28:59)

Quoted 114 lines · Chris Wilson
Quoted 113 lines

Quoting Umesh Nerlige Ramappa (2021-03-03 21:28:00)

Quoted 96 lines

Perf measurements rely on CPU and engine timestamps to correlate events of interest across these time domains. Current mechanisms get these timestamps separately and the calculated delta between these timestamps lack enough accuracy.

To improve the accuracy of these time measurements to within a few us, add a query that returns the engine and cpu timestamps captured as close to each other as possible.

v2: (Tvrtko)
- document clock reference used
- return cpu timestamp always
- capture cpu time just before lower dword of cs timestamp

v3: (Chris)
- use uncore-rpm
- use __query_cs_timestamp helper

v4: (Lionel)
- Kernel perf subsytem allows users to specify the clock id to be used in perf_event_open. This clock id is used by the perf subsystem to return the appropriate cpu timestamp in perf events. Similarly, let the user pass the clockid to this query so that cpu timestamp corresponds to the clock id requested.

v5: (Tvrtko)
- Use normal ktime accessors instead of fast versions
- Add more uApi documentation

v6: (Lionel)
- Move switch out of spinlock

v7: (Chris)
- cs_timestamp is a misnomer, use cs_cycles instead
- return the cs cycle frequency as well in the query

v8:
- Add platform and engine specific checks

v9: (Lionel)
- Return 2 cpu timestamps in the query - captured before and after the register read

---
   drivers/gpu/drm/i915/i915_query.c | 144 ++++++++++++++++++++++++++++++
   include/uapi/drm/i915_drm.h       |  47 ++++++++++
   2 files changed, 191 insertions(+)
drivers/gpu/drm/i915/i915_query.c +32 -0
index fed337ad7b68..acca22ee6014 100644
@@ -6,6 +6,8 @@
 
   #include <linux/nospec.h>
 
+#include "gt/intel_engine_pm.h"
+#include "gt/intel_engine_user.h"
   #include "i915_drv.h"
   #include "i915_perf.h"
   #include "i915_query.h"
@@ -90,6 +92,147 @@ static int query_topology_info(struct drm_i915_private *dev_priv,
          return total_length;
   }
 
+typedef u64 (*__ktime_func_t)(void);
+static __ktime_func_t __clock_id_to_func(clockid_t clk_id)
+{
+       /*
+        * Use logic same as the perf subsystem to allow user to select the
+        * reference clock id to be used for timestamps.
+        */
+       switch (clk_id) {
+       case CLOCK_MONOTONIC:
+               return &ktime_get_ns;
+       case CLOCK_MONOTONIC_RAW:
+               return &ktime_get_raw_ns;
+       case CLOCK_REALTIME:
+               return &ktime_get_real_ns;
+       case CLOCK_BOOTTIME:
+               return &ktime_get_boottime_ns;
+       case CLOCK_TAI:
+               return &ktime_get_clocktai_ns;
+       default:
+               return NULL;
+       }
+}
+
+static inline int
+__read_timestamps(struct intel_uncore *uncore,
+                 i915_reg_t lower_reg,
+                 i915_reg_t upper_reg,
+                 u64 *cs_ts,
+                 u64 *cpu_ts,
+                 __ktime_func_t cpu_clock)

drivers/gpu/drm/i915/i915_query.c static int query_topology_info(struct drm_i915_private *dev_priv, · line 134

Quoted 10 lines
drivers/gpu/drm/i915/i915_query.c +10 -0
+{
+       u32 upper, lower, old_upper, loop = 0;
+
+       upper = intel_uncore_read_fw(uncore, upper_reg);
+       do {
+               cpu_ts[0] = cpu_clock();
+               lower = intel_uncore_read_fw(uncore, lower_reg);
+               cpu_ts[1] = cpu_clock();
+               old_upper = upper;
+               upper = intel_uncore_read_fw(uncore, upper_reg);

Both register reads comprise the timestamp returned to userspace, so presumably you want cpu_ts[] to wrap both.

         do {
                 old_upper = upper;
Quoted 6 lines
Quoted 5 lines
                 cpu_ts[0] = cpu_clock();
                 lower = intel_uncore_read_fw(uncore, lower_reg);
                 upper = intel_uncore_read_fw(uncore, upper_reg);
                 cpu_ts[1] = cpu_clock();
         } while (upper != old_upper && loop++ < 2);

Actually if we want the best accuracy we can just deal with the lower dword.

Accuracy of what? The lower dword read perhaps, or the accuracy of the sample point for the combined reads for the timestamp, which is closer to an external observer (cpu_clock() implies reference to an external observer).

The two clock samples are not even necessarily closely related due to the nmi adjustments. If you wanted an unadjusted elapsed time for the read you can use local_clock() then return the chosen cpu_clock() before plus the elapsed delta from around the read as the estimated error.

Quoted 5 lines

cpu_ts[1] = local_clock();
cpu_ts[0] = cpu_clock();
lower = intel_uncore_read_fw(uncore, lower_reg);
cpu_ts[1] = local_clock() - cpu_ts[1];
-Chris

Thanks,

I meant the accuracy of having 2 samples GPU/CPU as close as possible.

Avoiding to account another register read in there is nice.

My testing was also mostly done with CLOCK_MONOTONIC_RAW which doesn't seem to be adjusted like CLOCK_MONOTONIC so maybe that why I didn't see the issue.

-Lionel

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#6 lore raw

Quoting Lionel Landwerlin (2021-03-04 09:45:47)

Quoted 141 lines · Chris Wilson
Quoted 131 lines

Quoting Lionel Landwerlin (2021-03-04 08:28:59)

Quoted 114 lines · Chris Wilson
Quoted 113 lines

Quoting Umesh Nerlige Ramappa (2021-03-03 21:28:00)

Quoted 96 lines

Perf measurements rely on CPU and engine timestamps to correlate events of interest across these time domains. Current mechanisms get these timestamps separately and the calculated delta between these timestamps lack enough accuracy.

To improve the accuracy of these time measurements to within a few us, add a query that returns the engine and cpu timestamps captured as close to each other as possible.

v2: (Tvrtko)
- document clock reference used
- return cpu timestamp always
- capture cpu time just before lower dword of cs timestamp

v3: (Chris)
- use uncore-rpm
- use __query_cs_timestamp helper

v4: (Lionel)
- Kernel perf subsytem allows users to specify the clock id to be used in perf_event_open. This clock id is used by the perf subsystem to return the appropriate cpu timestamp in perf events. Similarly, let the user pass the clockid to this query so that cpu timestamp corresponds to the clock id requested.

v5: (Tvrtko)
- Use normal ktime accessors instead of fast versions
- Add more uApi documentation

v6: (Lionel)
- Move switch out of spinlock

v7: (Chris)
- cs_timestamp is a misnomer, use cs_cycles instead
- return the cs cycle frequency as well in the query

v8:
- Add platform and engine specific checks

v9: (Lionel)
- Return 2 cpu timestamps in the query - captured before and after the register read

---
   drivers/gpu/drm/i915/i915_query.c | 144 ++++++++++++++++++++++++++++++
   include/uapi/drm/i915_drm.h       |  47 ++++++++++
   2 files changed, 191 insertions(+)
drivers/gpu/drm/i915/i915_query.c +32 -0
index fed337ad7b68..acca22ee6014 100644
@@ -6,6 +6,8 @@
 
   #include <linux/nospec.h>
 
+#include "gt/intel_engine_pm.h"
+#include "gt/intel_engine_user.h"
   #include "i915_drv.h"
   #include "i915_perf.h"
   #include "i915_query.h"
@@ -90,6 +92,147 @@ static int query_topology_info(struct drm_i915_private *dev_priv,
          return total_length;
   }
 
+typedef u64 (*__ktime_func_t)(void);
+static __ktime_func_t __clock_id_to_func(clockid_t clk_id)
+{
+       /*
+        * Use logic same as the perf subsystem to allow user to select the
+        * reference clock id to be used for timestamps.
+        */
+       switch (clk_id) {
+       case CLOCK_MONOTONIC:
+               return &ktime_get_ns;
+       case CLOCK_MONOTONIC_RAW:
+               return &ktime_get_raw_ns;
+       case CLOCK_REALTIME:
+               return &ktime_get_real_ns;
+       case CLOCK_BOOTTIME:
+               return &ktime_get_boottime_ns;
+       case CLOCK_TAI:
+               return &ktime_get_clocktai_ns;
+       default:
+               return NULL;
+       }
+}
+
+static inline int
+__read_timestamps(struct intel_uncore *uncore,
+                 i915_reg_t lower_reg,
+                 i915_reg_t upper_reg,
+                 u64 *cs_ts,
+                 u64 *cpu_ts,
+                 __ktime_func_t cpu_clock)

drivers/gpu/drm/i915/i915_query.c static int query_topology_info(struct drm_i915_private *dev_priv, · line 134

Quoted 10 lines
drivers/gpu/drm/i915/i915_query.c +10 -0
+{
+       u32 upper, lower, old_upper, loop = 0;
+
+       upper = intel_uncore_read_fw(uncore, upper_reg);
+       do {
+               cpu_ts[0] = cpu_clock();
+               lower = intel_uncore_read_fw(uncore, lower_reg);
+               cpu_ts[1] = cpu_clock();
+               old_upper = upper;
+               upper = intel_uncore_read_fw(uncore, upper_reg);

Both register reads comprise the timestamp returned to userspace, so presumably you want cpu_ts[] to wrap both.

         do {
                 old_upper = upper;
Quoted 6 lines
Quoted 5 lines
                 cpu_ts[0] = cpu_clock();
                 lower = intel_uncore_read_fw(uncore, lower_reg);
                 upper = intel_uncore_read_fw(uncore, upper_reg);
                 cpu_ts[1] = cpu_clock();
         } while (upper != old_upper && loop++ < 2);

Actually if we want the best accuracy we can just deal with the lower dword.

Accuracy of what? The lower dword read perhaps, or the accuracy of the sample point for the combined reads for the timestamp, which is closer to an external observer (cpu_clock() implies reference to an external observer).

The two clock samples are not even necessarily closely related due to the nmi adjustments. If you wanted an unadjusted elapsed time for the read you can use local_clock() then return the chosen cpu_clock() before plus the elapsed delta from around the read as the estimated error.

Quoted 5 lines

cpu_ts[1] = local_clock();
cpu_ts[0] = cpu_clock();
lower = intel_uncore_read_fw(uncore, lower_reg);
cpu_ts[1] = local_clock() - cpu_ts[1];
-Chris

Thanks,

Quoted 8 lines

I meant the accuracy of having 2 samples GPU/CPU as close as possible.

Avoiding to account another register read in there is nice.

My testing was also mostly done with CLOCK_MONOTONIC_RAW which doesn't seem to be adjusted like CLOCK_MONOTONIC so maybe that why I didn't see the issue.

_RAW is still adjusted for skews, just not coupled into the ntp feedback. That is less obvious than the other clocks, and why it's preferred for comparing against other HW sources. But two reads of _RAW are only monotonic, not necessarily on the same time base. local_clock() is tsc/arat, so counting the CPU cycles between the two reads with the frequency (at least on x86) held constant (and arat should be frequency invariant).

If we want much better accuracy, we are supposed to use cyclecounter_t and the system_device_crosststamp.
-Chris
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#7 lore raw
Quoted 35 lines · Chris Wilson
Quoted 19 lines
Quoted 11 lines
Quoted 1 line

Actually if we want the best accuracy we can just deal with the lower dword.

Accuracy of what? The lower dword read perhaps, or the accuracy of the sample point for the combined reads for the timestamp, which is closer to an external observer (cpu_clock() implies reference to an external observer).

The two clock samples are not even necessarily closely related due to the nmi adjustments. If you wanted an unadjusted elapsed time for the read you can use local_clock() then return the chosen cpu_clock() before plus the elapsed delta from around the read as the estimated error.

Quoted 5 lines

cpu_ts[1] = local_clock();
cpu_ts[0] = cpu_clock();
lower = intel_uncore_read_fw(uncore, lower_reg);
cpu_ts[1] = local_clock() - cpu_ts[1];
-Chris

Thanks,

Quoted 8 lines

I meant the accuracy of having 2 samples GPU/CPU as close as possible.

Avoiding to account another register read in there is nice.

My testing was also mostly done with CLOCK_MONOTONIC_RAW which doesn't seem to be adjusted like CLOCK_MONOTONIC so maybe that why I didn't see the issue.

_RAW is still adjusted for skews, just not coupled into the ntp feedback. That is less obvious than the other clocks, and why it's preferred for comparing against other HW sources. But two reads of _RAW are only monotonic, not necessarily on the same time base. local_clock() is tsc/arat, so counting the CPU cycles between the two reads with the frequency (at least on x86) held constant (and arat should be frequency invariant).

Quoted 3 lines

If we want much better accuracy, we are supposed to use cyclecounter_t and the system_device_crosststamp.
-Chris

Thanks for the pointers.

I think people are mostly trying to map what's coming out of OA or queries from the various command streamers back to perf/ftrace.

As far I know perf will only let you select a clockid.

So maybe cyclecounter_t is not that useful atm.

-Lionel

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#8 lore raw

[Intel-gfx] ✗ Fi.CI.IGT: failure for i915/query: Correlate engine and cpu timestamps with better accuracy (rev2)

In reply to Umesh Nerlige Ramappa
== Series Details ==

== Series Details ==

Series: i915/query: Correlate engine and cpu timestamps with better accuracy (rev2)
URL : https://patchwork.freedesktop.org/series/87552/
State : failure

== Summary ==

CI Bug Log - changes from CI_DRM_9825_full -> Patchwork_19753_full
====================================================

Summary
-------

**FAILURE**

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

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

Possible new issues
-------------------

Here are the unknown changes that may have been introduced in Patchwork_19753_full:

### IGT changes ###

#### Possible regressions ####

* igt@gem_mmap_gtt@cpuset-big-copy:
- shard-iclb: [PASS][1] -> [FAIL][2]
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9825/shard-iclb8/igt@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19753/shard-iclb8/igt@[email protected]

#### Warnings ####

* igt@kms_content_protection@mei_interface:
- shard-iclb: [SKIP][3] ([fdo#109300] / [fdo#111066]) -> [FAIL][4] +2 similar issues
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9825/shard-iclb7/igt@kms_content_protection@mei_interface.html
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19753/shard-iclb1/igt@kms_content_protection@mei_interface.html

* igt@runner@aborted:
- shard-skl: ([FAIL][5], [FAIL][6], [FAIL][7], [FAIL][8], [FAIL][9], [FAIL][10], [FAIL][11], [FAIL][12]) ([i915#1814] / [i915#2029] / [i915#2426] / [i915#2724] / [i915#3002]) -> ([FAIL][13], [FAIL][14], [FAIL][15], [FAIL][16]) ([i915#2724] / [i915#3002])
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9825/shard-skl5/igt@[email protected]
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9825/shard-skl7/igt@[email protected]
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9825/shard-skl3/igt@[email protected]
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9825/shard-skl1/igt@[email protected]
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9825/shard-skl3/igt@[email protected]
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9825/shard-skl6/igt@[email protected]
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9825/shard-skl8/igt@[email protected]
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9825/shard-skl5/igt@[email protected]
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19753/shard-skl1/igt@[email protected]
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19753/shard-skl5/igt@[email protected]
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19753/shard-skl3/igt@[email protected]
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19753/shard-skl2/igt@[email protected]

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

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

### IGT changes ###

#### Issues hit ####

* igt@feature_discovery@psr2:
- shard-iclb: [PASS][17] -> [SKIP][18] ([i915#658])
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9825/shard-iclb2/igt@[email protected]
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19753/shard-iclb5/igt@[email protected]

* igt@gem_ctx_persistence@legacy-engines-persistence:
- shard-snb: NOTRUN -> [SKIP][19] ([fdo#109271] / [i915#1099]) +4 similar issues
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19753/shard-snb2/igt@[email protected]

* igt@gem_exec_balancer@hang:
- shard-iclb: [PASS][20] -> [INCOMPLETE][21] ([i915#1895] / [i915#3031])
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9825/shard-iclb7/igt@[email protected]
[21]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19753/shard-iclb1/igt@[email protected]

* igt@gem_exec_fair@basic-none-vip@rcs0:
- shard-glk: [PASS][22] -> [FAIL][23] ([i915#2842]) +1 similar issue
[22]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9825/shard-glk5/igt@gem_exec_fair@[email protected]
[23]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19753/shard-glk1/igt@gem_exec_fair@[email protected]

* igt@gem_exec_fair@basic-pace@vcs0:
- shard-kbl: [PASS][24] -> [FAIL][25] ([i915#2842])
[24]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9825/shard-kbl7/igt@gem_exec_fair@[email protected]
[25]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19753/shard-kbl3/igt@gem_exec_fair@[email protected]
- shard-tglb: [PASS][26] -> [FAIL][27] ([i915#2842])
[26]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9825/shard-tglb7/igt@gem_exec_fair@[email protected]
[27]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19753/shard-tglb2/igt@gem_exec_fair@[email protected]

* igt@gem_exec_reloc@basic-wide-active@rcs0:
- shard-kbl: NOTRUN -> [FAIL][28] ([i915#2389]) +4 similar issues
[28]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19753/shard-kbl2/igt@gem_exec_reloc@[email protected]

* igt@gem_exec_schedule@u-fairslice@rcs0:
- shard-glk: [PASS][29] -> [DMESG-WARN][30] ([i915#1610] / [i915#2803])
[29]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9825/shard-glk8/igt@gem_exec_schedule@[email protected]
[30]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19753/shard-glk8/igt@gem_exec_schedule@[email protected]
- shard-tglb: [PASS][31] -> [DMESG-WARN][32] ([i915#2803])
[31]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9825/shard-tglb8/igt@gem_exec_schedule@[email protected]
[32]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19753/shard-tglb2/igt@gem_exec_schedule@[email protected]

* igt@gem_exec_whisper@basic-forked:
- shard-glk: [PASS][33] -> [DMESG-WARN][34] ([i915#118] / [i915#95])
[33]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9825/shard-glk8/igt@[email protected]
[34]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19753/shard-glk8/igt@[email protected]

* igt@gem_huc_copy@huc-copy:
- shard-apl: NOTRUN -> [SKIP][35] ([fdo#109271] / [i915#2190])
[35]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19753/shard-apl2/igt@[email protected]

* igt@gem_pwrite@basic-exhaustion:
- shard-snb: NOTRUN -> [WARN][36] ([i915#2658])
[36]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19753/shard-snb5/igt@[email protected]

* igt@gem_userptr_blits@input-checking:
- shard-apl: NOTRUN -> [DMESG-WARN][37] ([i915#3002])
[37]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19753/shard-apl7/igt@[email protected]
- shard-snb: NOTRUN -> [DMESG-WARN][38] ([i915#3002])
[38]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19753/shard-snb6/igt@[email protected]

* igt@i915_pm_dc@dc6-dpms:
- shard-skl: NOTRUN -> [FAIL][39] ([i915#454])
[39]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19753/shard-skl9/igt@[email protected]

* igt@i915_pm_lpsp@kms-lpsp@kms-lpsp-dp:
- shard-kbl: NOTRUN -> [SKIP][40] ([fdo#109271] / [i915#1937])
[40]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19753/shard-kbl2/igt@i915_pm_lpsp@[email protected]

* igt@kms_big_joiner@invalid-modeset:
- shard-apl: NOTRUN -> [SKIP][41] ([fdo#109271] / [i915#2705])
[41]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19753/shard-apl2/igt@[email protected]

* igt@kms_chamelium@vga-edid-read:
- shard-apl: NOTRUN -> [SKIP][42] ([fdo#109271] / [fdo#111827]) +17 similar issues
[42]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19753/shard-apl7/igt@[email protected]

* igt@kms_color_chamelium@pipe-b-ctm-0-25:
- shard-kbl: NOTRUN -> [SKIP][43] ([fdo#109271] / [fdo#111827]) +2 similar issues
[43]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19753/shard-kbl2/igt@[email protected]

* igt@kms_color_chamelium@pipe-invalid-ctm-matrix-sizes:
- shard-skl: NOTRUN -> [SKIP][44] ([fdo#109271] / [fdo#111827]) +17 similar issues
[44]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19753/shard-skl4/igt@[email protected]
- shard-snb: NOTRUN -> [SKIP][45] ([fdo#109271] / [fdo#111827]) +14 similar issues
[45]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19753/shard-snb5/igt@[email protected]

* igt@kms_content_protection@lic:
- shard-apl: NOTRUN -> [TIMEOUT][46] ([i915#1319]) +1 similar issue
[46]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19753/shard-apl2/igt@[email protected]

* igt@kms_cursor_crc@pipe-c-cursor-suspend:
- shard-kbl: [PASS][47] -> [DMESG-WARN][48] ([i915#180]) +1 similar issue
[47]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9825/shard-kbl3/igt@[email protected]
[48]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19753/shard-kbl6/igt@[email protected]

* igt@kms_cursor_legacy@flip-vs-cursor-busy-crc-atomic:
- shard-skl: NOTRUN -> [DMESG-FAIL][49] ([IGT#6] / [i915#1982])
[49]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19753/shard-skl9/igt@[email protected]

* igt@kms_draw_crc@draw-method-xrgb8888-render-ytiled:
- shard-snb: NOTRUN -> [SKIP][50] ([fdo#109271]) +273 similar issues
[50]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19753/shard-snb5/igt@[email protected]

* igt@kms_flip@2x-busy-flip:
- shard-kbl: NOTRUN -> [SKIP][51] ([fdo#109271]) +37 similar issues
[51]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19753/shard-kbl2/igt@[email protected]

* igt@kms_flip@flip-vs-expired-vblank-interruptible@b-edp1:
- shard-skl: [PASS][52] -> [FAIL][53] ([i915#79]) +2 similar issues
[52]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9825/shard-skl5/igt@kms_flip@[email protected]
[53]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19753/shard-skl10/igt@kms_flip@[email protected]

* igt@kms_flip@flip-vs-expired-vblank@a-dp1:
- shard-apl: [PASS][54] -> [FAIL][55] ([i915#79])
[54]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9825/shard-apl8/igt@kms_flip@[email protected]
[55]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19753/shard-apl3/igt@kms_flip@[email protected]

* igt@kms_flip@flip-vs-suspend-interruptible@c-dp1:
- shard-apl: [PASS][56] -> [DMESG-WARN][57] ([i915#180]) +2 similar issues
[56]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9825/shard-apl2/igt@kms_flip@[email protected]
[57]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19753/shard-apl7/igt@kms_flip@[email protected]

* igt@kms_flip_scaled_crc@flip-32bpp-ytile-to-32bpp-ytileccs:
- shard-kbl: NOTRUN -> [FAIL][58] ([i915#2641])
[58]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19753/shard-kbl2/igt@[email protected]

* igt@kms_flip_scaled_crc@flip-32bpp-ytileccs-to-64bpp-ytile:
- shard-apl: NOTRUN -> [SKIP][59] ([fdo#109271] / [i915#2642])
[59]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19753/shard-apl1/igt@[email protected]

* igt@kms_frontbuffer_tracking@fbc-2p-scndscrn-pri-indfb-draw-blt:
- shard-skl: NOTRUN -> [SKIP][60] ([fdo#109271]) +129 similar issues
[60]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19753/shard-skl9/igt@[email protected]

* igt@kms_frontbuffer_tracking@psr-1p-primscrn-pri-shrfb-draw-render:
- shard-skl: NOTRUN -> [FAIL][61] ([i915#49])
[61]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19753/shard-skl4/igt@kms_frontbuffer_tracking@psr-1p-primscrn-pri-shrfb-draw-render.html

* igt@kms_hdr@bpc-switch-suspend:
- shard-apl: NOTRUN -> [DMESG-WARN][62] ([i915#180])
[62]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19753/shard-apl1/igt@[email protected]

* igt@kms_pipe_crc_basic@nonblocking-crc-pipe-d-frame-sequence:
- shard-skl: NOTRUN -> [SKIP][63] ([fdo#109271] / [i915#533])
[63]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19753/shard-skl4/igt@[email protected]

* igt@kms_plane_alpha_blend@pipe-a-alpha-opaque-fb:
- shard-apl: NOTRUN -> [FAIL][64] ([fdo#108145] / [i915#265]) +1 similar issue
[64]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19753/shard-apl7/igt@[email protected]

* igt@kms_plane_alpha_blend@pipe-a-alpha-transparent-fb:
- shard-kbl: NOTRUN -> [FAIL][65] ([i915#265])
[65]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19753/shard-kbl2/igt@[email protected]

* igt@kms_plane_alpha_blend@pipe-c-alpha-transparent-fb:
- shard-apl: NOTRUN -> [FAIL][66] ([i915#265])
[66]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19753/shard-apl1/igt@[email protected]

* igt@kms_plane_alpha_blend@pipe-c-constant-alpha-max:
- shard-skl: NOTRUN -> [FAIL][67] ([fdo#108145] / [i915#265]) +3 similar issues
[67]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19753/shard-skl10/igt@[email protected]

* igt@kms_psr2_sf@overlay-primary-update-sf-dmg-area-3:
- shard-apl: NOTRUN -> [SKIP][68] ([fdo#109271] / [i915#658]) +2 similar issues
[68]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19753/shard-apl7/igt@[email protected]

* igt@kms_psr2_su@frontbuffer:
- shard-skl: NOTRUN -> [SKIP][69] ([fdo#109271] / [i915#658]) +3 similar issues
[69]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19753/shard-skl9/igt@[email protected]

* igt@kms_psr@psr2_cursor_render:
- shard-iclb: [PASS][70] -> [SKIP][71] ([fdo#109441]) +2 similar issues
[70]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9825/shard-iclb2/igt@kms_psr@psr2_cursor_render.html
[71]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19753/shard-iclb6/igt@kms_psr@psr2_cursor_render.html

* igt@kms_sysfs_edid_timing:
- shard-skl: NOTRUN -> [FAIL][72] ([IGT#2])
[72]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19753/shard-skl4/igt@kms_sysfs_edid_timing.html

* igt@kms_vblank@pipe-a-ts-continuation-suspend:
- shard-kbl: [PASS][73] -> [DMESG-WARN][74] ([i915#180] / [i915#295])
[73]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9825/shard-kbl2/igt@[email protected]
[74]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19753/shard-kbl6/igt@[email protected]

* igt@kms_vblank@pipe-d-wait-forked-hang:
- shard-apl: NOTRUN -> [SKIP][75] ([fdo#109271]) +161 similar issues
[75]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19753/shard-apl1/igt@[email protected]

* igt@kms_vblank@pipe-d-wait-idle:
- shard-apl: NOTRUN -> [SKIP][76] ([fdo#109271] / [i915#533]) +2 similar issues
[76]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19753/shard-apl1/igt@[email protected]

* igt@kms_writeback@writeback-check-output:
- shard-skl: NOTRUN -> [SKIP][77] ([fdo#109271] / [i915#2437])
[77]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19753/shard-skl8/igt@[email protected]

* igt@perf@polling-parameterized:
- shard-skl: NOTRUN -> [FAIL][78] ([i915#1542])
[78]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19753/shard-skl9/igt@[email protected]

* igt@sysfs_clients@busy@bcs0:
- shard-kbl: [PASS][79] -> [FAIL][80] ([i915#3009])
[79]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9825/shard-kbl4/igt@sysfs_clients@[email protected]
[80]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19753/shard-kbl1/igt@sysfs_clients@[email protected]

* igt@sysfs_clients@busy@vecs0:
- shard-apl: [PASS][81] -> [FAIL][82] ([i915#3019])
[81]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9825/shard-apl8/igt@sysfs_clients@[email protected]
[82]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19753/shard-apl3/igt@sysfs_clients@[email protected]

* igt@sysfs_clients@recycle-many:
- shard-iclb: [PASS][83] -> [FAIL][84] ([i915#3028])
[83]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9825/shard-iclb2/igt@[email protected]
[84]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19753/shard-iclb6/igt@[email protected]

* igt@sysfs_clients@split-10@bcs0:
- shard-apl: NOTRUN -> [SKIP][85] ([fdo#109271] / [i915#3026])
[85]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19753/shard-apl6/igt@sysfs_clients@[email protected]

#### Possible fixes ####

* igt@gem_exec_fair@basic-pace-share@rcs0:
- shard-tglb: [FAIL][86] ([i915#2842]) -> [PASS][87]
[86]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9825/shard-tglb1/igt@gem_exec_fair@[email protected]
[87]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19753/shard-tglb1/igt@gem_exec_fair@[email protected]

* igt@gem_exec_fair@basic-pace@vcs0:
- shard-glk: [FAIL][88] ([i915#2842]) -> [PASS][89]
[88]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9825/shard-glk4/igt@gem_exec_fair@[email protected]
[89]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19753/shard-glk8/igt@gem_exec_fair@[email protected]

* igt@gem_exec_fair@basic-pace@vecs0:
- shard-kbl: [FAIL][90] ([i915#2842]) -> [PASS][91]
[90]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9825/shard-kbl7/igt@gem_exec_fair@[email protected]
[91]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19753/shard-kbl3/igt@gem_exec_fair@[email protected]

* igt@gem_exec_schedule@u-fairslice@vecs0:
- shard-skl: [DMESG-WARN][92] ([i915#1610] / [i915#2803]) -> [PASS][93]
[92]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9825/shard-skl7/igt@gem_exec_schedule@[email protected]
[93]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19753/shard-skl8/igt@gem_exec_schedule@[email protected]

* igt@gem_exec_whisper@basic-queues-forked-all:
- shard-glk: [DMESG-WARN][94] ([i915#118] / [i915#95]) -> [PASS][95] +4 similar issues
[94]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9825/shard-glk1/igt@[email protected]
[95]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19753/shard-glk1/igt@[email protected]

* igt@gem_workarounds@suspend-resume-context:
- shard-apl: [DMESG-WARN][96] ([i915#180]) -> [PASS][97] +1 similar issue
[96]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9825/shard-apl7/igt@[email protected]
[97]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19753/shard-apl2/igt@[email protected]

* igt@i915_suspend@fence-restore-tiled2untiled:
- shard-skl: [INCOMPLETE][98] ([i915#198]) -> [PASS][99]
[98]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9825/shard-skl3/igt@[email protected]
[99]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19753/shard-skl4/igt@[email protected]

* igt@kms_cursor_crc@pipe-c-cursor-64x64-offscreen:
- shard-skl: [FAIL][100] ([i915#54]) -> [PASS][101]
[100]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9825/shard-skl5/igt@[email protected]
[101]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19753/shard-skl4/igt@[email protected]

* igt@kms_cursor_edge_walk@pipe-a-128x128-left-edge:
- shard-glk: [DMESG-FAIL][102] ([i915#118] / [i915#70] / [i915#95]) -> [PASS][103]
[102]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9825/shard-glk8/igt@[email protected]
[103]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19753/shard-glk8/igt@[email protected]

* igt@kms_flip@flip-vs-suspend@b-edp1:
- shard-skl: [INCOMPLETE][104] ([i915#146] / [i915#198]) -> [PASS][105]
[104]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9825/shard-skl1/igt@kms_flip@[email protected]
[105]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19753/shard-skl1/igt@kms_flip@[email protected]

* igt@kms_plane@plane-panning-bottom-right-suspend-pipe-b-planes:
- shard-kbl: [DMESG-WARN][106] ([i915#180]) -> [PASS][107]
[106]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9825/shard-kbl6/igt@[email protected]
[107]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19753/shard-kbl2/igt@[email protected]

* igt@kms_plane_lowres@pipe-a-tiling-x:
- shard-glk: [DMESG-FAIL][108] ([i915#118] / [i915#95]) -> [PASS][109]
[108]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9825/shard-glk3/igt@[email protected]
[109]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19753/shard-glk6/igt@[email protected]

* igt@kms_psr@psr2_primary_page_flip:
- shard-iclb: [SKIP][110] ([fdo#109441]) -> [PASS][111] +2 similar issues
[110]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9825/shard-iclb4/igt@kms_psr@psr2_primary_page_flip.html
[111]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19753/shard-iclb2/igt@kms_psr@psr2_primary_page_flip.html

* igt@sysfs_clients@recycle:
- shard-snb: [FAIL][112] ([i915#3028]) -> [PASS][113]
[112]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9825/shard-snb6/igt@[email protected]
[113]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19753/shard-snb5/igt@[email protected]
- shard-iclb: [FAIL][114] ([i915#3028]) -> [PASS][115]
[114]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9825/shard-iclb8/igt@[email protected]
[115]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19753/shard-iclb2/igt@[email protected]

* igt@sysfs_clients@recycle-many:
- shard-tglb: [FAIL][116] ([i915#3028]) -> [PASS][117] +1 similar issue
[116]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9825/shard-tglb2/igt@[email protected]
[117]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19753/shard-tglb1/igt@[email protected]

* igt@sysfs_clients@split-25@vecs0:
- shard-skl: [SKIP][118] ([fdo#109271]) -> [PASS][119]
[118]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9825/shard-skl9/igt@sysfs_clients@[email protected]
[119]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19753/shard-skl7/igt@sysfs_clients@[email protected]

#### Warnings ####

* igt@i915_pm_rc6_residency@rc6-fence:
- shard-iclb: [WARN][120] ([i915#1804] / [i915#2684]) -> [WARN][121] ([i915#2684])
[120]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9825/shard-iclb4/igt@[email protected]
[121]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19753/shard-iclb2/igt@[email protected]

* igt@i915_pm_rc6_residency@rc6-idle:
- shard-iclb: [WARN][122] ([i915#1804] / [i915#2684]) -> [WARN][123] ([i915#2681] / [i915#2684])
[122]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9825/shard-iclb7/igt@[email protected]
[123]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19753/shard-iclb1/igt@[email protected]

* igt@kms_content_protection@uevent:
- shard-iclb: [FAIL][124] -> [SKIP][125] ([fdo#109300] / [fdo#111066])
[124]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9825/shard-iclb1/igt@[email protected]
[125]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19753/shard-iclb4/igt@[email protected]

* igt@kms_cursor_crc@pipe-a-cursor-suspend:
- shard-kbl: [INCOMPLETE][126] ([i915#155]) -> [DMESG-WARN][127] ([i915#180])
[126]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9825/shard-kbl4/igt@[email protected]
[127]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19753/shard-kbl1/igt@[email protected]

* igt@kms_psr2_sf@overlay-primary-update-sf-dmg-area-3:
- shard-iclb: [SKIP][128] ([i915#2920]) -> [SKIP][129] ([i915#658]) +1 similar issue
[128]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9825/shard-iclb2/igt@[email protected]
[129]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19753/shard-iclb1/igt@[email protected]

* igt@kms_psr2_sf@plane-move-sf-dmg-area-3:
- shard-iclb: [SKIP][130] ([i915#658]) -> [SKIP][131] ([i915#2920]) +1 similar issue
[130]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9825/shard-iclb6/igt@[email protected]
[131]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19753/shard-iclb2/igt@[email protected]

* igt@runner@aborted:
- shard-kbl: ([FAIL][132], [FAIL][133], [FAIL][134], [FAIL][135]) ([i915#1814] / [i915#2505] / [i915#2724] / [i915#3002]) -> ([FAIL][136], [FAIL][137], [FAIL][138], [FAIL][139], [FAIL][140], [FAIL][141], [FAIL][142]) ([i915#180] / [i915#1814] / [i915#2505] / [i915#2724] / [i915#3002] / [i915#602])
[132]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9825/shard-kbl6/igt@[email protected]
[133]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9825/shard-kbl7/igt@[email protected]
[134]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9825/shard-kbl6/igt@[email protected]
[135]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9825/shard-kbl1/igt@[email protected]
[136]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19753/shard-kbl4/igt@[email protected]
[137]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19753/shard-kbl4/igt@[email protected]
[138]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19753/shard-kbl1/igt@[email protected]
[139]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19753/shard-kbl6/igt@[email protected]
[140]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19753/shard-kbl1/igt@[email protected]
[141]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19753/shard-kbl1/igt@[email protected]
[142]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19753/shard-kbl6/igt@[email protected]
- shard-apl: ([FAIL][143], [FAIL][144], [FAIL][145], [FAIL][146]) ([fdo#109271] / [i915#180] / [i915#1814] / [i915#3002]) -> ([FAIL][147], [FAIL][148], [FAIL][149], [FAIL][150], [FAIL][151]) ([i915#180] / [i915#1814] / [i915#3002])
[143]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9825/shard-apl3/igt@[email protected]
[144]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9825/shard-apl7/igt@[email protected]
[145]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9825/shard-apl8/igt@[email protected]
[146]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9825/shard-apl7/igt@[email protected]
[147]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19753/shard-apl2/igt@[email protected]
[148]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19753/shard-apl2/igt@[email protected]
[149]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19753/shard-apl7/igt@[email protected]
[150]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19753/shard-apl7/igt@[email protected]
[151]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19753/shard-apl1/igt@[email protected]
- shard-glk: ([FAIL][152], [FAIL][153], [FAIL][154]) ([i915#2724] / [i915#3002] / [k.org#202321]) -> ([FAIL][155], [FAIL][156], [FAIL][157], [FAIL][158]) ([i915#2426] / [i915#2724] / [i915#3002] / [k.org#202321])
[152]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9825/shard-glk2/igt@[email protected]
[153]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9825/shard-glk4/igt@[email protected]
[154]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9825/shard-glk4/igt@[email protected]
[155]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19753/shard-glk4/igt@[email protected]
[156]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19753/shard-glk8/igt@[email protected]
[157]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19753/shard-glk9/igt@[email protected]
[158]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19753/shard-glk4/igt@[email protected]
- shard-tglb: ([FAIL][159], [FAIL][160], [FAIL][161]) ([i915#2667] / [i915#3002]) -> ([FAIL][162], [FAIL][163], [FAIL][164], [FAIL][165]) ([i915#2426] / [i915#2667] / [i915#2803] / [i915#3002])
[159]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9825/shard-tglb2/igt@[email protected]
[160]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9825/shard-

== Logs ==

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

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Reviewed-by on v1 1/1
#9 lore raw
In reply to Umesh Nerlige Ramappa
Quoted 36 lines · Umesh Nerlige Ramappa

Perf measurements rely on CPU and engine timestamps to correlate events of interest across these time domains. Current mechanisms get these timestamps separately and the calculated delta between these timestamps lack enough accuracy.

To improve the accuracy of these time measurements to within a few us, add a query that returns the engine and cpu timestamps captured as close to each other as possible.

v2: (Tvrtko)
- document clock reference used
- return cpu timestamp always
- capture cpu time just before lower dword of cs timestamp

v3: (Chris)
- use uncore-rpm
- use __query_cs_timestamp helper

v4: (Lionel)
- Kernel perf subsytem allows users to specify the clock id to be used in perf_event_open. This clock id is used by the perf subsystem to return the appropriate cpu timestamp in perf events. Similarly, let the user pass the clockid to this query so that cpu timestamp corresponds to the clock id requested.

v5: (Tvrtko)
- Use normal ktime accessors instead of fast versions
- Add more uApi documentation

v6: (Lionel)
- Move switch out of spinlock

v7: (Chris)
- cs_timestamp is a misnomer, use cs_cycles instead
- return the cs cycle frequency as well in the query

Quoted 8 lines

v8:
- Add platform and engine specific checks

v9: (Lionel)
- Return 2 cpu timestamps in the query - captured before and after the register read

Looks good to me, thanks!

Let me prepare a Mesa MR to use this with VK_EXT_calibrated_timestamps.

-Lionel

Quoted 229 lines
---
  drivers/gpu/drm/i915/i915_query.c | 144 ++++++++++++++++++++++++++++++
  include/uapi/drm/i915_drm.h       |  47 ++++++++++
  2 files changed, 191 insertions(+)
drivers/gpu/drm/i915/i915_query.c +144 -0
index fed337ad7b68..acca22ee6014 100644
@@ -6,6 +6,8 @@
 
  #include <linux/nospec.h>
 
+#include "gt/intel_engine_pm.h"
+#include "gt/intel_engine_user.h"
  #include "i915_drv.h"
  #include "i915_perf.h"
  #include "i915_query.h"
@@ -90,6 +92,147 @@ static int query_topology_info(struct drm_i915_private *dev_priv,
  	return total_length;
  }
 
+typedef u64 (*__ktime_func_t)(void);
+static __ktime_func_t __clock_id_to_func(clockid_t clk_id)
+{
+	/*
+	 * Use logic same as the perf subsystem to allow user to select the
+	 * reference clock id to be used for timestamps.
+	 */
+	switch (clk_id) {
+	case CLOCK_MONOTONIC:
+		return &ktime_get_ns;
+	case CLOCK_MONOTONIC_RAW:
+		return &ktime_get_raw_ns;
+	case CLOCK_REALTIME:
+		return &ktime_get_real_ns;
+	case CLOCK_BOOTTIME:
+		return &ktime_get_boottime_ns;
+	case CLOCK_TAI:
+		return &ktime_get_clocktai_ns;
+	default:
+		return NULL;
+	}
+}
+
+static inline int
+__read_timestamps(struct intel_uncore *uncore,
+		  i915_reg_t lower_reg,
+		  i915_reg_t upper_reg,
+		  u64 *cs_ts,
+		  u64 *cpu_ts,
+		  __ktime_func_t cpu_clock)
+{
+	u32 upper, lower, old_upper, loop = 0;
+
+	upper = intel_uncore_read_fw(uncore, upper_reg);
+	do {
+		cpu_ts[0] = cpu_clock();
+		lower = intel_uncore_read_fw(uncore, lower_reg);
+		cpu_ts[1] = cpu_clock();
+		old_upper = upper;
+		upper = intel_uncore_read_fw(uncore, upper_reg);
+	} while (upper != old_upper && loop++ < 2);
+
+	*cs_ts = (u64)upper << 32 | lower;
+
+	return 0;
+}
+
+static int
+__query_cs_cycles(struct intel_engine_cs *engine,
+		  u64 *cs_ts, u64 *cpu_ts,
+		  __ktime_func_t cpu_clock)
+{
+	struct intel_uncore *uncore = engine->uncore;
+	enum forcewake_domains fw_domains;
+	u32 base = engine->mmio_base;
+	intel_wakeref_t wakeref;
+	int ret;
+
+	fw_domains = intel_uncore_forcewake_for_reg(uncore,
+						    RING_TIMESTAMP(base),
+						    FW_REG_READ);
+
+	with_intel_runtime_pm(uncore->rpm, wakeref) {
+		spin_lock_irq(&uncore->lock);
+		intel_uncore_forcewake_get__locked(uncore, fw_domains);
+
+		ret = __read_timestamps(uncore,
+					RING_TIMESTAMP(base),
+					RING_TIMESTAMP_UDW(base),
+					cs_ts,
+					cpu_ts,
+					cpu_clock);
+
+		intel_uncore_forcewake_put__locked(uncore, fw_domains);
+		spin_unlock_irq(&uncore->lock);
+	}
+
+	return ret;
+}
+
+static int
+query_cs_cycles(struct drm_i915_private *i915,
+		struct drm_i915_query_item *query_item)
+{
+	struct drm_i915_query_cs_cycles __user *query_ptr;
+	struct drm_i915_query_cs_cycles query;
+	struct intel_engine_cs *engine;
+	__ktime_func_t cpu_clock;
+	int ret;
+
+	if (INTEL_GEN(i915) < 6)
+		return -ENODEV;
+
+	query_ptr = u64_to_user_ptr(query_item->data_ptr);
+	ret = copy_query_item(&query, sizeof(query), sizeof(query), query_item);
+	if (ret != 0)
+		return ret;
+
+	if (query.flags)
+		return -EINVAL;
+
+	if (query.rsvd)
+		return -EINVAL;
+
+	cpu_clock = __clock_id_to_func(query.clockid);
+	if (!cpu_clock)
+		return -EINVAL;
+
+	engine = intel_engine_lookup_user(i915,
+					  query.engine.engine_class,
+					  query.engine.engine_instance);
+	if (!engine)
+		return -EINVAL;
+
+	if (IS_GEN(i915, 6) &&
+	    query.engine.engine_class != I915_ENGINE_CLASS_RENDER)
+		return -ENODEV;
+
+	query.cs_frequency = engine->gt->clock_frequency;
+	ret = __query_cs_cycles(engine,
+				&query.cs_cycles,
+				query.cpu_timestamp,
+				cpu_clock);
+	if (ret)
+		return ret;
+
+	if (put_user(query.cs_frequency, &query_ptr->cs_frequency))
+		return -EFAULT;
+
+	if (put_user(query.cpu_timestamp[0], &query_ptr->cpu_timestamp[0]))
+		return -EFAULT;
+
+	if (put_user(query.cpu_timestamp[1], &query_ptr->cpu_timestamp[1]))
+		return -EFAULT;
+
+	if (put_user(query.cs_cycles, &query_ptr->cs_cycles))
+		return -EFAULT;
+
+	return sizeof(query);
+}
+
  static int
  query_engine_info(struct drm_i915_private *i915,
  		  struct drm_i915_query_item *query_item)
@@ -424,6 +567,7 @@ static int (* const i915_query_funcs[])(struct drm_i915_private *dev_priv,
  	query_topology_info,
  	query_engine_info,
  	query_perf_config,
+	query_cs_cycles,
  };
 
  int i915_query_ioctl(struct drm_device *dev, void *data, struct drm_file *file)
include/uapi/drm/i915_drm.h +40 -0
index 1987e2ea79a3..abcc479e2be1 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,49 @@ 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. cpu_timestamp[0] is captured before
+	 * reading the cs_cycles register and cpu_timestamp[1] is captured after
+	 * reading the register.
+	 **/
+	__u64 cpu_timestamp[2];
+
+	/**
+	 * 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.

include/uapi/drm/i915_drm.h struct drm_i915_engine_info { · line 2361

Quoted 10 lines
include/uapi/drm/i915_drm.h +7 -0
+	 */
+	__s32 clockid;
+
+	/** Must be zero. */
+	__u32 rsvd;
+};
+
  /**
   * struct drm_i915_query_engine_info
   *

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#10 lore raw
In reply to Umesh Nerlige Ramappa
Quoted 39 lines · Umesh Nerlige Ramappa

Perf measurements rely on CPU and engine timestamps to correlate events of interest across these time domains. Current mechanisms get these timestamps separately and the calculated delta between these timestamps lack enough accuracy.

To improve the accuracy of these time measurements to within a few us, add a query that returns the engine and cpu timestamps captured as close to each other as possible.

v2: (Tvrtko)
- document clock reference used
- return cpu timestamp always
- capture cpu time just before lower dword of cs timestamp

v3: (Chris)
- use uncore-rpm
- use __query_cs_timestamp helper

v4: (Lionel)
- Kernel perf subsytem allows users to specify the clock id to be used in perf_event_open. This clock id is used by the perf subsystem to return the appropriate cpu timestamp in perf events. Similarly, let the user pass the clockid to this query so that cpu timestamp corresponds to the clock id requested.

v5: (Tvrtko)
- Use normal ktime accessors instead of fast versions
- Add more uApi documentation

v6: (Lionel)
- Move switch out of spinlock

v7: (Chris)
- cs_timestamp is a misnomer, use cs_cycles instead
- return the cs cycle frequency as well in the query

v8:
- Add platform and engine specific checks

Quoted 7 lines

v9: (Lionel)
- Return 2 cpu timestamps in the query - captured before and after the register read

---
  drivers/gpu/drm/i915/i915_query.c | 144 ++++++++++++++++++++++++++++++

FYI, the MR for Mesa : https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9407

-Lionel

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx