r2311 - in trunk/kernel/source/kernel-source-2.6.10-2.6.10/debian: . patches

Sven Luther luther@costa.debian.org
Sun, 16 Jan 2005 23:02:41 +0100


Author: luther
Date: 2005-01-16 23:02:40 +0100 (Sun, 16 Jan 2005)
New Revision: 2311

Modified:
   trunk/kernel/source/kernel-source-2.6.10-2.6.10/debian/changelog
   trunk/kernel/source/kernel-source-2.6.10-2.6.10/debian/patches/alsa-emu10k1-ioctl-fix.dpatch
Log:
Added another couple changesets to fix DSP broken by the two first ones. Thanks to Fabbionne.


Modified: trunk/kernel/source/kernel-source-2.6.10-2.6.10/debian/changelog
===================================================================
--- trunk/kernel/source/kernel-source-2.6.10-2.6.10/debian/changelog	2005-01-16 14:08:08 UTC (rev 2310)
+++ trunk/kernel/source/kernel-source-2.6.10-2.6.10/debian/changelog	2005-01-16 22:02:40 UTC (rev 2311)
@@ -20,7 +20,7 @@
 
   * Fixes emu10k1_fx8010_code_t structure using indirect pointers to be less
     than 8192 bytes to follow the ioctl semantics and thus not break powerpc
-    builds. Userland ioctl value is still changed. (Sven Luther)
+    builds. Userland ioctl value is still changed. (Sven Luther and Fabbione)
 
   * Fix modular-vesafb.dpatch to not break the non-modular case
     (Christoph Hellwig) (closes: #289610).

Modified: trunk/kernel/source/kernel-source-2.6.10-2.6.10/debian/patches/alsa-emu10k1-ioctl-fix.dpatch
===================================================================
--- trunk/kernel/source/kernel-source-2.6.10-2.6.10/debian/patches/alsa-emu10k1-ioctl-fix.dpatch	2005-01-16 14:08:08 UTC (rev 2310)
+++ trunk/kernel/source/kernel-source-2.6.10-2.6.10/debian/patches/alsa-emu10k1-ioctl-fix.dpatch	2005-01-16 22:02:40 UTC (rev 2311)
@@ -6,15 +6,14 @@
 ## DP: to be less than 8192 bytes to follow the ioctl semantics and thus not break 
 ## DP: powerpc builds. Userland ioctl value is still changed.
 ## DP: Patch author: Jaroslav Kysela <perex@suse.cz>
-## DP: Upstream status: backport (1.1938.268.16 and 1.1938.271.2).
+## DP: Upstream status: backport (1.1938.268.16, 1.1938.271.2, 1.1938.329.35 and 1.1938.329.43).
 
 . $(dirname $0)/DPATCH
 
 @DPATCH@
-
-diff -ur kernel-source-2.6.10.orig/include/sound/emu10k1.h kernel-source-2.6.10/include/sound/emu10k1.h
---- kernel-source-2.6.10.orig/include/sound/emu10k1.h	2004-12-24 22:34:27.000000000 +0100
-+++ kernel-source-2.6.10/include/sound/emu10k1.h	2005-01-10 17:46:04.000000000 +0100
+diff -urNad linux-source-2.6.10-2.6.10/include/sound/emu10k1.h /usr/src/dpatchtemp/dpep.Zb4KzG/linux-source-2.6.10-2.6.10/include/sound/emu10k1.h
+--- linux-source-2.6.10-2.6.10/include/sound/emu10k1.h	2005-01-14 12:19:12.000000000 +0100
++++ /usr/src/dpatchtemp/dpep.Zb4KzG/linux-source-2.6.10-2.6.10/include/sound/emu10k1.h	2005-01-14 14:18:31.481220080 +0100
 @@ -1334,7 +1334,7 @@
  	char name[128];
  
@@ -39,9 +38,9 @@
  } emu10k1_fx8010_code_t;
  
  typedef struct {
-diff -ur kernel-source-2.6.10.orig/sound/pci/emu10k1/emufx.c kernel-source-2.6.10/sound/pci/emu10k1/emufx.c
---- kernel-source-2.6.10.orig/sound/pci/emu10k1/emufx.c	2004-12-24 22:34:57.000000000 +0100
-+++ kernel-source-2.6.10/sound/pci/emu10k1/emufx.c	2005-01-10 17:46:04.000000000 +0100
+diff -urNad linux-source-2.6.10-2.6.10/sound/pci/emu10k1/emufx.c /usr/src/dpatchtemp/dpep.Zb4KzG/linux-source-2.6.10-2.6.10/sound/pci/emu10k1/emufx.c
+--- linux-source-2.6.10-2.6.10/sound/pci/emu10k1/emufx.c	2005-01-14 12:19:12.000000000 +0100
++++ /usr/src/dpatchtemp/dpep.Zb4KzG/linux-source-2.6.10-2.6.10/sound/pci/emu10k1/emufx.c	2005-01-14 14:18:54.712688360 +0100
 @@ -437,7 +437,7 @@
  }
  
