rpms/kernel/devel hda_intel-prealloc-4mb-dmabuffer.patch, NONE, 1.1 kernel.spec, 1.1368, 1.1369

Kyle McMartin kyle at fedoraproject.org
Tue Mar 3 18:36:50 UTC 2009


Author: kyle

Update of /cvs/pkgs/rpms/kernel/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv28425

Modified Files:
	kernel.spec 
Added Files:
	hda_intel-prealloc-4mb-dmabuffer.patch 
Log Message:
* Tue Mar 03 2009 Kyle McMartin <kyle at redhat.com>
- Allocate a bigger default DMA buffer for snd-hda_intel. Azalia uses a
  32-bit or wider DMA mask, so this is fine.


hda_intel-prealloc-4mb-dmabuffer.patch:

--- NEW FILE hda_intel-prealloc-4mb-dmabuffer.patch ---
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index c8d9178..7d3bb15 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -1774,6 +1774,7 @@ azx_attach_pcm_stream(struct hda_bus *bus, struct hda_codec *codec,
 	struct azx_pcm *apcm;
 	int pcm_dev = cpcm->device;
 	int s, err;
+	size_t prealloc_min = 64*1024;	/* 64KB */
 
 	if (pcm_dev >= AZX_MAX_PCMS) {
 		snd_printk(KERN_ERR SFX "Invalid PCM device number %d\n",
@@ -1807,10 +1808,21 @@ azx_attach_pcm_stream(struct hda_bus *bus, struct hda_codec *codec,
 		if (cpcm->stream[s].substreams)
 			snd_pcm_set_ops(pcm, s, &azx_pcm_ops);
 	}
+
 	/* buffer pre-allocation */
+
+	/* subtle, don't allocate a big buffer for modems...
+	 * also, don't just test 32BIT_MASK, since azx supports
+	 * 64-bit DMA in some cases.
+	 */
+	/* lennart wants a 2.2MB buffer for 2sec of 48khz */
+	if (pcm->dev_class == SNDRV_PCM_CLASS_GENERIC &&
+	    chip->pci->dma_mask >= DMA_32BIT_MASK)
+		prealloc_min = 4 * 1024 * 1024;	/* 4MB */
+
 	snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV_SG,
 					      snd_dma_pci_data(chip->pci),
-					      1024 * 64, 32 * 1024 * 1024);
+					      prealloc_min, 32 * 1024 * 1024);
 	return 0;
 }
 


Index: kernel.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/kernel.spec,v
retrieving revision 1.1368
retrieving revision 1.1369
diff -u -r1.1368 -r1.1369
--- kernel.spec	3 Mar 2009 18:18:42 -0000	1.1368
+++ kernel.spec	3 Mar 2009 18:36:19 -0000	1.1369
@@ -628,6 +628,7 @@
 Patch580: linux-2.6-sparc-selinux-mprotect-checks.patch
 
 Patch600: linux-2.6-defaults-alsa-hda-beep-off.patch
+Patch610: hda_intel-prealloc-4mb-dmabuffer.patch
 
 Patch670: linux-2.6-ata-quirk.patch
 
@@ -1149,6 +1150,7 @@
 
 # squelch hda_beep by default
 ApplyPatch linux-2.6-defaults-alsa-hda-beep-off.patch
+ApplyPatch hda_intel-prealloc-4mb-dmabuffer.patch
 
 # ia64 ata quirk
 ApplyPatch linux-2.6-ata-quirk.patch
@@ -1788,6 +1790,10 @@
 
 %changelog
 * Tue Mar 03 2009 Kyle McMartin <kyle at redhat.com>
+- Allocate a bigger default DMA buffer for snd-hda_intel. Azalia uses a
+  32-bit or wider DMA mask, so this is fine.
+
+* Tue Mar 03 2009 Kyle McMartin <kyle at redhat.com>
 - Add bluetooth-testing git tree. Mostly bugfixes...
 
 * Tue Mar 03 2009 Dave Airlie <airlied at redhat.com>




More information about the fedora-extras-commits mailing list