Skip to content

Commit 090c63d

Browse files
ujfalusiplbossart
authored andcommitted
ASoC: SOF: Modify the host trace_init parameter list to include dmab
Stop host code (AMD, Intel) to access sdev->dmatb directly. Modify the trace_init prototype to include the pointer to a struct snd_dma_buffer. The ipc3-dtrace passes for now the pointer to sdev->dmatb, but the aim is to move all tracing related runtime information local to a trace implementation. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
1 parent e2f12b3 commit 090c63d

7 files changed

Lines changed: 11 additions & 9 deletions

File tree

sound/soc/sof/amd/acp-trace.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ int acp_sof_trace_release(struct snd_sof_dev *sdev)
3434
}
3535
EXPORT_SYMBOL_NS(acp_sof_trace_release, SND_SOC_SOF_AMD_COMMON);
3636

37-
int acp_sof_trace_init(struct snd_sof_dev *sdev,
37+
int acp_sof_trace_init(struct snd_sof_dev *sdev, struct snd_dma_buffer *dmab,
3838
struct sof_ipc_dma_trace_params_ext *dtrace_params)
3939
{
4040
struct acp_dsp_stream *stream;
@@ -46,7 +46,7 @@ int acp_sof_trace_init(struct snd_sof_dev *sdev,
4646
if (!stream)
4747
return -ENODEV;
4848

49-
stream->dmab = &sdev->dmatb;
49+
stream->dmab = dmab;
5050
stream->num_pages = NUM_PAGES;
5151

5252
ret = acp_dsp_stream_config(sdev, stream);

sound/soc/sof/amd/acp.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ extern struct snd_sof_dsp_ops sof_renoir_ops;
212212
int snd_amd_acp_find_config(struct pci_dev *pci);
213213

214214
/* Trace */
215-
int acp_sof_trace_init(struct snd_sof_dev *sdev,
215+
int acp_sof_trace_init(struct snd_sof_dev *sdev, struct snd_dma_buffer *dmab,
216216
struct sof_ipc_dma_trace_params_ext *dtrace_params);
217217
int acp_sof_trace_release(struct snd_sof_dev *sdev);
218218

sound/soc/sof/intel/hda-trace.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ static int hda_dsp_trace_prepare(struct snd_sof_dev *sdev, struct snd_dma_buffer
3636
return ret;
3737
}
3838

39-
int hda_dsp_trace_init(struct snd_sof_dev *sdev,
39+
int hda_dsp_trace_init(struct snd_sof_dev *sdev, struct snd_dma_buffer *dmab,
4040
struct sof_ipc_dma_trace_params_ext *dtrace_params)
4141
{
4242
struct sof_intel_hda_dev *hda = sdev->pdata->hw_pdata;
@@ -57,7 +57,7 @@ int hda_dsp_trace_init(struct snd_sof_dev *sdev,
5757
* initialize capture stream, set BDL address and return corresponding
5858
* stream tag which will be sent to the firmware by IPC message.
5959
*/
60-
ret = hda_dsp_trace_prepare(sdev, &sdev->dmatb);
60+
ret = hda_dsp_trace_prepare(sdev, dmab);
6161
if (ret < 0) {
6262
dev_err(sdev->dev, "error: hdac trace init failed: %d\n", ret);
6363
hda_dsp_stream_put(sdev, SNDRV_PCM_STREAM_CAPTURE,

sound/soc/sof/intel/hda.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -664,7 +664,7 @@ static inline int hda_codec_i915_exit(struct snd_sof_dev *sdev) { return 0; }
664664
/*
665665
* Trace Control.
666666
*/
667-
int hda_dsp_trace_init(struct snd_sof_dev *sdev,
667+
int hda_dsp_trace_init(struct snd_sof_dev *sdev, struct snd_dma_buffer *dmab,
668668
struct sof_ipc_dma_trace_params_ext *dtrace_params);
669669
int hda_dsp_trace_release(struct snd_sof_dev *sdev);
670670
int hda_dsp_trace_trigger(struct snd_sof_dev *sdev, int cmd);

sound/soc/sof/ipc3-dtrace.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ static int ipc3_dtrace_enable(struct snd_sof_dev *sdev)
411411
sdev->host_offset = 0;
412412
sdev->dtrace_draining = false;
413413

414-
ret = sof_dtrace_host_init(sdev, &params);
414+
ret = sof_dtrace_host_init(sdev, &sdev->dmatb, &params);
415415
if (ret < 0) {
416416
dev_err(sdev->dev, "Host dtrace init failed: %d\n", ret);
417417
return ret;

sound/soc/sof/ipc3-priv.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,13 @@ int ipc3_dtrace_posn_update(struct snd_sof_dev *sdev,
3131

3232
/* dtrace platform callback wrappers */
3333
static inline int sof_dtrace_host_init(struct snd_sof_dev *sdev,
34+
struct snd_dma_buffer *dmatb,
3435
struct sof_ipc_dma_trace_params_ext *dtrace_params)
3536
{
3637
struct snd_sof_dsp_ops *dsp_ops = sdev->pdata->desc->ops;
3738

3839
if (dsp_ops->trace_init)
39-
return dsp_ops->trace_init(sdev, dtrace_params);
40+
return dsp_ops->trace_init(sdev, dmatb, dtrace_params);
4041

4142
return 0;
4243
}

sound/soc/sof/sof-priv.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,8 +254,9 @@ struct snd_sof_dsp_ops {
254254
size_t size, const char *name,
255255
enum sof_debugfs_access_type access_type); /* optional */
256256

257-
/* host DMA trace initialization */
257+
/* host DMA trace (IPC3) */
258258
int (*trace_init)(struct snd_sof_dev *sdev,
259+
struct snd_dma_buffer *dmatb,
259260
struct sof_ipc_dma_trace_params_ext *dtrace_params); /* optional */
260261
int (*trace_release)(struct snd_sof_dev *sdev); /* optional */
261262
int (*trace_trigger)(struct snd_sof_dev *sdev,

0 commit comments

Comments
 (0)