@@ -51,51 +50,29 @@
  {
  	snd_emu10k1_fx8010_irq_t *tmp;
  	unsigned long flags;
-@@ -465,25 +465,35 @@
-  * EMU10K1 effect manager
-  *************************************************************************/
- 
--static void snd_emu10k1_write_op(emu10k1_fx8010_code_t *icode, unsigned int *ptr,
--				 u32 op, u32 r, u32 a, u32 x, u32 y)
-+static int snd_emu10k1_write_op(emu10k1_fx8010_code_t *icode, unsigned int *ptr,
-+				u32 op, u32 r, u32 a, u32 x, u32 y)
+@@ -470,8 +470,8 @@
  {
  	snd_assert(*ptr < 512, return);
  	set_bit(*ptr, icode->code_valid);
 -	icode->code[*ptr    ][0] = ((x & 0x3ff) << 10) | (y & 0x3ff);
 -	icode->code[(*ptr)++][1] = ((op & 0x0f) << 20) | ((r & 0x3ff) << 10) | (a & 0x3ff);
-+	x = ((x & 0x3ff) << 10) | (y & 0x3ff);
-+	y = ((op & 0x0f) << 20) | ((r & 0x3ff) << 10) | (a & 0x3ff);
-+	a = *ptr++ * 2;
-+	if (put_user(x, &icode->code[a + 0]) ||
-+            put_user(y, &icode->code[a + 1]))
-+		return -EFAULT;
-+	return 0;
++	icode->code[(*ptr)   * 2 + 0] = ((x & 0x3ff) << 10) | (y & 0x3ff);
++	icode->code[(*ptr)++ * 2 + 1] = ((op & 0x0f) << 20) | ((r & 0x3ff) << 10) | (a & 0x3ff);
  }
  
  #define OP(icode, ptr, op, r, a, x, y) \
- 	snd_emu10k1_write_op(icode, ptr, op, r, a, x, y)
- 
--static void snd_emu10k1_audigy_write_op(emu10k1_fx8010_code_t *icode, unsigned int *ptr,
--					u32 op, u32 r, u32 a, u32 x, u32 y)
-+static int snd_emu10k1_audigy_write_op(emu10k1_fx8010_code_t *icode, unsigned int *ptr,
-+				       u32 op, u32 r, u32 a, u32 x, u32 y)
+@@ -482,8 +482,8 @@
  {
  	snd_assert(*ptr < 1024, return);
  	set_bit(*ptr, icode->code_valid);
 -	icode->code[*ptr    ][0] = ((x & 0x7ff) << 12) | (y & 0x7ff);
 -	icode->code[(*ptr)++][1] = ((op & 0x0f) << 24) | ((r & 0x7ff) << 12) | (a & 0x7ff);
-+	x = ((x & 0x7ff) << 12) | (y & 0x7ff);
-+	y = ((op & 0x0f) << 24) | ((r & 0x7ff) << 12) | (a & 0x7ff);
-+	a = *ptr++ * 2;
-+	if (put_user(x, &icode->code[a + 0]) ||
-+	    put_user(y, &icode->code[a + 1]))
-+		return -EFAULT;
-+	return 0;
++	icode->code[(*ptr)   * 2 + 0] = ((x & 0x7ff) << 12) | (y & 0x7ff);
++	icode->code[(*ptr)++ * 2 + 1] = ((op & 0x0f) << 24) | ((r & 0x7ff) << 12) | (a & 0x7ff);
  }
  
  #define A_OP(icode, ptr, op, r, a, x, y) \
-@@ -501,83 +511,108 @@
+@@ -501,83 +501,108 @@
  	return snd_emu10k1_ptr_read(emu, pc, 0);
  }
  
