ALSA: core: Implement compress page allocation and free routines
Add simple malloc and free methods for memory management for compress streams. Based on snd_pcm_lib_malloc_pages and snd_pcm_lib_free_pages implementation. Signed-off-by: Divya Prakash <divya1.prakash@intel.com> Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> Reviewed-by: Takashi Iwai <tiwai@suse.de> Acked-by: Vinod Koul <vkoul@kernel.org> Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20200218143924.10565-3-cezary.rojewski@intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:

committed by
Mark Brown

parent
386dd54b3a
commit
b9759ef2fd
@@ -67,6 +67,7 @@ struct snd_compr_runtime {
|
||||
* @metadata_set: metadata set flag, true when set
|
||||
* @next_track: has userspace signal next track transition, true when set
|
||||
* @private_data: pointer to DSP private data
|
||||
* @dma_buffer: allocated buffer if any
|
||||
*/
|
||||
struct snd_compr_stream {
|
||||
const char *name;
|
||||
@@ -78,6 +79,7 @@ struct snd_compr_stream {
|
||||
bool metadata_set;
|
||||
bool next_track;
|
||||
void *private_data;
|
||||
struct snd_dma_buffer dma_buffer;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -212,6 +214,9 @@ snd_compr_set_runtime_buffer(struct snd_compr_stream *stream,
|
||||
}
|
||||
}
|
||||
|
||||
int snd_compr_malloc_pages(struct snd_compr_stream *stream, size_t size);
|
||||
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);
|
||||
|
||||
|
Reference in New Issue
Block a user