]> git.karo-electronics.de Git - karo-tx-linux.git/commit
ALSA: pcm: Introduce copy_user, copy_kernel and fill_silence ops
authorTakashi Iwai <tiwai@suse.de>
Wed, 10 May 2017 18:02:35 +0000 (20:02 +0200)
committerTakashi Iwai <tiwai@suse.de>
Fri, 2 Jun 2017 17:37:23 +0000 (19:37 +0200)
commit29d1a873de542cbb46d0641037d2601cb76be5b1
tree7139a700857874a25081c00dd0af4e1c85e6fb18
parent7421a1671abe5bc07cc7a09f5a1be45acc403db7
ALSA: pcm: Introduce copy_user, copy_kernel and fill_silence ops

For supporting the explicit in-kernel copy of PCM buffer data, and
also for further code refactoring, three new PCM ops, copy_user,
copy_kernel and fill_silence, are introduced.  The old copy and
silence ops will be deprecated and removed later once when all callers
are converted.

The copy_kernel ops is the new one, and it's supposed to transfer the
PCM data from the given kernel buffer to the hardware ring-buffer (or
vice-versa depending on the stream direction), while the copy_user ops
is equivalent with the former copy ops, to transfer the data from the
user-space buffer.

The major difference of the new copy_* and fill_silence ops from the
previous ops is that the new ops take bytes instead of frames for size
and position arguments.  It has two merits: first, it allows the
callback implementation often simpler (just call directly memcpy() &
co), and second, it may unify the implementations of both interleaved
and non-interleaved cases, as we'll see in the later patch.

As of this stage, copy_kernel ops isn't referred yet, but only
copy_user is used.

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