summaryrefslogtreecommitdiff
path: root/include/sound/compress_driver.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/sound/compress_driver.h')
-rw-r--r--include/sound/compress_driver.h50
1 files changed, 50 insertions, 0 deletions
diff --git a/include/sound/compress_driver.h b/include/sound/compress_driver.h
index bcf872c17dd3..b55c9eeb2b54 100644
--- a/include/sound/compress_driver.h
+++ b/include/sound/compress_driver.h
@@ -20,6 +20,30 @@
struct snd_compr_ops;
/**
+ * struct snd_compr_task_runtime: task runtime description
+ * @list: list of all managed tasks
+ * @input: input DMA buffer
+ * @output: output DMA buffer
+ * @seqno: sequence number
+ * @input_size: really used data in the input buffer
+ * @output_size: really used data in the output buffer
+ * @flags: see SND_COMPRESS_TFLG_*
+ * @state: actual task state
+ * @private_value: used by the lowlevel driver (opaque)
+ */
+struct snd_compr_task_runtime {
+ struct list_head list;
+ struct dma_buf *input;
+ struct dma_buf *output;
+ u64 seqno;
+ u64 input_size;
+ u64 output_size;
+ u32 flags;
+ u8 state;
+ void *private_value;
+};
+
+/**
* struct snd_compr_runtime: runtime stream description
* @state: stream state
* @ops: pointer to DSP callbacks
@@ -37,6 +61,10 @@ struct snd_compr_ops;
* @dma_addr: physical buffer address (not accessible from main CPU)
* @dma_bytes: size of DMA area
* @dma_buffer_p: runtime dma buffer pointer
+ * @active_tasks: count of active tasks
+ * @total_tasks: count of all tasks
+ * @task_seqno: last task sequence number (!= 0)
+ * @tasks: list of all tasks
*/
struct snd_compr_runtime {
snd_pcm_state_t state;
@@ -54,6 +82,13 @@ struct snd_compr_runtime {
dma_addr_t dma_addr;
size_t dma_bytes;
struct snd_dma_buffer *dma_buffer_p;
+
+#if IS_ENABLED(CONFIG_SND_COMPRESS_ACCEL)
+ u32 active_tasks;
+ u32 total_tasks;
+ u64 task_seqno;
+ struct list_head tasks;
+#endif
};
/**
@@ -108,6 +143,10 @@ struct snd_compr_stream {
* Not valid if copy is implemented
* @get_caps: Retrieve DSP capabilities, mandatory
* @get_codec_caps: Retrieve capabilities for a specific codec, mandatory
+ * @task_create: Create a set of input/output buffers for accel operations
+ * @task_start: Start (queue) a task for accel operations
+ * @task_stop: Stop (dequeue) a task for accel operations
+ * @task_free: Free a set of input/output buffers for accel operations
*/
struct snd_compr_ops {
int (*open)(struct snd_compr_stream *stream);
@@ -132,6 +171,12 @@ struct snd_compr_ops {
struct snd_compr_caps *caps);
int (*get_codec_caps) (struct snd_compr_stream *stream,
struct snd_compr_codec_caps *codec);
+#if IS_ENABLED(CONFIG_SND_COMPRESS_ACCEL)
+ int (*task_create) (struct snd_compr_stream *stream, struct snd_compr_task_runtime *task);
+ int (*task_start) (struct snd_compr_stream *stream, struct snd_compr_task_runtime *task);
+ int (*task_stop) (struct snd_compr_stream *stream, struct snd_compr_task_runtime *task);
+ int (*task_free) (struct snd_compr_stream *stream, struct snd_compr_task_runtime *task);
+#endif
};
/**
@@ -242,4 +287,9 @@ int snd_compr_free_pages(struct snd_compr_stream *stream);
int snd_compr_stop_error(struct snd_compr_stream *stream,
snd_pcm_state_t state);
+#if IS_ENABLED(CONFIG_SND_COMPRESS_ACCEL)
+void snd_compr_task_finished(struct snd_compr_stream *stream,
+ struct snd_compr_task_runtime *task);
+#endif
+
#endif