Skip to content

Commit 9c0e39d

Browse files
author
Jyri Sarha
committed
component: module_adapter: Update struct ipc4_module_init_ext_obj_dp_data
Update struct ipc4_module_init_ext_obj_dp_data to match what is required for latest user space features. This is a tricky change as it chenges already part of ABI. However, as the structure was not really used for anything before, changing it should be safe. That is with one exception. The case where an earlier SOF driver sends us the old smaller struct identifier with IPC4_MOD_INIT_DATA_ID_DP_DATA, then we should not fail on that, but only ignore the struct. This is why "return" is changed to "break" in case IPC4_MOD_INIT_DATA_ID_DP_DATA. Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
1 parent 1547199 commit 9c0e39d

File tree

3 files changed

+21
-12
lines changed

3 files changed

+21
-12
lines changed

src/audio/module_adapter/module_adapter_ipc4.c

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,15 +67,20 @@ module_ext_init_decode(struct comp_dev *dev, struct module_config *dst,
6767
(const struct ipc4_module_init_ext_obj_dp_data *)(obj + 1);
6868

6969
if (obj->object_words * sizeof(uint32_t) < sizeof(*dp_data)) {
70-
comp_err(dev, "dp_data object too small %zu < %zu",
71-
obj->object_words * sizeof(uint32_t), sizeof(*dp_data));
72-
return NULL;
70+
comp_warn(dev, "dp_data object too small %zu < %zu",
71+
obj->object_words * sizeof(uint32_t), sizeof(*dp_data));
72+
break;
7373
}
7474
dst->domain_id = dp_data->domain_id;
7575
dst->stack_bytes = dp_data->stack_bytes;
76-
dst->heap_bytes = dp_data->heap_bytes;
77-
comp_info(dev, "init_ext_obj_dp_data domain %u stack %u heap %u",
78-
dp_data->domain_id, dp_data->stack_bytes, dp_data->heap_bytes);
76+
dst->interim_heap_bytes = dp_data->interim_heap_bytes;
77+
dst->lifetime_heap_bytes = dp_data->interim_heap_bytes;
78+
dst->shared_bytes = dp_data->shared_bytes;
79+
comp_info(dev,
80+
"init_ext_obj_dp_data domain %u stack %u interim %u lifetime %u shared %u",
81+
dp_data->domain_id, dp_data->stack_bytes,
82+
dp_data->interim_heap_bytes, dp_data->lifetime_heap_bytes,
83+
dp_data->shared_bytes);
7984
break;
8085
}
8186
default:

src/include/ipc4/module.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,11 @@ struct ipc4_module_init_ext_object {
9090

9191
/* Ext init array data object for Data Processing module memory requirements */
9292
struct ipc4_module_init_ext_obj_dp_data {
93-
uint32_t domain_id; /* userspace domain ID */
94-
uint32_t stack_bytes; /* required stack size in bytes, 0 means default size */
95-
uint32_t heap_bytes; /* required heap size in bytes, 0 means default size */
93+
uint32_t domain_id; /* userspace domain ID */
94+
uint32_t stack_bytes; /* required stack size in bytes */
95+
uint32_t interim_heap_bytes; /* required interim heap size in bytes */
96+
uint32_t lifetime_heap_bytes; /* required lifetime heap size in bytes */
97+
uint32_t shared_bytes; /* required shared memory size in bytes */
9698
} __attribute__((packed, aligned(4)));
9799

98100
/*

src/include/module/module/base.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,11 @@ struct module_config {
3838
uint8_t nb_output_pins;
3939
struct ipc4_input_pin_format *input_pins;
4040
struct ipc4_output_pin_format *output_pins;
41-
uint32_t domain_id; /* userspace domain ID */
42-
uint32_t stack_bytes; /* stack size in bytes, 0 means default value */
43-
uint32_t heap_bytes; /* max heap size in bytes, 0 means default value */
41+
uint32_t domain_id; /* userspace domain ID */
42+
uint32_t stack_bytes; /* stack size in bytes */
43+
uint32_t interim_heap_bytes; /* interim heap size in bytes */
44+
uint32_t lifetime_heap_bytes; /* lifetime heap size in bytes */
45+
uint32_t shared_bytes; /* shared size in bytes */
4446
#endif
4547
};
4648

0 commit comments

Comments
 (0)