@@ -197,8 +174,9 @@
 +	u32 pc, lo, hi;
  
 -	for (pc = 0; pc < (emu->audigy ? 1024 : 512); pc++) {
+-		if (!test_bit(pc, icode->code_valid))
 +	for (pc = 0; pc < (emu->audigy ? 2*1024 : 2*512); pc += 2) {
- 		if (!test_bit(pc, icode->code_valid))
++		if (!test_bit(pc / 2, icode->code_valid))
  			continue;
 -		snd_emu10k1_efx_write(emu, pc * 2, icode->code[pc][0]);
 -		snd_emu10k1_efx_write(emu, pc * 2 + 1, icode->code[pc][1]);
@@ -218,10 +196,11 @@
  
  	memset(icode->code_valid, 0, sizeof(icode->code_valid));
 -	for (pc = 0; pc < (emu->audigy ? 1024 : 512); pc++) {
-+	for (pc = 0; pc < (emu->audigy ? 2*1024 : 2*512); pc += 2) {
- 		set_bit(pc, icode->code_valid);
+-		set_bit(pc, icode->code_valid);
 -		icode->code[pc][0] = snd_emu10k1_efx_read(emu, pc * 2);
 -		icode->code[pc][1] = snd_emu10k1_efx_read(emu, pc * 2 + 1);
++	for (pc = 0; pc < (emu->audigy ? 2*1024 : 2*512); pc += 2) {
++		set_bit(pc / 2, icode->code_valid);
 +		if (put_user(snd_emu10k1_efx_read(emu, pc + 0), &icode->code[pc + 0]))
 +			return -EFAULT;
 +		if (put_user(snd_emu10k1_efx_read(emu, pc + 1), &icode->code[pc + 1]))
@@ -231,7 +210,7 @@
  }
  
  static snd_emu10k1_fx8010_ctl_t *snd_emu10k1_look_for_ctl(emu10k1_t *emu, snd_ctl_elem_id_t *id)
-@@ -647,7 +682,7 @@
+@@ -647,7 +672,7 @@
  	kfree(ctl);
  }
  
@@ -240,7 +219,7 @@
  {
  	unsigned int i, j;
  	emu10k1_fx8010_control_gpr_t __user *_gctl;
-@@ -656,17 +691,20 @@
+@@ -656,17 +681,20 @@
  	snd_kcontrol_new_t knew;
  	snd_kcontrol_t *kctl;
  	snd_ctl_elem_value_t *val;
@@ -266,7 +245,7 @@
  		ctl = snd_emu10k1_look_for_ctl(emu, &gctl.id);
  		memset(&knew, 0, sizeof(knew));
  		knew.iface = gctl.id.iface;
-@@ -694,9 +732,9 @@
+@@ -694,9 +722,9 @@
  				continue;
  			knew.private_value = (unsigned long)ctl;
  			memcpy(ctl, &nctl, sizeof(nctl));
@@ -278,7 +257,7 @@
  			}
  			kctl->private_free = snd_emu10k1_ctl_private_free;
  			ctl->kcontrol = kctl;
-@@ -711,10 +749,12 @@
+@@ -711,10 +739,12 @@
  		}
  		snd_emu10k1_gpr_ctl_put(ctl->kcontrol, val);
  	}
@@ -292,7 +271,7 @@
  {
  	unsigned int i;
  	snd_ctl_elem_id_t id;
-@@ -724,13 +764,14 @@
+@@ -724,13 +754,14 @@
  	
  	for (i = 0, _id = icode->gpr_del_controls;
  	     i < icode->gpr_del_control_count; i++, _id++) {
@@ -308,7 +287,7 @@
  }
  
  static int snd_emu10k1_list_controls(emu10k1_t *emu, emu10k1_fx8010_code_t *icode)
-@@ -789,11 +830,12 @@
+@@ -789,11 +820,12 @@
  	else
  		snd_emu10k1_ptr_write(emu, DBG, 0, emu->fx8010.dbg | EMU10K1_DBG_SINGLE_STEP);
  	/* ok, do the main job */
@@ -326,7 +305,7 @@
  	/* start FX processor when the DSP code is updated */
  	if (emu->audigy)
  		snd_emu10k1_ptr_write(emu, A_DBG, 0, emu->fx8010.dbg);
-@@ -811,10 +853,13 @@
+@@ -811,10 +843,13 @@
  	down(&emu->fx8010.lock);
  	strlcpy(icode->name, emu->fx8010.name, sizeof(icode->name));
  	/* ok, do the main job */
@@ -344,7 +323,7 @@
  	up(&emu->fx8010.lock);
  	return err;
  }
-@@ -957,20 +1002,23 @@
+@@ -957,20 +992,24 @@
  	const int stereo_mix = capture + 2;
  	const int tmp = 0x88;
  	u32 ptr;
@@ -363,7 +342,7 @@
 -		kfree(icode);
 -		return -ENOMEM;
 +	if ((icode = kcalloc(1, sizeof(*icode), GFP_KERNEL)) == NULL ||
-+	    (icode->gpr_map = kcalloc(512 + 256 + 256, sizeof(u_int32_t), GFP_KERNEL)) == NULL ||
++	    (icode->gpr_map = kcalloc(512 + 256 + 256 + 2 * 1024, sizeof(u_int32_t), GFP_KERNEL)) == NULL ||
 +	    (controls = kcalloc(SND_EMU10K1_GPR_CONTROLS, sizeof(*controls), GFP_KERNEL)) == NULL) {
 +		err = -ENOMEM;
 +		goto __err;
@@ -371,11 +350,12 @@
  
 +	icode->tram_data_map = icode->gpr_map + 512;
 +	icode->tram_addr_map = icode->tram_data_map + 256;
++	icode->code = icode->tram_addr_map + 256;
 +
  	/* clear free GPRs */
  	for (i = 0; i < 512; i++)
  		set_bit(i, icode->gpr_valid);
-@@ -1335,8 +1383,13 @@
+@@ -1335,8 +1374,13 @@
  	snd_leave_user(seg);
  
   __err:
@@ -391,7 +371,7 @@
  	return err;
  }
  
-@@ -1398,8 +1451,8 @@
+@@ -1398,8 +1442,8 @@
  	int err, i, z, gpr, tmp, playback, capture;
  	u32 ptr;
  	emu10k1_fx8010_code_t *icode;
@@ -402,7 +382,7 @@
  	mm_segment_t seg;
  
  	spin_lock_init(&emu->fx8010.irq_lock);
-@@ -1407,15 +1460,15 @@
+@@ -1407,15 +1451,16 @@
  
  	if ((icode = kcalloc(1, sizeof(*icode), GFP_KERNEL)) == NULL)
  		return -ENOMEM;
@@ -414,7 +394,7 @@
 -		kfree(controls);
 -		kfree(icode);
 -		return -ENOMEM;
-+	if ((icode->gpr_map = kcalloc(256 + 160 + 160, sizeof(u_int32_t), GFP_KERNEL)) == NULL ||
++	if ((icode->gpr_map = kcalloc(256 + 160 + 160 + 2 * 512, sizeof(u_int32_t), GFP_KERNEL)) == NULL ||
 +            (controls = kcalloc(SND_EMU10K1_GPR_CONTROLS, sizeof(emu10k1_fx8010_control_gpr_t), GFP_KERNEL)) == NULL ||
 +	    (ipcm = kcalloc(1, sizeof(*ipcm), GFP_KERNEL)) == NULL) {
 +		err = -ENOMEM;
@@ -423,10 +403,11 @@
 +
 +	icode->tram_data_map = icode->gpr_map + 256;
 +	icode->tram_addr_map = icode->tram_data_map + 160;
++	icode->code = icode->tram_addr_map + 160;
  	
  	/* clear free GPRs */
  	for (i = 0; i < 256; i++)
-@@ -1906,9 +1959,15 @@
+@@ -1906,9 +1951,15 @@
  	if (err >= 0)
  		err = snd_emu10k1_ipcm_poke(emu, ipcm);
        __err: