summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2020-04-29 15:48:07 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2020-04-29 17:12:09 +0100
commit7605cfd9463a6778ebb7ebae294a97c5779a6c7f (patch)
treee7d21387011f3a8d7f8f2a3c9b786d49779d134f
parent5349e28013a626d1ede6a13b36e37d03abf0e202 (diff)
perf: Flush the work between rounds of gen8-unprivileged-single-ctx-counter
Wait until the GPU is idle before starting a fresh round of probing gen8-unprivileged-single-ctx-counter. This avoids building up a huge backlog of render copies, hogging buffers and stale contexts, and invoking the oomkiller. v2: Release everything before starting again. v3: More EAGAINs! Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
-rw-r--r--tests/perf.c31
1 files changed, 18 insertions, 13 deletions
diff --git a/tests/perf.c b/tests/perf.c
index 74fc8fd8..5d3c6878 100644
--- a/tests/perf.c
+++ b/tests/perf.c
@@ -3595,8 +3595,10 @@ gen8_test_single_ctx_render_target_writes_a_counter(void)
(delta_ts64_ns - delta_oa32_ns) :
(delta_oa32_ns - delta_ts64_ns);
if (delta_delta > 500) {
- igt_debug("skipping\n");
- exit(EAGAIN);
+ igt_debug("Too slow %d; skipping\n",
+ delta_delta);
+ ret = EAGAIN;
+ goto again;
}
len = i915_read_reports_until_timestamp(test_set->perf_oa_format,
@@ -3636,7 +3638,8 @@ gen8_test_single_ctx_render_target_writes_a_counter(void)
*/
if (header->type == DRM_I915_PERF_RECORD_OA_REPORT_LOST) {
igt_debug("OA trigger collision / report lost\n");
- exit(EAGAIN);
+ ret = EAGAIN;
+ goto again;
}
/* Currently the only other record type expected is a
@@ -3762,19 +3765,10 @@ gen8_test_single_ctx_render_target_writes_a_counter(void)
igt_assert_eq(ret, 0);
ret = memcmp(src[0].bo->virtual, dst[0].bo->virtual, 4 * width * height);
- if (ret != 0) {
- accumulator_print(&accumulator, "total");
- /* This needs to be investigated... From time
- * to time, the work we kick off doesn't seem
- * to happen. WTH?? */
- exit(EAGAIN);
- }
-
drm_intel_bo_unmap(src[0].bo);
drm_intel_bo_unmap(dst[0].bo);
- igt_assert_eq(accumulator.deltas[2 + 26], width * height);
-
+again:
for (int i = 0; i < ARRAY_SIZE(src); i++) {
drm_intel_bo_unreference(src[i].bo);
drm_intel_bo_unreference(dst[i].bo);
@@ -3787,6 +3781,17 @@ gen8_test_single_ctx_render_target_writes_a_counter(void)
drm_intel_gem_context_destroy(context1);
drm_intel_bufmgr_destroy(bufmgr);
__perf_close(stream_fd);
+ gem_quiescent_gpu(drm_fd);
+
+ if (ret != 0) {
+ accumulator_print(&accumulator, "total");
+ /* This needs to be investigated... From time
+ * to time, the work we kick off doesn't seem
+ * to happen. WTH?? */
+ exit(EAGAIN);
+ }
+
+ igt_assert_eq(accumulator.deltas[2 + 26], width * height);
}
child_ret = igt_wait_helper(&child);