aboutsummaryrefslogtreecommitdiffstats
path: root/sound/core
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2014-12-30 10:42:07 -0500
committerTakashi Iwai <tiwai@suse.de>2014-12-30 10:42:07 -0500
commit240491e143414973a0204e6c7cd4cfd19cb3e027 (patch)
tree4c9f368bc501d3f0bbcee54c3a81ff7cb2a7aa6d /sound/core
parent614acf93dceb8e9d73370f7c9b19f64c8cf17496 (diff)
parent757b037650c9ecca79a46ab744820b1b3c1bb49d (diff)
Merge branch 'topic/pcm-params' into for-next
Diffstat (limited to 'sound/core')
-rw-r--r--sound/core/oss/pcm_oss.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sound/core/oss/pcm_oss.c b/sound/core/oss/pcm_oss.c
index ada69d7a8d70..80423a4ccab6 100644
--- a/sound/core/oss/pcm_oss.c
+++ b/sound/core/oss/pcm_oss.c
@@ -719,7 +719,7 @@ static int snd_pcm_oss_period_size(struct snd_pcm_substream *substream,
719 719
720 oss_buffer_size = snd_pcm_plug_client_size(substream, 720 oss_buffer_size = snd_pcm_plug_client_size(substream,
721 snd_pcm_hw_param_value_max(slave_params, SNDRV_PCM_HW_PARAM_BUFFER_SIZE, NULL)) * oss_frame_size; 721 snd_pcm_hw_param_value_max(slave_params, SNDRV_PCM_HW_PARAM_BUFFER_SIZE, NULL)) * oss_frame_size;
722 oss_buffer_size = 1 << ld2(oss_buffer_size); 722 oss_buffer_size = rounddown_pow_of_two(oss_buffer_size);
723 if (atomic_read(&substream->mmap_count)) { 723 if (atomic_read(&substream->mmap_count)) {
724 if (oss_buffer_size > runtime->oss.mmap_bytes) 724 if (oss_buffer_size > runtime->oss.mmap_bytes)
725 oss_buffer_size = runtime->oss.mmap_bytes; 725 oss_buffer_size = runtime->oss.mmap_bytes;
@@ -755,14 +755,14 @@ static int snd_pcm_oss_period_size(struct snd_pcm_substream *substream,
755 min_period_size = snd_pcm_plug_client_size(substream, 755 min_period_size = snd_pcm_plug_client_size(substream,
756 snd_pcm_hw_param_value_min(slave_params, SNDRV_PCM_HW_PARAM_PERIOD_SIZE, NULL)); 756 snd_pcm_hw_param_value_min(slave_params, SNDRV_PCM_HW_PARAM_PERIOD_SIZE, NULL));
757 min_period_size *= oss_frame_size; 757 min_period_size *= oss_frame_size;
758 min_period_size = 1 << (ld2(min_period_size - 1) + 1); 758 min_period_size = roundup_pow_of_two(min_period_size);
759 if (oss_period_size < min_period_size) 759 if (oss_period_size < min_period_size)
760 oss_period_size = min_period_size; 760 oss_period_size = min_period_size;
761 761
762 max_period_size = snd_pcm_plug_client_size(substream, 762 max_period_size = snd_pcm_plug_client_size(substream,
763 snd_pcm_hw_param_value_max(slave_params, SNDRV_PCM_HW_PARAM_PERIOD_SIZE, NULL)); 763 snd_pcm_hw_param_value_max(slave_params, SNDRV_PCM_HW_PARAM_PERIOD_SIZE, NULL));
764 max_period_size *= oss_frame_size; 764 max_period_size *= oss_frame_size;
765 max_period_size = 1 << ld2(max_period_size); 765 max_period_size = rounddown_pow_of_two(max_period_size);
766 if (oss_period_size > max_period_size) 766 if (oss_period_size > max_period_size)
767 oss_period_size = max_period_size; 767 oss_period_size = max_period_size;
768 768