• Takashi Iwai's avatar
    ALSA: pcm: Introduce copy_user, copy_kernel and fill_silence ops · 29d1a873
    Takashi Iwai authored
    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: default avatarTakashi Sakamoto <o-takashi@sakamocchi.jp>
    Acked-by: default avatarMark Brown <broonie@kernel.org>
    Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
    29d1a873
soc-pcm.c 83.3 KB