[PATCH i-g-t 06/29] igt/perf: fix a counter indexing

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Robert Bragg <robert@xxxxxxxxxxxxx>

Signed-off-by: Robert Bragg <robert@xxxxxxxxxxxxx>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@xxxxxxxxx>
---
 tests/perf.c | 20 ++++++++------------
 1 file 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);
 		}
 
-- 
2.11.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux