Skip to content

ASoC: SOF: topology: move internal enum types to c file - #864

Closed
keyonjie wants to merge 3 commits into
thesofproject:topic/sof-devfrom
keyonjie:abi_align
Closed

keyonjie wants to merge 3 commits into
thesofproject:topic/sof-devfrom
keyonjie:abi_align

Conversation

@keyonjie

Copy link
Copy Markdown

The enumurated type is used inside sof/topology.c only, split it out from
topology.h to make the header file totally aligned with FW.

Signed-off-by: Keyon Jie yang.jie@linux.intel.com

@keyonjie
keyonjie requested review from plbossart and ranj063 April 24, 2019 09:00
@keyonjie keyonjie changed the title ASoC: SOF: topology: move sof_event_types enum to c file ASoC: SOF: topology: move internal enum types to c file Apr 24, 2019
@keyonjie

Copy link
Copy Markdown
Author

please refer to thesofproject/sof#1304 on FW side, they don't need to be merged at the same time as no ABI bump needed.

@xiulipan

Copy link
Copy Markdown

@keyonjie
Maybe we still need ABI align for keyword detection. I have made one for ABI but I think it did not do the alignment for other headers #857
Maybe you can do that with this one to align with FW part and just close mine.

@plbossart plbossart left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this necessary? We have other issues to fix really.
And actually it's a really bad idea to have the component types not in a file shared with firmware. It makes the comparisons more complicated...

@keyonjie

keyonjie commented Apr 25, 2019 •

Copy link
Copy Markdown
Author

Why is this necessary? We have other issues to fix really.
And actually it's a really bad idea to have the component types not in a file shared with firmware. It makes the comparisons more complicated...

Agree that it's good if we can share this header file directly with FW, then every time we want to update it, we only need to do it in one place, here making them totally aligned is the prerequisite of sharing it, right?

My thought is that we should put struct definitions which we DO need share b/w FW and driver in these headers(e.g. topology.h, abi.h, ipc.h, ...), and sweep all others out of them.

@plbossart

Copy link
Copy Markdown
Member

Why is this necessary? We have other issues to fix really.
And actually it's a really bad idea to have the component types not in a file shared with firmware. It makes the comparisons more complicated...

Agree that it's good if we can share this header file directly with FW, then every time we want to update it, we only need to do it in one place, here making them totally aligned is the prerequisite of sharing it, right?

My thought is that we should put struct definitions which we DO need share b/w FW and driver in these headers(e.g. topology.h, abi.h, ipc.h, ...), and sweep all others out of them.

I don't get what you are suggesting. If there is a change needed in the content of shared files, then we deal with this in a global ABI review. It doesn't matter if the files are only used in one place by the kernel, it's a defined interface and we use it as is.

@keyonjie

Copy link
Copy Markdown
Author

I don't get what you are suggesting. If there is a change needed in the content of shared files, then we deal with this in a global ABI review. It doesn't matter if the files are only used in one place by the kernel, it's a defined interface and we use it as is.

Hi Pierre, you are right, I don't want to involve in the long debating about ABI change, what I am doing here is only fix the gap of shared files b/w FW and driver, after this is merged, we will have a same base(the shared files) and bump them to the a same ABI version(e.g. 3.6.0).

With this alignment as the prerequisite, we can start our global ABI review process for each ABI update, make sense?

The enumurated type is used inside sof/topology.c only, split it out
from topology.h to make the header file totally aligned with FW.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
The enumurated type is used inside sof/topology.c only, split it out
from topology.h to make the header file totally aligned with FW.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
Bump ABI version to 3.6.0 to align with FW.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
@plbossart

plbossart commented Apr 26, 2019 •

Copy link
Copy Markdown
Member

I don't want those enums in topology.c, I mentioned this already. This is not the right way to share information between two repositories.

@keyonjie

Copy link
Copy Markdown
Author

I don't want those enums in topology.c, I mentioned this already. This is not the right way to share information between two repositories.

The point here is that those enums are not needed in FW side, vice versa, there are some structs/enums used in FW only(transparent to driver), my intention here is weeding them out from shared header files, this will be helpful for ABI version bumping.

If we don't want those enums in topology.c, I can add new header file(not shared one) to hold them, opinion?

@plbossart

plbossart commented Apr 29, 2019 •

Copy link
Copy Markdown
Member

This:

		 /** \brief Types of processing components */
 enum sof_ipc_process_type {
 	SOF_PROCESS_NONE = 0,		/**< None */
 	SOF_PROCESS_EQFIR,		/**< Intel FIR */
 	SOF_PROCESS_EQIIR,		/**< Intel IIR */
 	SOF_PROCESS_KEYWORD_DETECT,	/**< Keyword Detection */
 	SOF_PROCESS_KPB,		/**< KeyPhrase Buffer Manager */
 	SOF_PROCESS_CHAN_SELECTOR,	/**< Channel Selector */
 };

has to be shared. The events don't indeed need to be shared.

@keyonjie

Copy link
Copy Markdown
Author

This:

		 /** \brief Types of processing components */
 enum sof_ipc_process_type {
 	SOF_PROCESS_NONE = 0,		/**< None */
 	SOF_PROCESS_EQFIR,		/**< Intel FIR */
 	SOF_PROCESS_EQIIR,		/**< Intel IIR */
 	SOF_PROCESS_KEYWORD_DETECT,	/**< Keyword Detection */
 	SOF_PROCESS_KPB,		/**< KeyPhrase Buffer Manager */
 	SOF_PROCESS_CHAN_SELECTOR,	/**< Channel Selector */
 };

has to be shared. The events don't indeed need to be shared.

@plbossart actually no, nobody uses this enum inside FW.

@ranj063

ranj063 commented Apr 29, 2019

Copy link
Copy Markdown
Collaborator

@plbossart yes the FW doesnt use the process types. We translate the process type in topology to comp types before sending the IPC to the FW.

@plbossart

Copy link
Copy Markdown
Member

well it's broken. We agreed we'd have 'top level' components and then a subtype (today represented as an enum and later with a UUID). I don't want to do surgery on something that's not well defined. There is no rush for this change and it's not useful for now.

@plbossart

Copy link
Copy Markdown
Member

@plbossart yes the FW doesnt use the process types. We translate the process type in topology to comp types before sending the IPC to the FW.

if what you are saying is correct, then the following comment is incorrect in topology.h:

struct sof_ipc_comp_process {
	struct sof_ipc_comp comp;
	struct sof_ipc_comp_config config;
	uint32_t size;	/**< size of bespoke data section in bytes */
	uint32_t type;	/**< sof_ipc_process_type */ <<< should be component_type?

@ranj063

ranj063 commented May 6, 2019

Copy link
Copy Markdown
Collaborator
```c
	uint32_t type;	/**< sof_ipc_process_type */ <<< should be component_type?

@plbossart Yes, that is correct

@plbossart

Copy link
Copy Markdown
Member
```c
```c
	uint32_t type;	/**< sof_ipc_process_type */ <<< should be component_type?

@plbossart Yes, that is correct

So right there we have a recipe for an incompatible ABI change. We said we would have component types and subtypes, and if we are only passing component types then things will just not scale...

@plbossart

Copy link
Copy Markdown
Member

let's revisit this when we rework the 3rd party component support

@plbossart plbossart closed this May 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants