diff options
author | Takashi Iwai <tiwai@suse.de> | 2010-09-17 12:24:04 +0200 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2010-09-17 12:24:04 +0200 |
commit | 4dfe53cdc4b8a889ac0d524d4d8743c58ef413b1 (patch) | |
tree | 8ada467b4b13940a5bf6cb6827d8f1a844dc703b | |
parent | 178a0a22053d7fb058ed6babfc5d1767c7d1b1e6 (diff) | |
download | alsa-driver-build-unstable-4dfe53cdc4b8a889ac0d524d4d8743c58ef413b1.tar.gz |
Add pm_qos_remove() hack for older kernels in snd_pcm_release_substream()
Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r-- | acore/pcm_native.patch | 75 |
1 files changed, 48 insertions, 27 deletions
diff --git a/acore/pcm_native.patch b/acore/pcm_native.patch index 5c0b2a8e6..63d8ccf70 100644 --- a/acore/pcm_native.patch +++ b/acore/pcm_native.patch @@ -1,5 +1,5 @@ ---- ../alsa-kernel/core/pcm_native.c 2010-08-09 14:25:42.000000000 +0200 -+++ pcm_native.c 2010-08-09 15:01:13.000000000 +0200 +--- ../alsa-kernel/core/pcm_native.c 2010-09-16 23:10:16.996220991 +0200 ++++ pcm_native.c 2010-09-17 12:23:15.092424934 +0200 @@ -1,3 +1,5 @@ +#define __NO_VERSION__ +#include "adriver.h" @@ -17,7 +17,7 @@ #include <linux/time.h> #include <linux/pm_qos_params.h> #include <linux/uio.h> -@@ -369,7 +371,10 @@ static int period_to_usecs(struct snd_pc +@@ -369,7 +371,10 @@ return usecs; } @@ -29,7 +29,7 @@ struct snd_pcm_hw_params *params) { struct snd_pcm_runtime *runtime; -@@ -451,11 +456,29 @@ static int snd_pcm_hw_params(struct snd_ +@@ -451,11 +456,29 @@ snd_pcm_timer_resolution_change(substream); runtime->status->state = SNDRV_PCM_STATE_SETUP; @@ -59,7 +59,7 @@ return 0; _error: /* hardware might be unuseable from this time, -@@ -510,7 +533,17 @@ static int snd_pcm_hw_free(struct snd_pc +@@ -510,7 +533,17 @@ if (substream->ops->hw_free) result = substream->ops->hw_free(substream); runtime->status->state = SNDRV_PCM_STATE_OPEN; @@ -77,7 +77,7 @@ return result; } -@@ -1546,7 +1579,11 @@ static struct file *snd_pcm_file_fd(int +@@ -1552,7 +1585,11 @@ file = fget(fd); if (!file) return NULL; @@ -89,7 +89,28 @@ if (!S_ISCHR(inode->i_mode) || imajor(inode) != snd_major) { fput(file); -@@ -2803,25 +2840,50 @@ static ssize_t snd_pcm_write(struct file +@@ -1994,8 +2031,20 @@ + substream->ops->close(substream); + substream->hw_opened = 0; + } ++#ifdef CONFIG_SND_HAVE_PM_QOS_REQUEST ++#ifdef CONFIG_SND_HAVE_PM_QOS_REQUEST_STATIC + if (pm_qos_request_active(&substream->latency_pm_qos_req)) + pm_qos_remove_request(&substream->latency_pm_qos_req); ++#else ++ if (substream->latency_pm_qos_req) { ++ pm_qos_remove_request(substream->latency_pm_qos_req); ++ substream->latency_pm_qos_req = NULL; ++ } ++#endif ++#else ++ pm_qos_remove_requirement(PM_QOS_CPU_DMA_LATENCY, ++ substream->latency_id); ++#endif + if (substream->pcm_release) { + substream->pcm_release(substream); + substream->pcm_release = NULL; +@@ -2811,25 +2860,50 @@ struct snd_pcm_runtime *runtime; snd_pcm_sframes_t result; @@ -147,7 +168,7 @@ { struct snd_pcm_file *pcm_file; struct snd_pcm_substream *substream; -@@ -2831,7 +2893,11 @@ static ssize_t snd_pcm_aio_read(struct k +@@ -2839,7 +2913,11 @@ void __user **bufs; snd_pcm_uframes_t frames; @@ -159,7 +180,7 @@ substream = pcm_file->substream; if (PCM_RUNTIME_CHECK(substream)) return -ENXIO; -@@ -2855,8 +2921,13 @@ static ssize_t snd_pcm_aio_read(struct k +@@ -2863,8 +2941,13 @@ return result; } @@ -173,7 +194,7 @@ { struct snd_pcm_file *pcm_file; struct snd_pcm_substream *substream; -@@ -2866,7 +2937,11 @@ static ssize_t snd_pcm_aio_write(struct +@@ -2874,7 +2957,11 @@ void __user **bufs; snd_pcm_uframes_t frames; @@ -185,7 +206,7 @@ substream = pcm_file->substream; if (PCM_RUNTIME_CHECK(substream)) return -ENXIO; -@@ -2888,6 +2963,7 @@ static ssize_t snd_pcm_aio_write(struct +@@ -2896,6 +2983,7 @@ kfree(bufs); return result; } @@ -193,7 +214,7 @@ static unsigned int snd_pcm_playback_poll(struct file *file, poll_table * wait) { -@@ -2975,6 +3051,22 @@ static unsigned int snd_pcm_capture_poll +@@ -2983,6 +3071,22 @@ * mmap support */ @@ -216,7 +237,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... -@@ -2983,6 +3075,7 @@ static unsigned int snd_pcm_capture_poll +@@ -2991,6 +3095,7 @@ /* * mmap status record */ @@ -224,7 +245,7 @@ static int snd_pcm_mmap_status_fault(struct vm_area_struct *area, struct vm_fault *vmf) { -@@ -2996,10 +3089,49 @@ static int snd_pcm_mmap_status_fault(str +@@ -3004,10 +3109,49 @@ get_page(vmf->page); return 0; } @@ -274,7 +295,7 @@ }; static int snd_pcm_mmap_status(struct snd_pcm_substream *substream, struct file *file, -@@ -3014,7 +3146,11 @@ static int snd_pcm_mmap_status(struct sn +@@ -3022,7 +3166,11 @@ if (size != PAGE_ALIGN(sizeof(struct snd_pcm_mmap_status))) return -EINVAL; area->vm_ops = &snd_pcm_vm_ops_status; @@ -286,7 +307,7 @@ area->vm_flags |= VM_RESERVED; return 0; } -@@ -3022,6 +3158,7 @@ static int snd_pcm_mmap_status(struct sn +@@ -3030,6 +3178,7 @@ /* * mmap control record */ @@ -294,7 +315,7 @@ static int snd_pcm_mmap_control_fault(struct vm_area_struct *area, struct vm_fault *vmf) { -@@ -3035,10 +3172,50 @@ static int snd_pcm_mmap_control_fault(st +@@ -3043,10 +3192,50 @@ get_page(vmf->page); return 0; } @@ -345,7 +366,7 @@ }; static int snd_pcm_mmap_control(struct snd_pcm_substream *substream, struct file *file, -@@ -3053,7 +3230,11 @@ static int snd_pcm_mmap_control(struct s +@@ -3061,7 +3250,11 @@ if (size != PAGE_ALIGN(sizeof(struct snd_pcm_mmap_control))) return -EINVAL; area->vm_ops = &snd_pcm_vm_ops_control; @@ -357,7 +378,7 @@ area->vm_flags |= VM_RESERVED; return 0; } -@@ -3094,9 +3275,16 @@ snd_pcm_default_page_ops(struct snd_pcm_ +@@ -3102,9 +3295,16 @@ return virt_to_page(vaddr); } @@ -374,7 +395,7 @@ static int snd_pcm_mmap_data_fault(struct vm_area_struct *area, struct vm_fault *vmf) { -@@ -3123,6 +3311,59 @@ static int snd_pcm_mmap_data_fault(struc +@@ -3131,6 +3331,59 @@ vmf->page = page; return 0; } @@ -434,7 +455,7 @@ static const struct vm_operations_struct snd_pcm_vm_ops_data = { .open = snd_pcm_mmap_data_open, -@@ -3132,7 +3373,14 @@ static const struct vm_operations_struct +@@ -3140,7 +3393,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, @@ -449,7 +470,7 @@ }; #ifndef ARCH_HAS_DMA_MMAP_COHERENT -@@ -3180,11 +3428,26 @@ int snd_pcm_lib_mmap_iomem(struct snd_pc +@@ -3188,11 +3448,26 @@ area->vm_page_prot = pgprot_noncached(area->vm_page_prot); area->vm_flags |= VM_IO; size = area->vm_end - area->vm_start; @@ -477,7 +498,7 @@ return 0; } -@@ -3228,7 +3491,7 @@ int snd_pcm_mmap_data(struct snd_pcm_sub +@@ -3236,7 +3511,7 @@ runtime->access == SNDRV_PCM_ACCESS_RW_NONINTERLEAVED) return -EINVAL; size = area->vm_end - area->vm_start; @@ -486,7 +507,7 @@ dma_bytes = PAGE_ALIGN(runtime->dma_bytes); if ((size_t)size > dma_bytes) return -EINVAL; -@@ -3236,7 +3499,11 @@ int snd_pcm_mmap_data(struct snd_pcm_sub +@@ -3244,7 +3519,11 @@ return -EINVAL; area->vm_ops = &snd_pcm_vm_ops_data; @@ -498,7 +519,7 @@ if (substream->ops->mmap) err = substream->ops->mmap(substream, area); else -@@ -3259,7 +3526,7 @@ static int snd_pcm_mmap(struct file *fil +@@ -3267,7 +3546,7 @@ if (PCM_RUNTIME_CHECK(substream)) return -ENXIO; @@ -507,7 +528,7 @@ switch (offset) { case SNDRV_PCM_MMAP_OFFSET_STATUS: if (pcm_file->no_compat_mmap) -@@ -3292,12 +3559,34 @@ static int snd_pcm_fasync(int fd, struct +@@ -3300,12 +3579,34 @@ /* * ioctl32 compat */ @@ -543,7 +564,7 @@ /* * To be removed helpers to keep binary compatibility */ -@@ -3436,31 +3725,55 @@ static unsigned long snd_pcm_get_unmappe +@@ -3444,31 +3745,55 @@ const struct file_operations snd_pcm_f_ops[2] = { { |