-
Notifications
You must be signed in to change notification settings - Fork 133
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
Probes ipc4 get config #5249
base: topic/sof-dev
Are you sure you want to change the base?
Probes ipc4 get config #5249
Changes from all commits
0fbd254
40cbc3f
5913a74
63baac3
f5bbc39
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,8 +17,14 @@ | |
|
||
#include <sound/soc.h> | ||
#include <sound/sof/header.h> | ||
#include <sound/sof/ipc4/header.h> | ||
#include "sof-client.h" | ||
#include "sof-client-probes.h" | ||
#include "sof-audio.h" | ||
|
||
#ifdef CONFIG_SND_SOC_SOF_IPC4 | ||
#include "ipc4-priv.h" | ||
#endif | ||
|
||
#define SOF_PROBES_SUSPEND_DELAY_MS 3000 | ||
/* only extraction supported for now */ | ||
|
@@ -69,7 +75,8 @@ static int sof_probes_compr_shutdown(struct snd_compr_stream *cstream, | |
int i, ret; | ||
|
||
/* disconnect all probe points */ | ||
ret = ipc->points_info(cdev, &desc, &num_desc); | ||
ret = ipc->points_info(cdev, &desc, &num_desc, | ||
PROBES_INFO_ACTIVE_PROBES); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hrm, so this will introduce an error print with IPC3 as the ACTIVE_PROBES is handled as error in there? With IPC3 we don't have distinction between active or available probes, right? Both case should be handled in a similar way, provide all the probes. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No. The active probes is the old feature that is supported also by ipc3. The available probes, giving all connection points availbale, is the new feature that is not supperted by ipc3. E.g. this call is equivalent to the old function that did not have the type argument. If somebody tries to read "probe_points_available" in ipc3 system, then this funcion is called with PROBES_INFO_AVAILABLE_PROBES, and there will be a read error due to an ipc error. Then again nothing, but the lack of time, is stopping us from implementing available probes query for ipc3 too. |
||
if (ret < 0) { | ||
dev_err(dai->dev, "Failed to get probe points: %d\n", ret); | ||
goto exit; | ||
|
@@ -189,7 +196,8 @@ static const struct snd_compress_ops sof_probes_compressed_ops = { | |
}; | ||
|
||
static ssize_t sof_probes_dfs_points_read(struct file *file, char __user *to, | ||
size_t count, loff_t *ppos) | ||
size_t count, loff_t *ppos, | ||
enum sof_probe_info_type type) | ||
{ | ||
struct sof_client_dev *cdev = file->private_data; | ||
struct sof_probes_priv *priv = cdev->data; | ||
|
@@ -216,16 +224,20 @@ static ssize_t sof_probes_dfs_points_read(struct file *file, char __user *to, | |
goto exit; | ||
} | ||
|
||
ret = ipc->points_info(cdev, &desc, &num_desc); | ||
ret = ipc->points_info(cdev, &desc, &num_desc, type); | ||
if (ret < 0) | ||
goto pm_error; | ||
|
||
for (i = 0; i < num_desc; i++) { | ||
offset = strlen(buf); | ||
remaining = PAGE_SIZE - offset; | ||
ret = snprintf(buf + offset, remaining, | ||
"Id: %#010x Purpose: %u Node id: %#x\n", | ||
desc[i].buffer_id, desc[i].purpose, desc[i].stream_tag); | ||
if (ipc->point_print) | ||
ret = ipc->point_print(cdev, buf + offset, remaining, &desc[i]); | ||
else | ||
ret = snprintf(buf + offset, remaining, | ||
"Id: %#010x Purpose: %u Node id: %#x\n", | ||
desc[i].buffer_id, desc[i].purpose, desc[i].stream_tag); | ||
jsarha marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
if (ret < 0 || ret >= remaining) { | ||
/* truncate the output buffer at the last full line */ | ||
buf[offset] = '\0'; | ||
|
@@ -248,6 +260,22 @@ static ssize_t sof_probes_dfs_points_read(struct file *file, char __user *to, | |
return ret; | ||
} | ||
|
||
static ssize_t sof_probes_dfs_active_points_read(struct file *file, | ||
char __user *to, | ||
size_t count, loff_t *ppos) | ||
{ | ||
return sof_probes_dfs_points_read(file, to, count, ppos, | ||
PROBES_INFO_ACTIVE_PROBES); | ||
} | ||
|
||
static ssize_t sof_probes_dfs_available_points_read(struct file *file, | ||
char __user *to, | ||
size_t count, loff_t *ppos) | ||
{ | ||
return sof_probes_dfs_points_read(file, to, count, ppos, | ||
PROBES_INFO_AVAILABE_PROBES); | ||
} | ||
|
||
static ssize_t | ||
sof_probes_dfs_points_write(struct file *file, const char __user *from, | ||
size_t count, loff_t *ppos) | ||
|
@@ -298,15 +326,23 @@ sof_probes_dfs_points_write(struct file *file, const char __user *from, | |
return ret; | ||
} | ||
|
||
static const struct file_operations sof_probes_points_fops = { | ||
static const struct file_operations sof_probes_active_points_fops = { | ||
.open = simple_open, | ||
.read = sof_probes_dfs_points_read, | ||
.read = sof_probes_dfs_active_points_read, | ||
.write = sof_probes_dfs_points_write, | ||
.llseek = default_llseek, | ||
|
||
.owner = THIS_MODULE, | ||
}; | ||
|
||
static const struct file_operations sof_probes_available_points_fops = { | ||
.open = simple_open, | ||
.read = sof_probes_dfs_available_points_read, | ||
.llseek = default_llseek, | ||
|
||
.owner = THIS_MODULE, | ||
}; | ||
|
||
static ssize_t | ||
sof_probes_dfs_points_remove_write(struct file *file, const char __user *from, | ||
size_t count, loff_t *ppos) | ||
|
@@ -452,13 +488,17 @@ static int sof_probes_client_probe(struct auxiliary_device *auxdev, | |
|
||
/* create read-write probes_points debugfs entry */ | ||
priv->dfs_points = debugfs_create_file("probe_points", 0644, dfsroot, | ||
cdev, &sof_probes_points_fops); | ||
cdev, &sof_probes_active_points_fops); | ||
|
||
/* create read-write probe_points_remove debugfs entry */ | ||
priv->dfs_points_remove = debugfs_create_file("probe_points_remove", 0644, | ||
dfsroot, cdev, | ||
&sof_probes_points_remove_fops); | ||
|
||
/* create read-write probes_points debugfs entry */ | ||
priv->dfs_points = debugfs_create_file("probe_points_available", 0644, dfsroot, | ||
cdev, &sof_probes_available_points_fops); | ||
|
||
links = devm_kcalloc(dev, SOF_PROBES_NUM_DAI_LINKS, sizeof(*links), GFP_KERNEL); | ||
cpus = devm_kcalloc(dev, SOF_PROBES_NUM_DAI_LINKS, sizeof(*cpus), GFP_KERNEL); | ||
if (!links || !cpus) { | ||
|
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.
@ujfalusi its checked here that we only handle active probes request for ipc3, but there is no technical issue stopping us from implementing the "available" request in the FW for ipc3 and allowing it here.