mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-11-06 13:29:59 -05:00
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>
This commit is contained in:
parent
e31a3273df
commit
22eca6468b
7 changed files with 39 additions and 0 deletions
|
|
@ -87,6 +87,11 @@ static void mix_select_callbacks(snd_pcm_direct_t *dmix)
|
|||
{
|
||||
static int smp = 0, mmx = 0, cmov = 0;
|
||||
|
||||
if (!dmix->direct_memory_access) {
|
||||
generic_mix_select_callbacks(dmix);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!((1ULL<< dmix->shmptr->s.format) & i386_dmix_supported_format)) {
|
||||
generic_mix_select_callbacks(dmix);
|
||||
return;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue