]> git.baikalelectronics.ru Git - kernel.git/commit
ALSA: pcm: Check mmap capability of runtime dma buffer at first
authorTakashi Iwai <tiwai@suse.de>
Mon, 9 Aug 2021 07:18:27 +0000 (09:18 +0200)
committerTakashi Iwai <tiwai@suse.de>
Mon, 9 Aug 2021 08:04:03 +0000 (10:04 +0200)
commit5c9131d0efb96dd7ded2b6cb71e779cc736e6966
tree4daea31e89ebe33e32afa4d160d12bef23b55c14
parent3b89ca227a23d97f7a6493d52105d758ac2b82d1
ALSA: pcm: Check mmap capability of runtime dma buffer at first

Currently we check only the substream->dma_buffer as the preset of the
buffer configuration for verifying the availability of mmap.  But a
few drivers rather set up the buffer in the own way without the
standard buffer preallocation using substream->dma_buffer, and they
miss the proper checks.  (Now it's working more or less fine as most
of them are running only on x86).

Actually, they may set up the runtime dma_buffer (referred via
snd_pcm_get_dma_buf()) at the open callback, though.  That is, this
could have been used as the primary source.

This patch changes the hw_support_mmap() function to check the runtime
dma buffer at first.  It's usually NULL with the standard buffer
preallocation, and in that case, we continue checking
substream->dma_buffer as fallback.

Link: https://lore.kernel.org/r/20210809071829.22238-2-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/core/pcm_native.c