aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2012-01-23 11:10:24 -0500
committerTakashi Iwai <tiwai@suse.de>2012-01-23 11:15:03 -0500
commit52409aa6a0e96337da137c069856298f4dd825a0 (patch)
tree34483e4164dc6b6653846b222d01cab0c107f25d /sound/pci
parentcb0cdebbf8b834110ef67ed9335d5bafed7835df (diff)
ALSA: hda - Fix buffer-alignment regression with Nvidia HDMI
The commit 2ae66c26550cd94b0e2606a9275eb0ab7070ad0e ALSA: hda: option to enable arbitrary buffer/period sizes introduced a regression on machines with Intel controller and Nvidia HDMI. The reason is that the driver modifies the global variable align_buffer_size when an Intel controller is found, and the Nvidia HDMI controller is probed after Intel although Nvidia chips require the aligned buffers. This patch fixes the problem by moving the flag into the local struct so that it's not affected by other controllers. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=42567 Cc: <stable@kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci')
-rw-r--r--sound/pci/hda/hda_intel.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index fb35474c1203..95dfb6874941 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -469,6 +469,7 @@ struct azx {
469 unsigned int irq_pending_warned :1; 469 unsigned int irq_pending_warned :1;
470 unsigned int probing :1; /* codec probing phase */ 470 unsigned int probing :1; /* codec probing phase */
471 unsigned int snoop:1; 471 unsigned int snoop:1;
472 unsigned int align_buffer_size:1;
472 473
473 /* for debugging */ 474 /* for debugging */
474 unsigned int last_cmd[AZX_MAX_CODECS]; 475 unsigned int last_cmd[AZX_MAX_CODECS];
@@ -1690,7 +1691,7 @@ static int azx_pcm_open(struct snd_pcm_substream *substream)
1690 runtime->hw.rates = hinfo->rates; 1691 runtime->hw.rates = hinfo->rates;
1691 snd_pcm_limit_hw_rates(runtime); 1692 snd_pcm_limit_hw_rates(runtime);
1692 snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS); 1693 snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS);
1693 if (align_buffer_size) 1694 if (chip->align_buffer_size)
1694 /* constrain buffer sizes to be multiple of 128 1695 /* constrain buffer sizes to be multiple of 128
1695 bytes. This is more efficient in terms of memory 1696 bytes. This is more efficient in terms of memory
1696 access but isn't required by the HDA spec and 1697 access but isn't required by the HDA spec and
@@ -2773,8 +2774,9 @@ static int __devinit azx_create(struct snd_card *card, struct pci_dev *pci,
2773 } 2774 }
2774 2775
2775 /* disable buffer size rounding to 128-byte multiples if supported */ 2776 /* disable buffer size rounding to 128-byte multiples if supported */
2777 chip->align_buffer_size = align_buffer_size;
2776 if (chip->driver_caps & AZX_DCAPS_BUFSIZE) 2778 if (chip->driver_caps & AZX_DCAPS_BUFSIZE)
2777 align_buffer_size = 0; 2779 chip->align_buffer_size = 0;
2778 2780
2779 /* allow 64bit DMA address if supported by H/W */ 2781 /* allow 64bit DMA address if supported by H/W */
2780 if ((gcap & ICH6_GCAP_64OK) && !pci_set_dma_mask(pci, DMA_BIT_MASK(64))) 2782 if ((gcap & ICH6_GCAP_64OK) && !pci_set_dma_mask(pci, DMA_BIT_MASK(64)))