Skip to content

Commit 28b93ee

Browse files
committed
dram: audio: move trigger processing back to SRAM
.prepare() is called as a part of the trigger processing flow, it shouldn't be "cold." Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
1 parent a0ce977 commit 28b93ee

5 files changed

Lines changed: 24 additions & 46 deletions

File tree

src/audio/multiband_drc/multiband_drc.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -359,9 +359,9 @@ static int multiband_drc_process(struct processing_module *mod,
359359
return 0;
360360
}
361361

362-
__cold static int multiband_drc_prepare(struct processing_module *mod,
363-
struct sof_source **sources, int num_of_sources,
364-
struct sof_sink **sinks, int num_of_sinks)
362+
static int multiband_drc_prepare(struct processing_module *mod,
363+
struct sof_source **sources, int num_of_sources,
364+
struct sof_sink **sinks, int num_of_sinks)
365365
{
366366
struct multiband_drc_comp_data *cd = module_get_private_data(mod);
367367
struct comp_dev *dev = mod->dev;
@@ -370,8 +370,6 @@ __cold static int multiband_drc_prepare(struct processing_module *mod,
370370
int rate;
371371
int ret = 0;
372372

373-
assert_can_be_cold();
374-
375373
comp_info(dev, "multiband_drc_prepare()");
376374

377375
ret = multiband_drc_params(mod);

src/audio/multiband_drc/multiband_drc_ipc4.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ __cold int multiband_drc_get_ipc_config(struct processing_module *mod,
7373
return comp_data_blob_get_cmd(cd->model_handler, cdata, fragment_size);
7474
}
7575

76-
__cold int multiband_drc_params(struct processing_module *mod)
76+
int multiband_drc_params(struct processing_module *mod)
7777
{
7878
struct sof_ipc_stream_params *params = mod->stream_params;
7979
struct sof_ipc_stream_params comp_params;

src/audio/src/src.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,14 @@
3434

3535
LOG_MODULE_DECLARE(src, CONFIG_SOF_LOG_LEVEL);
3636

37-
__cold static int src_prepare(struct processing_module *mod,
38-
struct sof_source **sources, int num_of_sources,
39-
struct sof_sink **sinks, int num_of_sinks)
37+
static int src_prepare(struct processing_module *mod,
38+
struct sof_source **sources, int num_of_sources,
39+
struct sof_sink **sinks, int num_of_sinks)
4040
{
4141
struct comp_data *cd = module_get_private_data(mod);
4242
struct src_param *a = &cd->param;
4343
int ret;
4444

45-
assert_can_be_cold();
46-
4745
comp_info(mod->dev, "src_prepare()");
4846

4947
if (num_of_sources != 1 || num_of_sinks != 1)

src/audio/src/src_common.c

Lines changed: 11 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
LOG_MODULE_REGISTER(src, CONFIG_SOF_LOG_LEVEL);
4646

4747
/* Calculates buffers to allocate for a SRC mode */
48-
__cold static int src_buffer_lengths(struct comp_dev *dev, struct comp_data *cd, int nch)
48+
static int src_buffer_lengths(struct comp_dev *dev, struct comp_data *cd, int nch)
4949
{
5050
const struct src_stage *stage1;
5151
const struct src_stage *stage2;
@@ -54,8 +54,6 @@ __cold static int src_buffer_lengths(struct comp_dev *dev, struct comp_data *cd,
5454
int source_frames;
5555
int r1, n;
5656

57-
assert_can_be_cold();
58-
5957
a = &cd->param;
6058
fs_in = cd->source_rate;
6159
fs_out = cd->sink_rate;
@@ -186,16 +184,14 @@ static int init_stages(const struct src_stage *stage1, const struct src_stage *s
186184
return 0;
187185
}
188186

189-
__cold static int src_polyphase_init(struct polyphase_src *src, struct src_param *p,
190-
int32_t *delay_lines_start)
187+
static int src_polyphase_init(struct polyphase_src *src, struct src_param *p,
188+
int32_t *delay_lines_start)
191189
{
192190
const struct src_stage *stage1;
193191
const struct src_stage *stage2;
194192
int n_stages;
195193
int ret;
196194

197-
assert_can_be_cold();
198-
199195
if (p->idx_in < 0 || p->idx_out < 0)
200196
return -EINVAL;
201197

@@ -397,15 +393,13 @@ void src_set_alignment(struct sof_source *source, struct sof_sink *sink)
397393
sink_set_alignment_constants(sink, byte_align, frame_align_req);
398394
}
399395

400-
__cold static int src_verify_params(struct processing_module *mod)
396+
static int src_verify_params(struct processing_module *mod)
401397
{
402398
struct sof_ipc_stream_params *params = mod->stream_params;
403399
struct comp_data *cd = module_get_private_data(mod);
404400
struct comp_dev *dev = mod->dev;
405401
int ret;
406402

407-
assert_can_be_cold();
408-
409403
comp_dbg(dev, "src_verify_params()");
410404

411405
/* check whether params->rate (received from driver) are equal
@@ -480,9 +474,9 @@ static bool src_get_copy_limits(struct comp_data *cd,
480474
return true;
481475
}
482476

483-
__cold int src_params_general(struct processing_module *mod,
484-
struct sof_source *source,
485-
struct sof_sink *sink)
477+
int src_params_general(struct processing_module *mod,
478+
struct sof_source *source,
479+
struct sof_sink *sink)
486480
{
487481
struct comp_data *cd = module_get_private_data(mod);
488482
struct comp_dev *dev = mod->dev;
@@ -491,8 +485,6 @@ __cold int src_params_general(struct processing_module *mod,
491485
int n;
492486
int err;
493487

494-
assert_can_be_cold();
495-
496488
comp_info(dev, "src_params()");
497489

498490
err = src_set_params(mod, sink);
@@ -583,14 +575,12 @@ __cold int src_params_general(struct processing_module *mod,
583575
return 0;
584576
}
585577

586-
__cold int src_param_set(struct comp_dev *dev, struct comp_data *cd)
578+
int src_param_set(struct comp_dev *dev, struct comp_data *cd)
587579
{
588580
struct src_param *a = &cd->param;
589581
int fs_in = cd->source_rate;
590582
int fs_out = cd->sink_rate;
591583

592-
assert_can_be_cold();
593-
594584
a->idx_in = src_find_fs(a->in_fs, a->num_in_fs, fs_in);
595585
a->idx_out = src_find_fs(a->out_fs, a->num_out_fs, fs_out);
596586

@@ -604,9 +594,9 @@ __cold int src_param_set(struct comp_dev *dev, struct comp_data *cd)
604594
return 0;
605595
}
606596

607-
__cold int src_allocate_copy_stages(struct comp_dev *dev, struct src_param *prm,
608-
const struct src_stage *stage_src1,
609-
const struct src_stage *stage_src2)
597+
int src_allocate_copy_stages(struct comp_dev *dev, struct src_param *prm,
598+
const struct src_stage *stage_src1,
599+
const struct src_stage *stage_src2)
610600
{
611601
#if CONFIG_FAST_GET
612602
struct src_stage *stage_dst;
@@ -617,8 +607,6 @@ __cold int src_allocate_copy_stages(struct comp_dev *dev, struct src_param *prm,
617607
size_t tap_size = sizeof(int32_t);
618608
#endif
619609

620-
assert_can_be_cold();
621-
622610
stage_dst = rmalloc(SOF_MEM_ZONE_RUNTIME, 0, SOF_MEM_CAPS_RAM,
623611
2 * sizeof(*stage_dst));
624612
if (!stage_dst) {

src/audio/src/src_ipc4.c

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ int src_stream_pcm_sink_rate_check(struct ipc4_config_src cfg,
7777
* set up param then verify param. BTW for IPC3 path, the param is sent by
7878
* host driver.
7979
*/
80-
__cold int src_set_params(struct processing_module *mod, struct sof_sink *sink)
80+
int src_set_params(struct processing_module *mod, struct sof_sink *sink)
8181
{
8282
struct sof_ipc_stream_params src_params;
8383
struct sof_ipc_stream_params *params = mod->stream_params;
@@ -86,8 +86,6 @@ __cold int src_set_params(struct processing_module *mod, struct sof_sink *sink)
8686
struct comp_dev *dev = mod->dev;
8787
int ret;
8888

89-
assert_can_be_cold();
90-
9189
src_params = *params;
9290
src_params.channels = mod->priv.cfg.base_cfg.audio_fmt.channels_count;
9391
src_params.buffer_fmt = mod->priv.cfg.base_cfg.audio_fmt.interleaving_style;
@@ -119,15 +117,13 @@ __cold int src_set_params(struct processing_module *mod, struct sof_sink *sink)
119117
return ret;
120118
}
121119

122-
__cold void src_get_source_sink_params(struct comp_dev *dev, struct sof_source *source,
123-
struct sof_sink *sink)
120+
void src_get_source_sink_params(struct comp_dev *dev, struct sof_source *source,
121+
struct sof_sink *sink)
124122
{
125123
struct processing_module *mod = comp_mod(dev);
126124
struct comp_data *cd = module_get_private_data(mod);
127125
enum sof_ipc_frame frame_fmt, valid_fmt;
128126

129-
assert_can_be_cold();
130-
131127
/* convert IPC4 config to format used by the module */
132128
audio_stream_fmt_conversion(cd->ipc_config.base.audio_fmt.depth,
133129
cd->ipc_config.base.audio_fmt.valid_bit_depth,
@@ -140,16 +136,14 @@ __cold void src_get_source_sink_params(struct comp_dev *dev, struct sof_source *
140136
sink_set_rate(sink, cd->ipc_config.sink_rate);
141137
}
142138

143-
__cold int src_prepare_general(struct processing_module *mod,
144-
struct sof_source *source,
145-
struct sof_sink *sink)
139+
int src_prepare_general(struct processing_module *mod,
140+
struct sof_source *source,
141+
struct sof_sink *sink)
146142
{
147143
struct comp_data *cd = module_get_private_data(mod);
148144
struct comp_dev *dev = mod->dev;
149145
int ret = 0;
150146

151-
assert_can_be_cold();
152-
153147
/* set align requirements */
154148
src_set_alignment(source, sink);
155149

0 commit comments

Comments
 (0)