Repository navigation
Conversation
Mirror firmware IPC changes to multi-dai/multi-config. This is just a backwards-compatible code change with no new functionality. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
|
Kernel side version of thesofproject/sof#2363 Still need to figure out compilation warnings |
@plbossart i guess you need to allocate memory for dai_data since it is a flex array? |
bardliao
left a comment
There was a problem hiding this comment.
@plbossart The bit size of struct sof_ipc_dai_config {} seems to be inconsistent. Where num_payloads and num_payloads are taken from one reserved[] which is consistent. So, I think we don't need to change the size of reserved16
| SOF_DAI_IMX_ESAI, /**< i.MX ESAI */ | ||
| SOF_DAI_INTEL_ALH, /**< Intel ALH */ | ||
| SOF_DAI_IMX_SAI, /**< i.MX SAI */ | ||
| SOF_DAI_IMX_ESAI, /**< i.MX ESAI */ |
There was a problem hiding this comment.
Look like whitespace is changed.
|
|
||
| /* reserved for future use */ | ||
| uint32_t reserved[8]; | ||
| uint32_t reserved16; |
There was a problem hiding this comment.
Should it be uint16_t reserved16?
There was a problem hiding this comment.
Gah, yes. merge mistake.
kv2019i
left a comment
There was a problem hiding this comment.
I have one concern about implications of the zero-sized array. As the patch passes CI, I guess it is ok, but just wanted to doublecheck. Otherwise looks good -- the mention that this is backwards-compatible is really important as it's not quite obvious from the patch that it is...
| config.type = SOF_DAI_INTEL_ALH; | ||
| config.dai_index = (link_id << 8) | (d->id); | ||
| config.alh.stream_id = alh_stream_id; | ||
| config.dai_data[0].alh.stream_id = alh_stream_id; |
There was a problem hiding this comment.
@plbossart Hmm, is this really safe? I mean definition now has a zero-length array and config size is set with sizeof(). I would except the sizeof to change with this patch.
There was a problem hiding this comment.
agree with @kv2019i - very strange and unclear what you're trying to do with that 0-size array of unions in the middle of a struct...
| struct sof_ipc_dai_ssp_params { | ||
| struct sof_ipc_hdr hdr; | ||
| uint32_t subdai_index; /* only used in multi-dai usages */ | ||
| uint32_t reserved0; |
There was a problem hiding this comment.
Do I understand this correctly, that hdr can be removed from this structs because these structs are never sent as a complete IPC message but only always embedded in larger structs with their own header? So, having this header in them was actually pointless from the beginning? This is a good and significant change. I'd say this change deserves a separate patch if this my understanding is correct...
There was a problem hiding this comment.
yes indeed, it was useless. This used to be a separate patch, not sure what I did with git.
| * multi-dai stream maps. The ext_id used needs to match subdai_index | ||
| * in each _params structure above | ||
| */ | ||
| struct sof_ipc_stream_map stream_map; |
There was a problem hiding this comment.
I'm confused. This struct sof_ipc_dai_config is a part of the ABI, right? Isn't this change changing the size of the struct in some unclear way? Before we had a union above - i.e. the size that it took was equal to that of the largest member. Now it's a 0-size array, so, that size is 0. And instead you're adding a new struct after that... And 0-size arrays in the middle of a struct can have weird consequences... I'm really confused.
There was a problem hiding this comment.
ack, this is completely broken indeed. i started a parallel thread to remove all variable arrays from IPC structs.
| config.type = SOF_DAI_INTEL_ALH; | ||
| config.dai_index = (link_id << 8) | (d->id); | ||
| config.alh.stream_id = alh_stream_id; | ||
| config.dai_data[0].alh.stream_id = alh_stream_id; |
There was a problem hiding this comment.
agree with @kv2019i - very strange and unclear what you're trying to do with that 0-size array of unions in the middle of a struct...
|
closing for now, we'll have to revisit later |
Mirror firmware IPC changes to multi-dai/multi-config.
This is just a backwards-compatible code change with no new
functionality.
Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com