* [PATCH] sparc dbri: removal of dri_desc struct
@ 2006-08-17 20:05 Krzysztof Helt
2006-08-18 9:50 ` Takashi Iwai
0 siblings, 1 reply; 4+ messages in thread
From: Krzysztof Helt @ 2006-08-17 20:05 UTC (permalink / raw)
To: alsa-devel
[-- Attachment #1: Type: text/plain, Size: 363 bytes --]
From: Krzysztof Helt (krzysztof.h1@wp.pl)
The structure is in big part redudant.
Signed-off-by: Krzysztof Helt (krzysztof.h1@wp.pl)
---
----------------------------------------------------
Oglądaj -> Wydarzenia.wp.pl -> Wiesz, co najważniejsze!
Najbardziej aktualne materiały filmowe - Kliknij:
http://klik.wp.pl/?adr=www.wydarzenia.wp.pl&sid=848
[-- Attachment #2: dbri-patch5.diff --]
[-- Type: application/octet-stream, Size: 4634 bytes --]
--- alsa-driver-1.0.12rc2/alsa-kernel/sparc/dbri.c 2006-08-16 22:32:09.000000000 +0200
+++ linux-2.6.17a/sound/sparc/dbri.c 2006-08-16 20:34:31.000000000 +0200
@@ -250,6 +250,7 @@ static struct {
#define DBRI_NO_STREAMS 2
/* One transmit/receive descriptor */
+/* When ba != 0 descriptor is used */
struct dbri_mem {
volatile __u32 word1;
__u32 ba; /* Transmit/Receive Buffer Address */
@@ -282,12 +283,6 @@ struct dbri_pipe {
volatile __u32 *recv_fixed_ptr; /* Ptr to receive fixed data */
};
-struct dbri_desc {
- int inuse; /* Boolean flag */
- int next; /* Index of next desc, or -1 */
- unsigned int len;
-};
-
/* Per stream (playback or record) information */
struct dbri_streaminfo {
struct snd_pcm_substream *substream;
@@ -317,7 +312,7 @@ struct snd_dbri {
int wait_ackd; /* sequence of command buffers acknowledged */
struct dbri_pipe pipes[DBRI_NO_PIPES]; /* DBRI's 32 data pipes */
- struct dbri_desc descs[DBRI_NO_DESCS];
+ int next_desc[DBRI_NO_DESCS]; /* Index of next desc, or -1 */
int chi_in_pipe;
int chi_out_pipe;
@@ -803,8 +798,8 @@ static void reset_pipe(struct snd_dbri *
desc = dbri->pipes[pipe].first_desc;
while (desc != -1) {
- dbri->descs[desc].inuse = 0;
- desc = dbri->descs[desc].next;
+ dbri->dma->desc[desc].nda = dbri->dma->desc[desc].ba = 0;
+ desc = dbri->next_desc[desc];
}
dbri->pipes[pipe].desc = -1;
@@ -1093,7 +1088,7 @@ static int setup_descs(struct snd_dbri *
int mylen;
for (; desc < DBRI_NO_DESCS; desc++) {
- if (!dbri->descs[desc].inuse)
+ if (!dbri->dma->desc[desc].ba)
break;
}
if (desc == DBRI_NO_DESCS) {
@@ -1110,19 +1105,16 @@ static int setup_descs(struct snd_dbri *
mylen = period;
}
- dbri->descs[desc].inuse = 1;
- dbri->descs[desc].next = -1;
+ dbri->next_desc[desc] = -1;
dbri->dma->desc[desc].ba = dvma_buffer;
dbri->dma->desc[desc].nda = 0;
if (streamno == DBRI_PLAY) {
- dbri->descs[desc].len = mylen;
dbri->dma->desc[desc].word1 = DBRI_TD_CNT(mylen);
dbri->dma->desc[desc].word4 = 0;
if (first_desc != -1)
dbri->dma->desc[desc].word1 |= DBRI_TD_M;
} else {
- dbri->descs[desc].len = 0;
dbri->dma->desc[desc].word1 = 0;
dbri->dma->desc[desc].word4 =
DBRI_RD_B | DBRI_RD_BCNT(mylen);
@@ -1131,7 +1123,7 @@ static int setup_descs(struct snd_dbri *
if (first_desc == -1) {
first_desc = desc;
} else {
- dbri->descs[last_desc].next = desc;
+ dbri->next_desc[last_desc] = desc;
dbri->dma->desc[last_desc].nda =
dbri->dma_dvma + dbri_dma_off(desc, desc);
}
@@ -1154,7 +1146,7 @@ static int setup_descs(struct snd_dbri *
dbri->pipes[info->pipe].first_desc = first_desc;
dbri->pipes[info->pipe].desc = first_desc;
- for (desc = first_desc; desc != -1; desc = dbri->descs[desc].next) {
+ for (desc = first_desc; desc != -1; desc = dbri->next_desc[desc]) {
dprintk(D_DESC, "DESC %d: %08x %08x %08x %08x\n",
desc,
dbri->dma->desc[desc].word1,
@@ -1747,6 +1739,7 @@ static void transmission_complete_intr(s
struct dbri_streaminfo *info;
int td;
int status;
+ int len;
info = &dbri->stream_info[DBRI_PLAY];
@@ -1765,11 +1758,12 @@ static void transmission_complete_intr(s
dprintk(D_INT, "TD %d, status 0x%02x\n", td, status);
dbri->dma->desc[td].word4 = 0; /* Reset it for next time. */
- info->offset += dbri->descs[td].len;
- info->left -= dbri->descs[td].len;
+ len = DBRI_RD_CNT(dbri->dma->desc[td].word1);
+ info->offset += len;
+ info->left -= len;
/* On the last TD, transmit them all again. */
- if (dbri->descs[td].next == -1) {
+ if (dbri->next_desc[td] == -1) {
if (info->left > 0) {
printk(KERN_WARNING
"%d bytes left after last transfer.\n",
@@ -1779,7 +1773,7 @@ static void transmission_complete_intr(s
tasklet_schedule(&xmit_descs_task);
}
- td = dbri->descs[td].next;
+ td = dbri->next_desc[td];
dbri->pipes[pipe].desc = td;
}
@@ -1803,8 +1797,8 @@ static void reception_complete_intr(stru
return;
}
- dbri->descs[rd].inuse = 0;
- dbri->pipes[pipe].desc = dbri->descs[rd].next;
+ dbri->dma->desc[rd].ba = 0;
+ dbri->pipes[pipe].desc = dbri->next_desc[rd];
status = dbri->dma->desc[rd].word1;
dbri->dma->desc[rd].word1 = 0; /* Reset it for next time. */
@@ -1818,7 +1812,7 @@ static void reception_complete_intr(stru
rd, DBRI_RD_STATUS(status), DBRI_RD_CNT(status));
/* On the last TD, transmit them all again. */
- if (dbri->descs[rd].next == -1) {
+ if (dbri->next_desc[rd] == -1) {
if (info->left > info->size) {
printk(KERN_WARNING
"%d bytes recorded in %d size buffer.\n",
[-- Attachment #3: Type: text/plain, Size: 373 bytes --]
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
[-- Attachment #4: Type: text/plain, Size: 161 bytes --]
_______________________________________________
Alsa-devel mailing list
Alsa-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/alsa-devel
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] sparc dbri: removal of dri_desc struct
2006-08-17 20:05 [PATCH] sparc dbri: removal of dri_desc struct Krzysztof Helt
@ 2006-08-18 9:50 ` Takashi Iwai
2006-08-18 11:43 ` Krzysztof Helt
0 siblings, 1 reply; 4+ messages in thread
From: Takashi Iwai @ 2006-08-18 9:50 UTC (permalink / raw)
To: Krzysztof Helt; +Cc: alsa-devel
At Thu, 17 Aug 2006 22:05:09 +0200,
Krzysztof Helt wrote:
>
> From: Krzysztof Helt (krzysztof.h1@wp.pl)
>
> The structure is in big part redudant.
>
> Signed-off-by: Krzysztof Helt (krzysztof.h1@wp.pl)
These patches look a bit too intrusive to include right now since
we're just before releasing 1.0.12-final. I'll merge them later.
Thanks,
Takashi
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] sparc dbri: removal of dri_desc struct
2006-08-18 9:50 ` Takashi Iwai
@ 2006-08-18 11:43 ` Krzysztof Helt
2006-08-18 12:30 ` Takashi Iwai
0 siblings, 1 reply; 4+ messages in thread
From: Krzysztof Helt @ 2006-08-18 11:43 UTC (permalink / raw)
To: Takashi Iwai; +Cc: alsa-devel
Dnia 18-08-2006 o godz. 11:50 Takashi Iwai napisał:
> These patches look a bit too intrusive to include right now since
> we're just before releasing 1.0.12-final. I'll merge them later.
>
So, please merge only two first patches (5 & 6)as they are rather
obvious clean ups.
The third and fourth (7 & 8) are more rework of how code works so
omit these two for now.
Regards,
Krzysztof
----------------------------------------------------
Oglądaj -> Wydarzenia.wp.pl -> Wiesz, co najważniejsze!
Najbardziej aktualne materiały filmowe - Kliknij:
http://klik.wp.pl/?adr=www.wydarzenia.wp.pl&sid=848
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] sparc dbri: removal of dri_desc struct
2006-08-18 11:43 ` Krzysztof Helt
@ 2006-08-18 12:30 ` Takashi Iwai
0 siblings, 0 replies; 4+ messages in thread
From: Takashi Iwai @ 2006-08-18 12:30 UTC (permalink / raw)
To: Krzysztof Helt; +Cc: alsa-devel
At Fri, 18 Aug 2006 13:43:29 +0200,
Krzysztof Helt wrote:
>
> Dnia 18-08-2006 o godz. 11:50 Takashi Iwai napisał:
> > These patches look a bit too intrusive to include right now since
> > we're just before releasing 1.0.12-final. I'll merge them later.
> >
>
> So, please merge only two first patches (5 & 6)as they are rather
> obvious clean ups.
>
> The third and fourth (7 & 8) are more rework of how code works so
> omit these two for now.
Well but they are not crucial fixes, right?
I'd like to apply only fixes, no cleanup at this moment until 1.0.12
is kicked out.
Takashi
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2006-08-18 12:30 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-08-17 20:05 [PATCH] sparc dbri: removal of dri_desc struct Krzysztof Helt
2006-08-18 9:50 ` Takashi Iwai
2006-08-18 11:43 ` Krzysztof Helt
2006-08-18 12:30 ` Takashi Iwai
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.