diff options
author | Takashi Iwai <tiwai@suse.de> | 2014-10-23 11:04:51 +0200 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2014-10-23 11:04:51 +0200 |
commit | 194422b835987baa30a56e8b8c4ba18e7efd9ab0 (patch) | |
tree | 1f5376cf0ee7c2ef2e7ca456bf72f6bb30402177 | |
parent | b26fb9b0be6403818f46f5d0c1e0c88f6bea05d0 (diff) | |
download | alsa-driver-build-unstable-194422b835987baa30a56e8b8c4ba18e7efd9ab0.tar.gz |
Don't use dma_mmap_coherent() on old kernels
Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r-- | alsa/acore/pcm_native.patch | 71 |
1 files changed, 44 insertions, 27 deletions
diff --git a/alsa/acore/pcm_native.patch b/alsa/acore/pcm_native.patch index c33722b50..589981106 100644 --- a/alsa/acore/pcm_native.patch +++ b/alsa/acore/pcm_native.patch @@ -1,5 +1,5 @@ ---- ../alsa-kernel/core/pcm_native.c 2014-02-24 17:09:07.845751938 +0100 -+++ pcm_native.c 2014-02-27 09:40:11.787678579 +0100 +--- ../alsa-kernel/core/pcm_native.c 2014-10-23 10:58:09.553942016 +0200 ++++ pcm_native.c 2014-10-23 11:04:04.004244088 +0200 @@ -1,3 +1,7 @@ +#define __NO_VERSION__ +#include "adriver.h" @@ -23,7 +23,7 @@ #include <linux/dma-mapping.h> #include <sound/core.h> #include <sound/control.h> -@@ -377,7 +383,10 @@ +@@ -450,7 +456,10 @@ snd_pcm_stream_unlock_irq(substream); } @@ -35,7 +35,7 @@ struct snd_pcm_hw_params *params) { struct snd_pcm_runtime *runtime; -@@ -462,11 +471,33 @@ +@@ -535,11 +544,33 @@ snd_pcm_timer_resolution_change(substream); snd_pcm_set_state(substream, SNDRV_PCM_STATE_SETUP); @@ -69,7 +69,7 @@ return 0; _error: /* hardware might be unusable from this time, -@@ -521,7 +552,17 @@ +@@ -594,7 +625,17 @@ if (substream->ops->hw_free) result = substream->ops->hw_free(substream); snd_pcm_set_state(substream, SNDRV_PCM_STATE_OPEN); @@ -87,7 +87,7 @@ return result; } -@@ -956,7 +997,11 @@ +@@ -1091,7 +1132,11 @@ * * Return: Zero if successful, or a negative error code. */ @@ -99,7 +99,7 @@ { return snd_pcm_action(&snd_pcm_action_stop, substream, state); } -@@ -1592,7 +1637,13 @@ +@@ -1727,7 +1772,13 @@ static bool is_pcm_file(struct file *file) { @@ -113,7 +113,7 @@ unsigned int minor; if (!S_ISCHR(inode->i_mode) || imajor(inode) != snd_major) -@@ -2039,8 +2090,21 @@ +@@ -2176,8 +2227,21 @@ substream->ops->close(substream); substream->hw_opened = 0; } @@ -135,7 +135,7 @@ if (substream->pcm_release) { substream->pcm_release(substream); substream->pcm_release = NULL; -@@ -2862,23 +2926,42 @@ +@@ -2997,23 +3061,42 @@ pcm_file = file->private_data; substream = pcm_file->substream; @@ -185,7 +185,7 @@ { struct snd_pcm_file *pcm_file; struct snd_pcm_substream *substream; -@@ -2888,7 +2971,11 @@ +@@ -3023,7 +3106,11 @@ void __user **bufs; snd_pcm_uframes_t frames; @@ -197,7 +197,7 @@ substream = pcm_file->substream; if (PCM_RUNTIME_CHECK(substream)) return -ENXIO; -@@ -2912,8 +2999,13 @@ +@@ -3047,8 +3134,13 @@ return result; } @@ -211,7 +211,7 @@ { struct snd_pcm_file *pcm_file; struct snd_pcm_substream *substream; -@@ -2923,7 +3015,11 @@ +@@ -3058,7 +3150,11 @@ void __user **bufs; snd_pcm_uframes_t frames; @@ -223,7 +223,7 @@ substream = pcm_file->substream; if (PCM_RUNTIME_CHECK(substream)) return -ENXIO; -@@ -2945,6 +3041,7 @@ +@@ -3080,6 +3176,7 @@ kfree(bufs); return result; } @@ -231,7 +231,7 @@ static unsigned int snd_pcm_playback_poll(struct file *file, poll_table * wait) { -@@ -3032,6 +3129,19 @@ +@@ -3167,6 +3264,19 @@ * mmap support */ @@ -251,7 +251,7 @@ /* * Only on coherent architectures, we can mmap the status and the control records * for effcient data transfer. On others, we have to use HWSYNC ioctl... -@@ -3040,6 +3150,7 @@ +@@ -3175,6 +3285,7 @@ /* * mmap status record */ @@ -259,7 +259,7 @@ static int snd_pcm_mmap_status_fault(struct vm_area_struct *area, struct vm_fault *vmf) { -@@ -3053,10 +3164,35 @@ +@@ -3188,10 +3299,35 @@ get_page(vmf->page); return 0; } @@ -295,7 +295,7 @@ }; static int snd_pcm_mmap_status(struct snd_pcm_substream *substream, struct file *file, -@@ -3077,6 +3213,7 @@ +@@ -3212,6 +3348,7 @@ /* * mmap control record */ @@ -303,7 +303,7 @@ static int snd_pcm_mmap_control_fault(struct vm_area_struct *area, struct vm_fault *vmf) { -@@ -3090,10 +3227,36 @@ +@@ -3225,10 +3362,36 @@ get_page(vmf->page); return 0; } @@ -340,7 +340,7 @@ }; static int snd_pcm_mmap_control(struct snd_pcm_substream *substream, struct file *file, -@@ -3147,9 +3310,12 @@ +@@ -3268,9 +3431,12 @@ return virt_to_page(vaddr); } @@ -353,7 +353,7 @@ static int snd_pcm_mmap_data_fault(struct vm_area_struct *area, struct vm_fault *vmf) { -@@ -3176,6 +3342,45 @@ +@@ -3297,6 +3463,45 @@ vmf->page = page; return 0; } @@ -399,7 +399,7 @@ static const struct vm_operations_struct snd_pcm_vm_ops_data = { .open = snd_pcm_mmap_data_open, -@@ -3185,7 +3390,14 @@ +@@ -3306,7 +3511,14 @@ static const struct vm_operations_struct snd_pcm_vm_ops_data_fault = { .open = snd_pcm_mmap_data_open, .close = snd_pcm_mmap_data_close, @@ -413,8 +413,25 @@ +#endif }; - #ifndef ARCH_HAS_DMA_MMAP_COHERENT -@@ -3239,7 +3451,35 @@ + /* +@@ -3324,6 +3536,8 @@ + area->vm_end - area->vm_start, area->vm_page_prot); + } + #endif /* CONFIG_GENERIC_ALLOCATOR */ ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 16, 0) || \ ++ defined(CONFIG_ARM) || defined(ARCH_HAS_DMA_MMAP_COHERENT) + if (!substream->ops->page && + substream->dma_buffer.dev.type == SNDRV_DMA_TYPE_DEV) + return dma_mmap_coherent(substream->dma_buffer.dev.dev, +@@ -3331,6 +3545,7 @@ + substream->runtime->dma_area, + substream->runtime->dma_addr, + area->vm_end - area->vm_start); ++#endif + /* mmap with fault handler */ + area->vm_ops = &snd_pcm_vm_ops_data_fault; + return 0; +@@ -3347,7 +3562,35 @@ struct snd_pcm_runtime *runtime = substream->runtime;; area->vm_page_prot = pgprot_noncached(area->vm_page_prot); @@ -450,7 +467,7 @@ } EXPORT_SYMBOL(snd_pcm_lib_mmap_iomem); -@@ -3273,7 +3513,7 @@ +@@ -3381,7 +3624,7 @@ runtime->access == SNDRV_PCM_ACCESS_RW_NONINTERLEAVED) return -EINVAL; size = area->vm_end - area->vm_start; @@ -459,7 +476,7 @@ dma_bytes = PAGE_ALIGN(runtime->dma_bytes); if ((size_t)size > dma_bytes) return -EINVAL; -@@ -3304,7 +3544,7 @@ +@@ -3412,7 +3655,7 @@ if (PCM_RUNTIME_CHECK(substream)) return -ENXIO; @@ -468,7 +485,7 @@ switch (offset) { case SNDRV_PCM_MMAP_OFFSET_STATUS: if (pcm_file->no_compat_mmap) -@@ -3337,12 +3577,34 @@ +@@ -3445,12 +3688,34 @@ /* * ioctl32 compat */ @@ -504,7 +521,7 @@ /* * To be removed helpers to keep binary compatibility */ -@@ -3483,29 +3745,49 @@ +@@ -3591,29 +3856,49 @@ { .owner = THIS_MODULE, .write = snd_pcm_write, |