diff options
author | Takashi Iwai <tiwai@suse.de> | 2021-08-02 09:28:03 +0200 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2021-08-04 08:08:06 +0200 |
commit | ac9245a5406e6074a1aa211f103629d3f154c5a5 (patch) | |
tree | 068428c901ef2bfeebe94ee8613011e71579f6b7 /Documentation | |
parent | 58a95dfa4fdd9c72e62be34dd025d268c1e04a83 (diff) | |
download | linux-ac9245a5406e6074a1aa211f103629d3f154c5a5.tar.bz2 |
ALSA: pcm: Allow exact buffer preallocation
A few drivers want to have rather the exact buffer preallocation at
the driver probe time and keep using it for the whole operations
without allowing dynamic buffer allocation. For satisfying the
demands, this patch extends the managed buffer allocation API
slightly.
Namely, when 0 is passed to max argument of the allocation helper
functions snd_pcm_set_managed_buffer*(), it treats as if the fixed
size allocation of the given size. If the pre-allocation fails in
this mode, the function returns now -ENOMEM. Otherwise, i.e. max
argument is non-zero, the function never returns -ENOMEM but tries to
fall back to the smaller chunks and allows the dynamic allocation
later -- which is still the default behavior until now.
For more intuitive use, also two new helpers are added for handling
the fixed size buffer allocation, too: snd_pcm_set_fixed_buffer() and
snd_pcm_set_fixed_buffer_all().
Acked-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20210802072815.13551-4-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'Documentation')
0 files changed, 0 insertions, 0 deletions