]> git.baikalelectronics.ru Git - kernel.git/commit
ALSA: pcm: Direct in-kernel read/write support
authorTakashi Iwai <tiwai@suse.de>
Wed, 24 May 2017 16:23:20 +0000 (18:23 +0200)
committerTakashi Iwai <tiwai@suse.de>
Fri, 2 Jun 2017 17:38:24 +0000 (19:38 +0200)
commit267c805dd9dbc3b4930a077560788e3c76c16e88
treee8d3036ac6fe85d3e0b43bfa0dec7f16ee315127
parentba7a1bfe6fd3458e856cdd520456f7f28b934eee
ALSA: pcm: Direct in-kernel read/write support

Now all materials are ready, let's allow the direct in-kernel
read/write, i.e. a kernel-space buffer is passed for read or write,
instead of the normal user-space buffer.  This feature is used by OSS
layer and UAC1 driver, for example.

The __snd_pcm_lib_xfer() takes in_kernel argument that indicates the
in-kernel buffer copy.  When this flag is set, another transfer code
is used.  It's either via copy_kernel PCM ops or the normal memcpy(),
depending on the driver setup.

As external API, snd_pcm_kernel_read(), *_write() and other variants
are provided.

That's all.  This support is really simple because of the code
refactoring until now.

Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
include/sound/pcm.h
sound/core/pcm_lib.c