aboutsummaryrefslogtreecommitdiff
path: root/driver/gator_events_mali_midgard_hw.c
diff options
context:
space:
mode:
Diffstat (limited to 'driver/gator_events_mali_midgard_hw.c')
-rw-r--r--driver/gator_events_mali_midgard_hw.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/driver/gator_events_mali_midgard_hw.c b/driver/gator_events_mali_midgard_hw.c
index c8065da..cada130 100644
--- a/driver/gator_events_mali_midgard_hw.c
+++ b/driver/gator_events_mali_midgard_hw.c
@@ -748,12 +748,12 @@ static int read_counter(const int cnt, const int len, const struct mali_counter
{
const int block = GET_HW_BLOCK(cnt);
const int counter_offset = GET_COUNTER_OFFSET(cnt);
+ u32 value = 0;
#if MALI_DDK_GATOR_API_VERSION == 3
const char *block_base_address = (char *)in_out_info->kernel_dump_buffer;
int i;
int shader_core_count = 0;
- u32 value = 0;
for (i = 0; i < in_out_info->nr_hwc_blocks; i++) {
if (block == in_out_info->hwc_layout[i]) {
@@ -766,6 +766,12 @@ static int read_counter(const int cnt, const int len, const struct mali_counter
if (shader_core_count > 1)
value /= shader_core_count;
#else
+ const unsigned int vithar_blocks[] = {
+ 0x700, /* VITHAR_JOB_MANAGER, Block 0 */
+ 0x400, /* VITHAR_TILER, Block 1 */
+ 0x000, /* VITHAR_SHADER_CORE, Block 2 */
+ 0x500 /* VITHAR_MEMORY_SYSTEM, Block 3 */
+ };
const char *block_base_address = (char *)kernel_dump_buffer + vithar_blocks[block];
/* If counter belongs to shader block need to take into account all cores */
@@ -831,15 +837,6 @@ static int read(int **buffer, bool sched_switch)
* Only process hardware counters if at least one of the hardware counters is enabled.
*/
if (num_hardware_counters_enabled > 0) {
-#if MALI_DDK_GATOR_API_VERSION != 3
- const unsigned int vithar_blocks[] = {
- 0x700, /* VITHAR_JOB_MANAGER, Block 0 */
- 0x400, /* VITHAR_TILER, Block 1 */
- 0x000, /* VITHAR_SHADER_CORE, Block 2 */
- 0x500 /* VITHAR_MEMORY_SYSTEM, Block 3 */
- };
-#endif
-
#if MALI_DDK_GATOR_API_VERSION == 3
if (!handles)
return -1;