Gentoo Archives: gentoo-commits

From: "Christian Heim (phreak)" <phreak@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in media-sound/alsa-driver/files: alsa-driver-1.0.14-seq_file.patch
Date: Wed, 03 Oct 2007 18:11:59
Message-Id: E1Id8YQ-0007jV-OL@stork.gentoo.org
1 phreak 07/10/03 18:02:38
2
3 Modified: alsa-driver-1.0.14-seq_file.patch
4 Log:
5 Fix compilation of alsa-driver-1.0.14-r1, somehow I missed some parts when creating the custom memalloc.patch (#194617 thanks to Doug).
6 (Portage version: 2.1.3.9)
7
8 Revision Changes Path
9 1.2 media-sound/alsa-driver/files/alsa-driver-1.0.14-seq_file.patch
10
11 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/media-sound/alsa-driver/files/alsa-driver-1.0.14-seq_file.patch?rev=1.2&view=markup
12 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/media-sound/alsa-driver/files/alsa-driver-1.0.14-seq_file.patch?rev=1.2&content-type=text/plain
13 diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/media-sound/alsa-driver/files/alsa-driver-1.0.14-seq_file.patch?r1=1.1&r2=1.2
14
15 Index: alsa-driver-1.0.14-seq_file.patch
16 ===================================================================
17 RCS file: /var/cvsroot/gentoo-x86/media-sound/alsa-driver/files/alsa-driver-1.0.14-seq_file.patch,v
18 retrieving revision 1.1
19 retrieving revision 1.2
20 diff -u -r1.1 -r1.2
21 --- alsa-driver-1.0.14-seq_file.patch 3 Oct 2007 13:50:22 -0000 1.1
22 +++ alsa-driver-1.0.14-seq_file.patch 3 Oct 2007 18:02:38 -0000 1.2
23 @@ -1,12 +1,3 @@
24 ---- a/acore/Makefile
25 -+++ b/acore/Makefile
26 -@@ -36,5 +36,5 @@ init.c: init.patch $(SND_TOPDIR)/alsa-ke
27 - rawmidi.c: rawmidi.patch $(SND_TOPDIR)/alsa-kernel/core/rawmidi.c
28 - sound.c: sound.patch $(SND_TOPDIR)/alsa-kernel/core/sound.c
29 - timer.c: timer.patch $(SND_TOPDIR)/alsa-kernel/core/timer.c
30 --memalloc.c: memalloc.patch memalloc.inc memalloc.inc1 $(SND_TOPDIR)/alsa-kernel/core/memalloc.c
31 -+memalloc.c: memalloc.inc memalloc.inc1 $(SND_TOPDIR)/alsa-kernel/core/memalloc.c
32 - misc.c: misc.patch $(SND_TOPDIR)/alsa-kernel/core/misc.c
33 --- a/alsa-kernel/core/memalloc.c
34 +++ b/alsa-kernel/core/memalloc.c
35 @@ -1,3 +1,4 @@
36 @@ -14,7 +5,15 @@
37 /*
38 * Copyright (c) by Jaroslav Kysela <perex@××××.cz>
39 * Takashi Iwai <tiwai@××××.de>
40 -@@ -82,7 +83,50 @@ struct snd_mem_list {
41 +@@ -27,6 +28,7 @@
42 + #include <linux/pci.h>
43 + #include <linux/slab.h>
44 + #include <linux/mm.h>
45 ++#include <linux/seq_file.h>
46 + #include <asm/uaccess.h>
47 + #include <linux/dma-mapping.h>
48 + #include <linux/moduleparam.h>
49 +@@ -82,7 +84,50 @@ struct snd_mem_list {
50 * Hacks
51 */
52
53 @@ -66,7 +65,7 @@
54 /*
55 * A hack to allocate large buffers via dma_alloc_coherent()
56 *
57 -@@ -99,6 +143,30 @@ struct snd_mem_list {
58 +@@ -99,6 +144,30 @@ struct snd_mem_list {
59 * so dma_mask doesn't have to be messed with.
60 */
61
62 @@ -97,7 +96,7 @@
63 static void *snd_dma_hack_alloc_coherent(struct device *dev, size_t size,
64 dma_addr_t *dma_handle,
65 gfp_t flags)
66 -@@ -106,15 +174,15 @@ static void *snd_dma_hack_alloc_coherent
67 +@@ -106,15 +175,15 @@ static void *snd_dma_hack_alloc_coherent
68 void *ret;
69 u64 dma_mask, coherent_dma_mask;
70
71 @@ -120,7 +119,7 @@
72 if (ret) {
73 /* obtained address is out of range? */
74 if (((unsigned long)*dma_handle + size - 1) & ~dma_mask) {
75 -@@ -139,6 +207,8 @@ static void *snd_dma_hack_alloc_coherent
76 +@@ -139,6 +208,8 @@ static void *snd_dma_hack_alloc_coherent
77 #define dma_alloc_coherent snd_dma_hack_alloc_coherent
78
79 #endif /* arch */
80 @@ -129,7 +128,7 @@
81
82 /*
83 *
84 -@@ -158,6 +228,24 @@ static inline void dec_snd_pages(int ord
85 +@@ -158,6 +229,24 @@ static inline void dec_snd_pages(int ord
86 snd_allocated_pages -= 1 << order;
87 }
88
89 @@ -154,7 +153,7 @@
90 /**
91 * snd_malloc_pages - allocate pages with the given size
92 * @size: the size to allocate in bytes
93 -@@ -176,8 +264,10 @@ void *snd_malloc_pages(size_t size, gfp_
94 +@@ -176,8 +265,10 @@ void *snd_malloc_pages(size_t size, gfp_
95 snd_assert(gfp_flags != 0, return NULL);
96 gfp_flags |= __GFP_COMP; /* compound page lets parts be mapped */
97 pg = get_order(size);
98 @@ -166,7 +165,7 @@
99 return res;
100 }
101
102 -@@ -196,6 +286,7 @@ void snd_free_pages(void *ptr, size_t si
103 +@@ -196,6 +287,7 @@ void snd_free_pages(void *ptr, size_t si
104 return;
105 pg = get_order(size);
106 dec_snd_pages(pg);
107 @@ -174,7 +173,7 @@
108 free_pages((unsigned long) ptr, pg);
109 }
110
111 -@@ -220,8 +311,10 @@ static void *snd_malloc_dev_pages(struct
112 +@@ -220,8 +312,10 @@ static void *snd_malloc_dev_pages(struct
113 | __GFP_NORETRY /* don't trigger OOM-killer */
114 | __GFP_NOWARN; /* no stack trace print - this call is non-critical */
115 res = dma_alloc_coherent(dev, PAGE_SIZE << pg, dma, gfp_flags);
116 @@ -186,7 +185,7 @@
117
118 return res;
119 }
120 -@@ -236,6 +329,7 @@ static void snd_free_dev_pages(struct de
121 +@@ -236,6 +330,7 @@ static void snd_free_dev_pages(struct de
122 return;
123 pg = get_order(size);
124 dec_snd_pages(pg);
125 @@ -194,7 +193,7 @@
126 dma_free_coherent(dev, PAGE_SIZE << pg, ptr, dma);
127 }
128
129 -@@ -481,53 +575,55 @@ static void free_all_reserved_pages(void
130 +@@ -481,53 +576,55 @@ static void free_all_reserved_pages(void
131 #define SND_MEM_PROC_FILE "driver/snd-page-alloc"
132 static struct proc_dir_entry *snd_mem_proc;
133
134 @@ -208,12 +207,12 @@
135 int devno;
136 static char *types[] = { "UNKNOWN", "CONT", "DEV", "DEV-SG", "SBUS" };
137
138 -+ seq_printf(seq, "pages : %li bytes (%li pages per %likB)\n",
139 -+ pages * PAGE_SIZE, pages, PAGE_SIZE / 1024);
140 mutex_lock(&list_mutex);
141 - len += snprintf(page + len, count - len,
142 - "pages : %li bytes (%li pages per %likB)\n",
143 - pages * PAGE_SIZE, pages, PAGE_SIZE / 1024);
144 ++ seq_printf(seq, "pages : %li bytes (%li pages per %likB)\n",
145 ++ pages * PAGE_SIZE, pages, PAGE_SIZE / 1024);
146 devno = 0;
147 list_for_each_entry(mem, &mem_list_head, list) {
148 devno++;
149 @@ -269,7 +268,34 @@
150 if (strcmp(token, "add") == 0) {
151 char *endp;
152 int vendor, device, size, buffers;
153 -@@ -596,9 +692,22 @@ static int snd_mem_proc_write(struct fil
154 +@@ -548,7 +645,7 @@ static int snd_mem_proc_write(struct fil
155 + (buffers = simple_strtol(token, NULL, 0)) <= 0 ||
156 + buffers > 4) {
157 + printk(KERN_ERR "snd-page-alloc: invalid proc write format\n");
158 +- return (int)count;
159 ++ return count;
160 + }
161 + vendor &= 0xffff;
162 + device &= 0xffff;
163 +@@ -560,7 +657,7 @@ static int snd_mem_proc_write(struct fil
164 + if (pci_set_dma_mask(pci, mask) < 0 ||
165 + pci_set_consistent_dma_mask(pci, mask) < 0) {
166 + printk(KERN_ERR "snd-page-alloc: cannot set DMA mask %lx for pci %04x:%04x\n", mask, vendor, device);
167 +- return (int)count;
168 ++ return count;
169 + }
170 + }
171 + for (i = 0; i < buffers; i++) {
172 +@@ -570,7 +667,7 @@ static int snd_mem_proc_write(struct fil
173 + size, &dmab) < 0) {
174 + printk(KERN_ERR "snd-page-alloc: cannot allocate buffer pages (size = %d)\n", size);
175 + pci_dev_put(pci);
176 +- return (int)count;
177 ++ return count;
178 + }
179 + snd_dma_reserve_buf(&dmab, snd_dma_pci_buf_id(pci));
180 + }
181 +@@ -596,9 +693,22 @@ static int snd_mem_proc_write(struct fil
182 free_all_reserved_pages();
183 else
184 printk(KERN_ERR "snd-page-alloc: invalid proc cmd\n");
185 @@ -293,7 +319,7 @@
186 #endif /* CONFIG_PROC_FS */
187
188 /*
189 -@@ -609,12 +718,8 @@ static int __init snd_mem_init(void)
190 +@@ -609,12 +719,8 @@ static int __init snd_mem_init(void)
191 {
192 #ifdef CONFIG_PROC_FS
193 snd_mem_proc = create_proc_entry(SND_MEM_PROC_FILE, 0644, NULL);
194 @@ -304,11 +330,11 @@
195 -#endif
196 - }
197 + if (snd_mem_proc)
198 -+ snd_mem_proc->proc_fops = &snd_mem_proc_fops;
199 ++ snd_mem_proc->proc_fops = &snd_mem_proc_fops;
200 #endif
201 return 0;
202 }
203 -@@ -644,3 +749,5 @@ EXPORT_SYMBOL(snd_dma_reserve_buf);
204 +@@ -644,3 +750,5 @@ EXPORT_SYMBOL(snd_dma_reserve_buf);
205
206 EXPORT_SYMBOL(snd_malloc_pages);
207 EXPORT_SYMBOL(snd_free_pages);
208
209
210
211 --
212 gentoo-commits@g.o mailing list