summaryrefslogtreecommitdiff
path: root/tests/perf.c
diff options
context:
space:
mode:
authorRobert Bragg <robert@sixbynine.org>2017-01-31 13:34:05 +0000
committerLionel Landwerlin <lionel.g.landwerlin@intel.com>2017-08-04 12:01:46 +0100
commit325d0d96096853e1d1190098151946a404623907 (patch)
treea656df424577f111b052ae383d01e2fcc481f2b3 /tests/perf.c
parentb05012b663e5371db908e726bb678e3dbb92e236 (diff)
tests/perf: fix a counter indexing
Signed-off-by: Robert Bragg <robert@sixbynine.org> Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Diffstat (limited to 'tests/perf.c')
-rw-r--r--tests/perf.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/tests/perf.c b/tests/perf.c
index 3eef82d2..5a6bd05a 100644
--- a/tests/perf.c
+++ b/tests/perf.c
@@ -863,17 +863,15 @@ print_reports(uint32_t *oa_report0, uint32_t *oa_report1, int fmt)
} else
igt_debug("CLOCK = N/A\n");
- for (int j = oa_formats[fmt].first_a;
- j < oa_formats[fmt].n_a;
- j++)
- {
+ for (int j = 0; j < oa_formats[fmt].n_a; j++) {
+ int a_id = oa_formats[fmt].first_a + j;
uint32_t delta = a1[j] - a0[j];
- if (hsw_undefined_a_counters[j])
+ if (hsw_undefined_a_counters[a_id])
continue;
igt_debug("A%d: 1st = %"PRIu32", 2nd = %"PRIu32", delta = %"PRIu32"\n",
- j, a0[j], a1[j], delta);
+ a_id, a0[j], a1[j], delta);
}
for (int j = 0; j < oa_formats[fmt].n_b; j++) {
@@ -976,16 +974,14 @@ test_oa_formats(void)
*/
max_delta = clock_delta * 40;
- for (int j = oa_formats[i].first_a;
- j < oa_formats[i].n_a;
- j++)
- {
+ for (int j = 0; j < oa_formats[i].n_a; j++) {
+ int a_id = oa_formats[i].first_a + j;
uint32_t delta = a1[j] - a0[j];
- if (hsw_undefined_a_counters[j])
+ if (hsw_undefined_a_counters[a_id])
continue;
- igt_debug("A%d: delta = %"PRIu32"\n", j, delta);
+ igt_debug("A%d: delta = %"PRIu32"\n", a_id, delta);
igt_assert(delta <= max_delta);
}