OSDN Git Service

pcm: dmix: Allow disabling x86 optimizations
authorTakashi Iwai <tiwai@suse.de>
Fri, 10 Feb 2017 11:16:12 +0000 (12:16 +0100)
committerTakashi Iwai <tiwai@suse.de>
Fri, 10 Feb 2017 11:16:12 +0000 (12:16 +0100)
commit22eca6468b4aea47c783770ec0739d1e13bf3bfc
tree2a46ad8bb174162e439f5224abfe444c6da638e8
parente31a3273df6eb619e35d10bf6a0fc0fded91d559
pcm: dmix: Allow disabling x86 optimizations

The dmix plugin has some optimized implementations for x86 using the
direct memory accesses, which was rather the original version, in
addition to the "generic" implementation using the semaphore
blocking.  The x86 implementation relies on the memory coherency *and*
the fast read/write on it.

For other architectures, this has been always disabled just because of
memory coherency.  But, the recent LPE audio development revealed
that, even on x86 platforms, the read/write performance might become
extremely bad when the buffer is marked as uncached.  Some drivers
already know the buffer is uncached, we need to switch to the generic
mode in such a case.

This patch introduces yet another flag to dmix configuration,
direct_memory_access, that indicates whether the x86-specific
optimization can be used or not.  Each driver can set the flag in its
cards config namespace, and the default dmix config refers to it.

As of this patch, only HDMI LPE Audio driver sets it.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
src/conf/cards/HdmiLpeAudio.conf
src/conf/pcm/dmix.conf
src/pcm/pcm_direct.c
src/pcm/pcm_direct.h
src/pcm/pcm_dmix.c
src/pcm/pcm_dmix_i386.c
src/pcm/pcm_dmix_x86_64.c