summaryrefslogtreecommitdiff
path: root/sound/pci/emu10k1/voice.c
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@gmx.de>2023-05-18 17:09:44 +0300
committerTakashi Iwai <tiwai@suse.de>2023-05-18 17:55:56 +0300
commit82a9fa6e9e3c769f7edc62810c9718997cada53d (patch)
treec6a70fb3b045f541c8419f9b6401a9a285a130f8 /sound/pci/emu10k1/voice.c
parentb840f8d8fcb3df9e65bb6782a9072897b6ea117d (diff)
downloadlinux-82a9fa6e9e3c769f7edc62810c9718997cada53d.tar.xz
ALSA: emu10k1: make freeing untouched playback voices cheap
This allows us to drop the code that tries to preserve already allocated voices upon repeated hw_param callback invocations. Getting it right for multi-channel voices would otherwise get a bit hairy. Signed-off-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de> Link: https://lore.kernel.org/r/20230518140947.3725394-5-oswald.buddenhagen@gmx.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/emu10k1/voice.c')
-rw-r--r--sound/pci/emu10k1/voice.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sound/pci/emu10k1/voice.c b/sound/pci/emu10k1/voice.c
index ac89d09ed9bc..25e78fc188bf 100644
--- a/sound/pci/emu10k1/voice.c
+++ b/sound/pci/emu10k1/voice.c
@@ -87,9 +87,10 @@ static int voice_alloc(struct snd_emu10k1 *emu, int type, int number,
static void voice_free(struct snd_emu10k1 *emu,
struct snd_emu10k1_voice *pvoice)
{
- snd_emu10k1_voice_init(emu, pvoice->number);
+ if (pvoice->dirty)
+ snd_emu10k1_voice_init(emu, pvoice->number);
pvoice->interrupt = NULL;
- pvoice->use = 0;
+ pvoice->use = pvoice->dirty = 0;
pvoice->epcm = NULL;
}