Skip to content

Commit 03044fc

Browse files
serhiy-katsyuba-intellgirdwood
authored andcommitted
ipc4: Fix queue ID extraction
This is a follow-up to #10257. This fixes all occurrences of incorrect use of IPC4_SRC_QUEUE_ID() and IPC4_SINK_QUEUE_ID(). IPC4_SRC_QUEUE_ID() expects buffer as a parameter and returns the queue ID of the module that produces data for that buffer. So from the buffer's point of view, such a module and queue is the source (hence the name IPC4_SRC_QUEUE_ID()), however, from the module's point of view, such a queue is a sink. That, unfortunately, makes it easy to make a mistake when deciding whether IPC4_SRC_QUEUE_ID() vs. IPC4_SINK_QUEUE_ID() should be used. Signed-off-by: Serhiy Katsyuba <[email protected]>
1 parent 7540307 commit 03044fc

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/audio/copier/copier_generic.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ void copier_update_params(struct copier_data *cd, struct comp_dev *dev,
328328
/* update each sink format */
329329
comp_dev_for_each_consumer(dev, sink) {
330330
int j;
331-
j = IPC4_SINK_QUEUE_ID(buf_get_id(sink));
331+
j = IPC4_SRC_QUEUE_ID(buf_get_id(sink));
332332

333333
ipc4_update_buffer_format(sink, &cd->out_fmt[j]);
334334
}

src/audio/dai-zephyr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ dai_dma_cb(struct dai_data *dd, struct comp_dev *dev, uint32_t bytes,
362362

363363
sink_dev = comp_buffer_get_sink_component(sink);
364364

365-
j = IPC4_SINK_QUEUE_ID(buf_get_id(sink));
365+
j = IPC4_SRC_QUEUE_ID(buf_get_id(sink));
366366

367367
if (j >= IPC4_COPIER_MODULE_OUTPUT_PINS_COUNT) {
368368
comp_err(dev, "Sink queue ID: %d >= max output pin count: %d\n",

src/probe/probe.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1102,15 +1102,15 @@ static struct comp_buffer *ipc4_get_buffer(struct ipc_comp_dev *dev, probe_point
11021102
switch (probe_point.fields.type) {
11031103
case PROBE_TYPE_INPUT:
11041104
comp_dev_for_each_producer(dev->cd, buf) {
1105-
queue_id = IPC4_SRC_QUEUE_ID(buf_get_id(buf));
1105+
queue_id = IPC4_SINK_QUEUE_ID(buf_get_id(buf));
11061106

11071107
if (queue_id == probe_point.fields.index)
11081108
return buf;
11091109
}
11101110
break;
11111111
case PROBE_TYPE_OUTPUT:
11121112
comp_dev_for_each_consumer(dev->cd, buf) {
1113-
queue_id = IPC4_SINK_QUEUE_ID(buf_get_id(buf));
1113+
queue_id = IPC4_SRC_QUEUE_ID(buf_get_id(buf));
11141114

11151115
if (queue_id == probe_point.fields.index)
11161116
return buf;
@@ -1581,14 +1581,14 @@ static int probe_get_available_points(struct processing_module *mod,
15811581

15821582
id.fields.type = PROBE_TYPE_INPUT;
15831583
comp_dev_for_each_producer(icd->cd, buf) {
1584-
id.fields.index = IPC4_SRC_QUEUE_ID(buf_get_id(buf));
1584+
id.fields.index = IPC4_SINK_QUEUE_ID(buf_get_id(buf));
15851585
if (probe_add_point_info_params(info, id, i, max_size))
15861586
return 0;
15871587
i++;
15881588
}
15891589
id.fields.type = PROBE_TYPE_OUTPUT;
15901590
comp_dev_for_each_consumer(icd->cd, buf) {
1591-
id.fields.index = IPC4_SINK_QUEUE_ID(buf_get_id(buf));
1591+
id.fields.index = IPC4_SRC_QUEUE_ID(buf_get_id(buf));
15921592
if (probe_add_point_info_params(info, id, i, max_size))
15931593
return 0;
15941594
i++;

0 commit comments

Comments
 (0)