-
Notifications
You must be signed in to change notification settings - Fork 349
Add object array abstraction to ipc4_module_init_ext_init and use it to pass stack and heap size for DP modules #10064
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add object array abstraction to ipc4_module_init_ext_init and use it to pass stack and heap size for DP modules #10064
Conversation
lgirdwood
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just some opens. @ranj063 pls also review since this may be used in your params patch ?
src/include/module/module/base.h
Outdated
| struct ipc4_input_pin_format *input_pins; | ||
| struct ipc4_output_pin_format *output_pins; | ||
| uint32_t stack_size; /* stack size in bytes, 0 means default value */ | ||
| uint32_t heap_size; /* stack size in bytes, 0 means default value */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will be max size for heap. i.e. the module may allocate less than this size but never more.
|
Let's mark this ready for review to get mor attention. |
36651d9 to
0f9308a
Compare
|
@jsarha LGTM, but last HACK patch, can it be made non hack for SRC using DP ? |
src/include/module/module/base.h
Outdated
| struct ipc4_output_pin_format *output_pins; | ||
| uint32_t domain_id; /* userspace domain ID */ | ||
| uint32_t stack_bytes; /* stack size in bytes, 0 means default value */ | ||
| uint32_t heap_bytes; /* stack size in bytes, 0 means default value */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo in the comment: "heap size"
0f9308a to
5d3c13e
Compare
|
This PR is bound to conflict with #10009 , but I fix which ever was left behind. |
kv2019i
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few comments, please see inline.
| if (config->ipc_extended_init) | ||
| cfg = module_ext_init_decode(dev, dst, args->data, &cfgsz); | ||
| else | ||
| cfg = (const struct ipc4_base_module_extended_cfg *)args->data; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment as to kernel PR. We already have a concept of "extended init". E.g. we have:
» struct sof_ipc4_base_module_cfg base_config;
» struct sof_ipc4_base_module_cfg_ext *base_config_ext;
All modules have base_config, but some have base_config_ext additionally. This new PR (and the bit29) seems to add a way to extend the module init data, but still keeps the old "base_config_ext" around as well. Having two "extended" module configs is highly confusing. Can we call this new variant (ipc_extended_init) something clearly different?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I address all the other comments first and push a new version. I take on this tomorrow, when I am certain we have an agreement on what to do.
So @kv2019i , should I go and rename struct ipc4_module_init_ext_init that has been there since 6c29004 ? Or would something less be enough?
What I find most annoying is that the both payload extesions are described in completely different places in the source tree without any cross reference or comment that the both entities may exist in the same payload. The comments here
Line 175 in 4ecaa95
| */ |
Would it be enough if I would document in the above place that struct ipc4_base_module_cfg_ext may follow the already mentioned structs structs, and document the situation the same way on the Linux side?
BTW it currently does not mention here
sof/src/include/module/ipc4/base-config.h
Line 149 in 4ecaa95
| struct ipc4_base_module_cfg_ext { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ack @jsarha . I got (again) confused we extended the module init message both at 1) TOP level (t ipc4_module_init_ext_init) and at 2) BASEFW level (sof_ipc4_base_module_cfg). Given the naming predates your PR, no need to rename now.
| if (config->ipc_extended_init) | ||
| cfg = module_ext_init_decode(dev, dst, args->data, &cfgsz); | ||
| else | ||
| cfg = (const struct ipc4_base_module_extended_cfg *)args->data; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I address all the other comments first and push a new version. I take on this tomorrow, when I am certain we have an agreement on what to do.
So @kv2019i , should I go and rename struct ipc4_module_init_ext_init that has been there since 6c29004 ? Or would something less be enough?
What I find most annoying is that the both payload extesions are described in completely different places in the source tree without any cross reference or comment that the both entities may exist in the same payload. The comments here
Line 175 in 4ecaa95
| */ |
Would it be enough if I would document in the above place that struct ipc4_base_module_cfg_ext may follow the already mentioned structs structs, and document the situation the same way on the Linux side?
BTW it currently does not mention here
sof/src/include/module/ipc4/base-config.h
Line 149 in 4ecaa95
| struct ipc4_base_module_cfg_ext { |
5d3c13e to
c87722b
Compare
kv2019i
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @jsarha , looks good now.
| if (config->ipc_extended_init) | ||
| cfg = module_ext_init_decode(dev, dst, args->data, &cfgsz); | ||
| else | ||
| cfg = (const struct ipc4_base_module_extended_cfg *)args->data; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ack @jsarha . I got (again) confused we extended the module init message both at 1) TOP level (t ipc4_module_init_ext_init) and at 2) BASEFW level (sof_ipc4_base_module_cfg). Given the naming predates your PR, no need to rename now.
|
@jsarha can you fix conflicts. Thanks ! |
Adds definition, enums, and bits for adding array of struct ipc4_module_init_ext_object:s with associated data to struct ipc4_module_init_ext_init payload. Also adds struct ipc4_module_init_ext_obj_dp_data as an object to be sent as an object in the array. Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
Add ipc_extended_init to struct comp_ipc_config to let component know that a struct ipc4_module_init_ext_init and possible friends are added into the struct ipc4_module_init_instance payload. The value of the boolean is set according to extension bit 29 of struct ipc4_module_init_instance message. Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
…onfig Add domain_id, stack_bytes and heap_bytes members to module_config. These may be be filled from ext_init payload. Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
c87722b to
b020bd2
Compare
@lgirdwood done |
ranj063
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
@jsarha TGL IPC4 not building correctly in Internal Intel CI System |
I simply do not understand what is wrong with this line: ... or why this error comes: The only thing I can think of doing is adding extra { } -block after "case IPC4_MOD_INIT_DATA_ID_DP_DATA:". Let's hope for the best, but I think there is something wrong with the compiler. |
@jsarha a variable declaration cannot be the first statement after |
b020bd2 to
b7e2bae
Compare
|
Added { } -block around "case IPC4_MOD_INIT_DATA_ID_DP_DATA:" : |
Add module_ext_init_decode() for struct ipc4_module_init_ext_init payload decoding. The function goes decodes ext_init and following object array payload. The only recognized object so far is struct sof_ipc4_mod_init_ext_dp_memory_data. The possibly found stack and heap size requirements are copied to struct module_config, but no other functionality is added. This first version ignores rtos_domain and gna_used flags, and fails if their associated data is found in the message payload. Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
…utes Define domain_id, stack_bytes_requirement and heap_bytes_requirement widget attributes. Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
…P SRC Adds domain_id, stack and heap_size_requirements values to SRCs widgets if SRC's scheduling domain is DP. At this phase the values are there only for testing purposes and they do not represent SRC modules actual requirements. The values are sent to FW using ipc4 module init message's ext_init payload and its object array. Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
b7e2bae to
3b67e6a
Compare
|
Changed module_ext_init_decode() size parameter from uint32_t to size_t to fix a static analysis warning. |
Extend the existing struct ipc4_module_init_ext_init payload with an abstract object array, and use the object array to pass DP module memory configuration e.g. stack and heap size. The PR contains decoding of the payload and extraction of stack and heap size properties, but no actual functionality for applying the memory configuration for the module. The decoding also lacks the decoding of rtos_domain and gna_used flags and payload.