[igt-dev] [PATCH i-g-t v2 2/3] tests/i915/perf: deal with 0 delta reports
Lionel Landwerlin
lionel.g.landwerlin at intel.com
Wed Nov 25 11:25:39 UTC 2020
More thorough testing shows that it is possible to get a timer report
followed by a context-switch report with the same timestamp.
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
---
tests/i915/perf.c | 91 +++++++++++++++++++++++++----------------------
1 file changed, 49 insertions(+), 42 deletions(-)
diff --git a/tests/i915/perf.c b/tests/i915/perf.c
index 2fbea0f0c..811067aad 100644
--- a/tests/i915/perf.c
+++ b/tests/i915/perf.c
@@ -778,15 +778,14 @@ gen8_sanity_check_test_oa_reports(const uint32_t *oa_report0,
uint32_t b;
uint32_t ref;
+ igt_debug("report type: %s->%s %p/%p\n",
+ gen8_read_report_reason(oa_report0),
+ gen8_read_report_reason(oa_report1),
+ oa_report0, oa_report1);
- igt_assert_neq(time_delta, 0);
- igt_assert_neq(clock_delta, 0);
-
- freq = ((uint64_t)clock_delta * 1000) / time_delta;
+ freq = time_delta ? ((uint64_t)clock_delta * 1000) / time_delta : 0;
igt_debug("freq = %"PRIu64"\n", freq);
- igt_assert(freq <= gt_max_freq_mhz);
-
igt_debug("clock delta = %"PRIu32"\n", clock_delta);
max_delta = clock_delta * intel_perf->devinfo.n_eus;
@@ -823,42 +822,50 @@ gen8_sanity_check_test_oa_reports(const uint32_t *oa_report0,
* multiple of the gpu clock
*/
if (format.n_b) {
- b = rpt1_b[0] - rpt0_b[0];
- igt_debug("B0: delta = %"PRIu32"\n", b);
- igt_assert_eq(b, 0);
-
- b = rpt1_b[1] - rpt0_b[1];
- igt_debug("B1: delta = %"PRIu32"\n", b);
- igt_assert_eq(b, clock_delta);
-
- b = rpt1_b[2] - rpt0_b[2];
- igt_debug("B2: delta = %"PRIu32"\n", b);
- igt_assert_eq(b, clock_delta);
-
- b = rpt1_b[3] - rpt0_b[3];
- ref = clock_delta / 2;
- igt_debug("B3: delta = %"PRIu32"\n", b);
- igt_assert(b >= ref - 1 && b <= ref + 1);
-
- b = rpt1_b[4] - rpt0_b[4];
- ref = clock_delta / 3;
- igt_debug("B4: delta = %"PRIu32"\n", b);
- igt_assert(b >= ref - 1 && b <= ref + 1);
-
- b = rpt1_b[5] - rpt0_b[5];
- ref = clock_delta / 3;
- igt_debug("B5: delta = %"PRIu32"\n", b);
- igt_assert(b >= ref - 1 && b <= ref + 1);
-
- b = rpt1_b[6] - rpt0_b[6];
- ref = clock_delta / 6;
- igt_debug("B6: delta = %"PRIu32"\n", b);
- igt_assert(b >= ref - 1 && b <= ref + 1);
-
- b = rpt1_b[7] - rpt0_b[7];
- ref = clock_delta * 2 / 3;
- igt_debug("B7: delta = %"PRIu32"\n", b);
- igt_assert(b >= ref - 1 && b <= ref + 1);
+ if (clock_delta > 0) {
+ b = rpt1_b[0] - rpt0_b[0];
+ igt_debug("B0: delta = %"PRIu32"\n", b);
+ igt_assert_eq(b, 0);
+
+ b = rpt1_b[1] - rpt0_b[1];
+ igt_debug("B1: delta = %"PRIu32"\n", b);
+ igt_assert_eq(b, clock_delta);
+
+ b = rpt1_b[2] - rpt0_b[2];
+ igt_debug("B2: delta = %"PRIu32"\n", b);
+ igt_assert_eq(b, clock_delta);
+
+ b = rpt1_b[3] - rpt0_b[3];
+ ref = clock_delta / 2;
+ igt_debug("B3: delta = %"PRIu32"\n", b);
+ igt_assert(b >= ref - 1 && b <= ref + 1);
+
+ b = rpt1_b[4] - rpt0_b[4];
+ ref = clock_delta / 3;
+ igt_debug("B4: delta = %"PRIu32"\n", b);
+ igt_assert(b >= ref - 1 && b <= ref + 1);
+
+ b = rpt1_b[5] - rpt0_b[5];
+ ref = clock_delta / 3;
+ igt_debug("B5: delta = %"PRIu32"\n", b);
+ igt_assert(b >= ref - 1 && b <= ref + 1);
+
+ b = rpt1_b[6] - rpt0_b[6];
+ ref = clock_delta / 6;
+ igt_debug("B6: delta = %"PRIu32"\n", b);
+ igt_assert(b >= ref - 1 && b <= ref + 1);
+
+ b = rpt1_b[7] - rpt0_b[7];
+ ref = clock_delta * 2 / 3;
+ igt_debug("B7: delta = %"PRIu32"\n", b);
+ igt_assert(b >= ref - 1 && b <= ref + 1);
+ } else {
+ for (int j = 0; j < format.n_b; j++) {
+ b = rpt1_b[j] - rpt0_b[j];
+ igt_debug("B%i: delta = %"PRIu32"\n", j, b);
+ igt_assert_eq(b, 0);
+ }
+ }
}
for (int j = 0; j < format.n_c; j++) {
--
2.29.2
More information about the igt-dev
mailing list