pan/midgard: Fix disassembler cycle/quadword counting
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Mon, 23 Dec 2019 17:24:03 +0000 (12:24 -0500)
committerAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Tue, 24 Dec 2019 16:55:46 +0000 (16:55 +0000)
Due to the succeeding break we would fall into some off-by-one errors.
These should be resolved now.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
src/panfrost/midgard/disassemble.c

index 0b4dc72be9f9b7b475bb51d2ca0f4316c60b5739..cfce1110318ec29f502df90c9b84a3d31a84370b 100644 (file)
@@ -1543,6 +1543,12 @@ disassemble_midgard(uint8_t *code, size_t size, unsigned gpu_id, gl_shader_stage
                         break;
                 }
 
+                /* We are parsing per bundle anyway. Add before we start
+                 * breaking out so we don't miss the final bundle. */
+
+                midg_stats.bundle_count++;
+                midg_stats.quadword_count += num_quad_words;
+
                 if (prefetch_flag && midgard_word_types[tag] == midgard_word_type_alu)
                         break;
 
@@ -1550,10 +1556,6 @@ disassemble_midgard(uint8_t *code, size_t size, unsigned gpu_id, gl_shader_stage
 
                 unsigned next = (words[i] & 0xF0) >> 4;
 
-                /* We are parsing per bundle anyway */
-                midg_stats.bundle_count++;
-                midg_stats.quadword_count += num_quad_words;
-
                 /* Break based on instruction prefetch flag */
 
                 if (i < num_words && next == 1) {