Skip to content

Commit

Permalink
base_fw: Add perf measurement state set ipc
Browse files Browse the repository at this point in the history
Adds performance measurement state ipc to change the state of
performance measurement.

Signed-off-by: Tobiasz Dryjanski <[email protected]>
  • Loading branch information
tobonex committed Jan 12, 2024
1 parent 83968fc commit 345cca4
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions src/audio/base_fw.c
Original file line number Diff line number Diff line change
Expand Up @@ -504,6 +504,28 @@ int schedulers_info_get(uint32_t *data_off_size,
return 0;
}

void set_perf_meas_state(const char *data)
{
enum ipc4_perf_measurements_state_set state = *data;

struct telemetry_wnd_data *wnd_data =
(struct telemetry_wnd_data *)ADSP_DW->slots[DW_TELEMETRY_SLOT];
struct system_tick_info *systick_info =
(struct system_tick_info *)wnd_data->system_tick_info;

switch (state) {
case IPC4_PERF_MEASUREMENTS_DISABLED:
break;
case IPC4_PERF_MEASUREMENTS_STOPPED:
for (int i = 0; i < CONFIG_MAX_CORE_COUNT; i++)
systick_info[i].peak_utilization = 0;
break;
case IPC4_PERF_MEASUREMENTS_STARTED:
case IPC4_PERF_MEASUREMENTS_PAUSED:
break;
}
}

static int basefw_get_large_config(struct comp_dev *dev,
uint32_t param_id,
bool first_block,
Expand Down Expand Up @@ -579,6 +601,7 @@ static int basefw_set_large_config(struct comp_dev *dev,
case IPC4_FW_CONFIG:
return basefw_set_fw_config(first_block, last_block, data_offset, data);
case IPC4_PERF_MEASUREMENTS_STATE:
set_perf_meas_state(data);
return 0;
case IPC4_SYSTEM_TIME:
return basefw_set_system_time(param_id, first_block,
Expand Down

0 comments on commit 345cca4

Please sign in to comment.