Skip to content

Conversation

@ranj063
Copy link
Collaborator

@ranj063 ranj063 commented Oct 11, 2022

tested with thesofproject/sof#6401

FIrst patch is from the previous PR #3914

@ranj063 ranj063 force-pushed the fix/intermediate-pipelines branch from 7641581 to 768141b Compare October 12, 2022 03:01
@ranj063 ranj063 requested a review from RanderWang October 12, 2022 03:01
@ranj063 ranj063 force-pushed the fix/intermediate-pipelines branch 2 times, most recently from 71a5e88 to b001899 Compare October 12, 2022 03:36
bardliao
bardliao previously approved these changes Oct 12, 2022
for (i = 0; i < pipeline_info.count; i++) {
pipeline_widget = pipeline_info.pipelines[i];
pipeline = pipeline_widget->private;
pipeline->state = state;
Copy link
Collaborator

Choose a reason for hiding this comment

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

So, we still have the separate BE (DAI) pipeline trigger and we handle the non BE (DAI) pipelines in batch mode?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

no if there are multiple BE DAI's, their pipelines will get triggered in the respective BE trigger callbacks. There wouldnt be a batch mode there

Copy link
Collaborator

Choose a reason for hiding this comment

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

In here it does not matter if we have triggered it or not like in case of the pause?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

it does matter and if it is triggered it will be in the right state already no?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I meant the ones newly triggered will need an update to the state and the others will be the same state already. So, no need to check here

@ujfalusi
Copy link
Collaborator

@ranj063, I have started internal IPC4 daily test plan: 16213

@ranj063 ranj063 force-pushed the fix/intermediate-pipelines branch 5 times, most recently from 67622a0 to dcab26a Compare October 19, 2022 02:20
These will be used to perform IPC-specific PCM setup/free.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
@ranj063 ranj063 force-pushed the fix/intermediate-pipelines branch from dcab26a to 462da65 Compare October 19, 2022 05:28
};

/**
* struct snd_sof_pipeline_trigger_info - multi pipeline trigger IPC info
Copy link
Collaborator

Choose a reason for hiding this comment

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

How this struct is 'multi pipeline trigger IPC info'?
It is more like pipeline path or pipeline list.

In any case, I find it increasingly confusing that snd_sof_widget is sometimes a widget, module, component or a pipeline.

Probably it is really a snd_sof_pipeline_trigger_path? Certainly not IPC info.

Copy link
Collaborator

Choose a reason for hiding this comment

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

And this does not necessarily needs to be valid for paths which consists of more than one pipeline (we always have at least 2 pipelines with IPC4, are they also multi-pipeline?)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yes 2 is multi a well.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

In any case, I find it increasingly confusing that snd_sof_widget is sometimes a widget, module, component or a pipeline.

a widget is never a pipeline but widget/module/component are all used intrerchageably. There's a pipeline widget which is a widget of type snd_soc_dapm_scheduler.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

How this struct is 'multi pipeline trigger IPC info'?

I changed the name to snd_sof_pcm_stream_trigger_info now. hope that makes more sense.

Define the pcm_setup/pcm_free ops for IPC4. Define a new struct
snd_sof_pcm_stream_trigger_info and add a new field trigger_info of this
type to struct snd_sof_pcm_stream. This will be used to save the list of
pipelines that need to be triggered.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
…trigger

Add a new flag, skip_during_fe_trigger, to struct sof_ipc4_pipeline to
skip triggering pipelines in the FE DAI trigger. Set this flag for the
HDA DAI BE pipelines so that their BE pipeline will not be triggered in
the FE DAI trigger. Also, move the trigger handling for all commands
include START/PAUSE_RELEASE for the HDA DAI's to the backend DAI trigger
ops.

For the SSP/DMIC/SDW cases, remove the BE DAI trigger as they involve no
DMA operations and can be triggered in the FE DAI trigger. This is in
preparation to perform batch triggering of all pipelines for the non-HDA
case.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Populate the pipeline_info for the PCM stream with the list of pipeline
widgets that need to be handled during the PCM trigger. This will be
used in the IPC-specific PCM trigger op to trigger the pipelines.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
@ranj063 ranj063 force-pushed the fix/intermediate-pipelines branch from 462da65 to dd63b11 Compare October 19, 2022 15:02
Use the list of pipelines in the PCM stream's pipeline info to trigger
the pipelines in the right order. Add a helper for triggering pipelines
in batch mode that will be used to trigger multiple pipelines at the
same time.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
@ranj063 ranj063 force-pushed the fix/intermediate-pipelines branch from 52285a3 to 4abe644 Compare October 20, 2022 01:54
Copy link
Collaborator

@bardliao bardliao left a comment

Choose a reason for hiding this comment

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

This PR LGTM and test result looks good

Copy link

@libinyang libinyang left a comment

Choose a reason for hiding this comment

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

LGTM

return 0;

/* allocate data for the pipeline ID's and the count of pipelines to be triggered */
data = kzalloc(sizeof(u32) * (pipeline_info->count + 1), GFP_KERNEL);
Copy link
Collaborator

Choose a reason for hiding this comment

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

data = kzalloc(struct_size(data, pipeline_ids, pipeline_info->count), GFP_KERNEL);

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

this too, can I fix in a fixup?

*/
struct snd_sof_pcm_stream_trigger_info {
uint32_t count;
struct snd_sof_widget **pipeline_list;
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm not good at naming, but would

struct snd_sof_pcm_stream_pipeline_list {
	uint32_t count;
	struct snd_sof_widget **pipelines;
};

or

struct snd_sof_pipelines_in_pcm_stream {
	uint32_t count;
	struct snd_sof_widget **pipeline_list;
};

would describe this better?
The reason is that I don't see anything trigger_infoish in the struct

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@ujfalusi pipeline_list is the list of pipelines to be triggered. Isn't that good enough? And it is only used in the trigger callback.

Copy link
Member

@plbossart plbossart left a comment

Choose a reason for hiding this comment

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

This is good enough for me if there is a fixup coming to take @bardliao and @ujfalusi 's suggestions into account.

@ujfalusi you get to choose if a new version is needed or if we handle change requests with a fixup.

Copy link
Collaborator

@ujfalusi ujfalusi left a comment

Choose a reason for hiding this comment

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

@ranj063, overall this looks great, amazing actually.
I think it is fine to do fixups for the smaller issues since the functionality is not going to be changed, let's get this merged if everyone is OK with it.

@plbossart plbossart requested a review from kv2019i October 20, 2022 16:54
@plbossart
Copy link
Member

merging

@plbossart plbossart merged commit 20a4b07 into thesofproject:topic/sof-dev Oct 20, 2022
@ranj063 ranj063 deleted the fix/intermediate-pipelines branch October 20, 2022 17:47
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.

7 participants