From: Takashi Iwai <tiwai@suse.de>
To: "Gerhard Pircher" <gerhard_pircher@gmx.net>
Cc: linuxppc-dev@ozlabs.org, rlrevell@joe-job.com,
alsa-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org,
benh@kernel.crashing.org
Subject: Re: [Alsa-devel] RFC: dma_mmap_coherent() for powerpc/ppc architecture and ALSA?
Date: Wed, 14 Jun 2006 16:42:48 +0200 [thread overview]
Message-ID: <s5hk67j94t3.wl%tiwai@suse.de> (raw)
In-Reply-To: <20060612144254.305930@gmx.net>
At Mon, 12 Jun 2006 16:42:54 +0200,
Gerhard Pircher wrote:
>
> > > But as far as I understand this would require a rewrite of all the
> > > ALSA drivers (or at least a rewrite of the ALSA's DMA helper
> > > functions).
> >
> > Yes. The change of ALSA side has been also on my tree. But it was
> > still pending since I'm not satisfied with the design yet.
> > If you're interested in it, let me know. I'll post the patch.
>
> Yes, please! Then I can test, if the dma_mmap_coherent() patch works on
> my non cache coherent powerpc machine.
For using dma_mmap_coherent(), the patch below should suffice.
(Also you need to enable HAVE_DMA_MMAP_COHERENT there not only for
ARM.)
> Do you think the DMA Layer/ALSA patches will go upstream in one of
> the next ALSA/Linux kernel versions?
Definitely no 2.6.18 material yet.
Takashi
diff -r 08577d0b45ef sound/core/pcm_native.c
--- a/sound/core/pcm_native.c Tue Jun 13 12:01:14 2006 +0200
+++ b/sound/core/pcm_native.c Wed Jun 14 16:40:32 2006 +0200
@@ -3123,6 +3123,10 @@ static int snd_pcm_mmap_control(struct s
}
#endif /* coherent mmap */
+#if defined(CONFIG_ARM)
+#define HAVE_DMA_MMAP_COHERENT
+#endif
+
/*
* nopage callback for mmapping a RAM page
*/
@@ -3166,6 +3170,14 @@ static struct vm_operations_struct snd_p
.nopage = snd_pcm_mmap_data_nopage,
};
+#ifdef HAVE_DMA_MMAP_COHERENT
+static struct vm_operations_struct snd_pcm_vm_ops_data_one_map =
+{
+ .open = snd_pcm_mmap_data_open,
+ .close = snd_pcm_mmap_data_close,
+};
+#endif
+
/*
* mmap the DMA buffer on RAM
*/
@@ -3175,6 +3187,16 @@ static int snd_pcm_default_mmap(struct s
area->vm_ops = &snd_pcm_vm_ops_data;
area->vm_private_data = substream;
area->vm_flags |= VM_RESERVED;
+#ifdef HAVE_DMA_MMAP_COHERENT
+ if (substream->dma_buffer.dev.type == SNDRV_DMA_TYPE_DEV) {
+ area->vm_ops = &snd_pcm_vm_ops_data_one_map;
+ if (dma_mmap_coherent(substream->dma_buffer.dev.dev, area,
+ substream->runtime->dma_area,
+ substream->runtime->dma_addr,
+ area->vm_end - area->vm_start))
+ return -EAGAIN;
+ }
+#endif
atomic_inc(&substream->mmap_count);
return 0;
}
next prev parent reply other threads:[~2006-06-14 14:42 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-06-10 8:22 Gerhard Pircher
2006-06-12 10:51 ` Takashi Iwai
2006-06-12 14:42 ` Gerhard Pircher
2006-06-14 14:42 ` Takashi Iwai [this message]
2006-06-28 20:27 Re: [Alsa-devel] " Gerhard Pircher
2006-06-29 9:27 ` Takashi Iwai
2006-06-29 21:15 ` Gerhard Pircher
2006-06-30 9:12 ` Takashi Iwai
2006-06-30 18:21 ` Gerhard Pircher
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=s5hk67j94t3.wl%tiwai@suse.de \
--to=tiwai@suse.de \
--cc=alsa-devel@lists.sourceforge.net \
--cc=benh@kernel.crashing.org \
--cc=gerhard_pircher@gmx.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@ozlabs.org \
--cc=rlrevell@joe-job.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®