dsp: preload voice and copp topologies
Set topology info to q6core service in ADSP so that the modules in a topology can be loaded before the usecase starts, thus reducing usecase setup latency. The same topology is unloaded before vocproc or copp is destroyed or replaced. Change-Id: I5f8872130fb09f049e080c61edb8bb0b05e5e2de Signed-off-by: Vikram Panduranga <vpandura@codeaurora.org>
This commit is contained in:
@@ -96,6 +96,8 @@ static int voice_send_cvp_channel_info_v2(struct voice_data *v,
|
||||
uint32_t param_type);
|
||||
static int voice_get_avcs_version_per_service(uint32_t service_id);
|
||||
|
||||
static void voice_load_topo_modules(int cal_index);
|
||||
static void voice_unload_topo_modules(void);
|
||||
|
||||
static int voice_cvs_stop_playback(struct voice_data *v);
|
||||
static int voice_cvs_start_playback(struct voice_data *v);
|
||||
@@ -2698,6 +2700,35 @@ done:
|
||||
|
||||
}
|
||||
|
||||
static void voice_load_topo_modules(int cal_index)
|
||||
{
|
||||
uint32_t topology_id;
|
||||
int ret;
|
||||
|
||||
topology_id = voice_get_topology(cal_index);
|
||||
ret = q6core_load_unload_topo_modules(topology_id, CORE_LOAD_TOPOLOGY);
|
||||
if (ret < 0)
|
||||
pr_debug("%s ret:%d load topo modules %d failed\n",
|
||||
__func__, ret, topology_id);
|
||||
|
||||
}
|
||||
|
||||
static void voice_unload_topo_modules(void)
|
||||
{
|
||||
uint32_t topology_id;
|
||||
int i, ret;
|
||||
|
||||
for (i = CVP_VOC_RX_TOPOLOGY_CAL; i <= CVP_VOC_TX_TOPOLOGY_CAL; i++) {
|
||||
topology_id = voice_get_topology(i);
|
||||
ret = q6core_load_unload_topo_modules(topology_id,
|
||||
CORE_UNLOAD_TOPOLOGY);
|
||||
if (ret < 0) {
|
||||
pr_debug("%s ret:%d unload topo modules %d failed\n",
|
||||
__func__, ret, topology_id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static int voice_send_cvp_create_cmd(struct voice_data *v)
|
||||
{
|
||||
struct cvp_create_full_ctl_session_cmd cvp_session_cmd;
|
||||
@@ -5000,6 +5031,9 @@ static int voice_destroy_vocproc(struct voice_data *v)
|
||||
voice_send_cvp_deregister_dev_cfg_cmd(v);
|
||||
voice_send_cvs_deregister_cal_cmd(v);
|
||||
|
||||
/* Unload topology modules */
|
||||
voice_unload_topo_modules();
|
||||
|
||||
/* destrop cvp session */
|
||||
cvp_destroy_session_cmd.hdr_field = APR_HDR_FIELD(APR_MSG_TYPE_SEQ_CMD,
|
||||
APR_HDR_LEN(APR_HDR_SIZE),
|
||||
@@ -6728,6 +6762,9 @@ int voc_disable_device(uint32_t session_id)
|
||||
voice_send_cvp_deregister_cal_cmd(v);
|
||||
voice_send_cvp_deregister_dev_cfg_cmd(v);
|
||||
|
||||
/* Unload topology modules */
|
||||
voice_unload_topo_modules();
|
||||
|
||||
v->voc_state = VOC_CHANGE;
|
||||
} else {
|
||||
pr_debug("%s: called in voc state=%d, No_OP\n",
|
||||
@@ -8721,6 +8758,11 @@ static int voice_set_cal(int32_t cal_type,
|
||||
ret = -EINVAL;
|
||||
goto done;
|
||||
}
|
||||
/* Pre-load if it is voice Rx or Tx topology */
|
||||
if ((cal_index == CVP_VOC_RX_TOPOLOGY_CAL) ||
|
||||
(cal_index == CVP_VOC_TX_TOPOLOGY_CAL)) {
|
||||
voice_load_topo_modules(cal_index);
|
||||
}
|
||||
done:
|
||||
return ret;
|
||||
}
|
||||
|
Reference in New Issue
Block a user