OSDN Git Service

pcm: dmix: Fix semaphore usage with lockless operation
authorTakashi Iwai <tiwai@suse.de>
Fri, 19 Jun 2020 16:40:46 +0000 (18:40 +0200)
committerTakashi Iwai <tiwai@suse.de>
Tue, 7 Jul 2020 09:57:03 +0000 (11:57 +0200)
commitd824b461ae807ea436e2df36da9c2212e485e3e6
tree7f17961e83bdde9cd782aab34b9c8205ba2eb702
parent4759865c861c708ce4a68fc08060fc820628ccaf
pcm: dmix: Fix semaphore usage with lockless operation

As Maarten Baert recently reported, the current dmix code applies the
semaphore unnecessarily around mixing streams even when the lockless
mix operation is used on x86.  This was rather introduced mistakenly
at the commit 267d7c728196 ("Add support of little-endian on
i386/x86_64 dmix") where the generic dmix code was included on x86,
too.

For achieving the original performance back, this patch changes the
semaphore handling to be checked at run time instead of statically at
compile time.

Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
src/pcm/pcm_direct.h
src/pcm/pcm_dmix.c
src/pcm/pcm_dmix_generic.c
src/pcm/pcm_dmix_i386.c
src/pcm/pcm_dmix_x86_64.c