diff options
author | Jaroslav Kysela <perex@perex.cz> | 2010-08-09 15:08:59 +0200 |
---|---|---|
committer | Jaroslav Kysela <perex@perex.cz> | 2010-08-09 15:08:59 +0200 |
commit | 68e3dea2c6fc2eba7f0ad629e4404f22d603e10b (patch) | |
tree | 8815e603e871086e66187a24cc270b6245033b88 | |
parent | 9af8f3935136173d7eae25c0c77f172318f14c16 (diff) | |
download | alsa-driver-build-unstable-68e3dea2c6fc2eba7f0ad629e4404f22d603e10b.tar.gz |
an attempt to fix compilations for new static pm_qos_request
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
-rw-r--r-- | acore/pcm_native.patch | 65 | ||||
-rw-r--r-- | configure.in | 36 | ||||
-rw-r--r-- | include/config.h.in | 1 | ||||
-rw-r--r-- | include/sound/pcm.patch | 22 |
4 files changed, 87 insertions, 37 deletions
diff --git a/acore/pcm_native.patch b/acore/pcm_native.patch index fafef52ec..28ba9bbfe 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 14:35:06.000000000 +0200 ++++ pcm_native.c 2010-08-09 15:01:13.000000000 +0200 @@ -1,3 +1,5 @@ +#define __NO_VERSION__ +#include "adriver.h" @@ -29,18 +29,27 @@ struct snd_pcm_hw_params *params) { struct snd_pcm_runtime *runtime; -@@ -451,11 +456,20 @@ static int snd_pcm_hw_params(struct snd_ +@@ -451,11 +456,29 @@ static int snd_pcm_hw_params(struct snd_ snd_pcm_timer_resolution_change(substream); runtime->status->state = SNDRV_PCM_STATE_SETUP; +#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); -+ if ((usecs = period_to_usecs(runtime)) >= 0) pm_qos_add_request(&substream->latency_pm_qos_req, PM_QOS_CPU_DMA_LATENCY, usecs); +#else ++ if (substream->latency_pm_qos_req) { ++ pm_qos_remove_request(substream->latency_pm_qos_req); ++ substream->latency_pm_qos_req = NULL; ++ } ++ if ((usecs = period_to_usecs(runtime)) >= 0) ++ substream->latency_pcm_qos_req = pm_qos_add_request( ++ PM_QOS_CPU_DMA_LATENCY, usecs); ++#endif ++#else + pm_qos_remove_requirement(PM_QOS_CPU_DMA_LATENCY, + substream->latency_id); + if ((usecs = period_to_usecs(runtime)) >= 0) @@ -50,13 +59,17 @@ return 0; _error: /* hardware might be unuseable from this time, -@@ -510,7 +524,13 @@ static int snd_pcm_hw_free(struct snd_pc +@@ -510,7 +533,17 @@ static int snd_pcm_hw_free(struct snd_pc if (substream->ops->hw_free) result = substream->ops->hw_free(substream); runtime->status->state = SNDRV_PCM_STATE_OPEN; +#ifdef CONFIG_SND_HAVE_PM_QOS_REQUEST ++#ifdef CONFIG_SND_HAVE_PM_QOS_REQUEST_STATIC pm_qos_remove_request(&substream->latency_pm_qos_req); ++#else ++ 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); @@ -64,7 +77,7 @@ return result; } -@@ -1546,7 +1566,11 @@ static struct file *snd_pcm_file_fd(int +@@ -1546,7 +1579,11 @@ static struct file *snd_pcm_file_fd(int file = fget(fd); if (!file) return NULL; @@ -76,7 +89,7 @@ if (!S_ISCHR(inode->i_mode) || imajor(inode) != snd_major) { fput(file); -@@ -2803,25 +2827,50 @@ static ssize_t snd_pcm_write(struct file +@@ -2803,25 +2840,50 @@ static ssize_t snd_pcm_write(struct file struct snd_pcm_runtime *runtime; snd_pcm_sframes_t result; @@ -134,7 +147,7 @@ { struct snd_pcm_file *pcm_file; struct snd_pcm_substream *substream; -@@ -2831,7 +2880,11 @@ static ssize_t snd_pcm_aio_read(struct k +@@ -2831,7 +2893,11 @@ static ssize_t snd_pcm_aio_read(struct k void __user **bufs; snd_pcm_uframes_t frames; @@ -146,7 +159,7 @@ substream = pcm_file->substream; if (PCM_RUNTIME_CHECK(substream)) return -ENXIO; -@@ -2855,8 +2908,13 @@ static ssize_t snd_pcm_aio_read(struct k +@@ -2855,8 +2921,13 @@ static ssize_t snd_pcm_aio_read(struct k return result; } @@ -160,7 +173,7 @@ { struct snd_pcm_file *pcm_file; struct snd_pcm_substream *substream; -@@ -2866,7 +2924,11 @@ static ssize_t snd_pcm_aio_write(struct +@@ -2866,7 +2937,11 @@ static ssize_t snd_pcm_aio_write(struct void __user **bufs; snd_pcm_uframes_t frames; @@ -172,7 +185,7 @@ substream = pcm_file->substream; if (PCM_RUNTIME_CHECK(substream)) return -ENXIO; -@@ -2888,6 +2950,7 @@ static ssize_t snd_pcm_aio_write(struct +@@ -2888,6 +2963,7 @@ static ssize_t snd_pcm_aio_write(struct kfree(bufs); return result; } @@ -180,7 +193,7 @@ static unsigned int snd_pcm_playback_poll(struct file *file, poll_table * wait) { -@@ -2975,6 +3038,22 @@ static unsigned int snd_pcm_capture_poll +@@ -2975,6 +3051,22 @@ static unsigned int snd_pcm_capture_poll * mmap support */ @@ -203,7 +216,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 +3062,7 @@ static unsigned int snd_pcm_capture_poll +@@ -2983,6 +3075,7 @@ static unsigned int snd_pcm_capture_poll /* * mmap status record */ @@ -211,7 +224,7 @@ static int snd_pcm_mmap_status_fault(struct vm_area_struct *area, struct vm_fault *vmf) { -@@ -2996,10 +3076,49 @@ static int snd_pcm_mmap_status_fault(str +@@ -2996,10 +3089,49 @@ static int snd_pcm_mmap_status_fault(str get_page(vmf->page); return 0; } @@ -261,7 +274,7 @@ }; static int snd_pcm_mmap_status(struct snd_pcm_substream *substream, struct file *file, -@@ -3014,7 +3133,11 @@ static int snd_pcm_mmap_status(struct sn +@@ -3014,7 +3146,11 @@ static int snd_pcm_mmap_status(struct sn if (size != PAGE_ALIGN(sizeof(struct snd_pcm_mmap_status))) return -EINVAL; area->vm_ops = &snd_pcm_vm_ops_status; @@ -273,7 +286,7 @@ area->vm_flags |= VM_RESERVED; return 0; } -@@ -3022,6 +3145,7 @@ static int snd_pcm_mmap_status(struct sn +@@ -3022,6 +3158,7 @@ static int snd_pcm_mmap_status(struct sn /* * mmap control record */ @@ -281,7 +294,7 @@ static int snd_pcm_mmap_control_fault(struct vm_area_struct *area, struct vm_fault *vmf) { -@@ -3035,10 +3159,50 @@ static int snd_pcm_mmap_control_fault(st +@@ -3035,10 +3172,50 @@ static int snd_pcm_mmap_control_fault(st get_page(vmf->page); return 0; } @@ -332,7 +345,7 @@ }; static int snd_pcm_mmap_control(struct snd_pcm_substream *substream, struct file *file, -@@ -3053,7 +3217,11 @@ static int snd_pcm_mmap_control(struct s +@@ -3053,7 +3230,11 @@ static int snd_pcm_mmap_control(struct s if (size != PAGE_ALIGN(sizeof(struct snd_pcm_mmap_control))) return -EINVAL; area->vm_ops = &snd_pcm_vm_ops_control; @@ -344,7 +357,7 @@ area->vm_flags |= VM_RESERVED; return 0; } -@@ -3094,9 +3262,16 @@ snd_pcm_default_page_ops(struct snd_pcm_ +@@ -3094,9 +3275,16 @@ snd_pcm_default_page_ops(struct snd_pcm_ return virt_to_page(vaddr); } @@ -361,7 +374,7 @@ static int snd_pcm_mmap_data_fault(struct vm_area_struct *area, struct vm_fault *vmf) { -@@ -3123,6 +3298,59 @@ static int snd_pcm_mmap_data_fault(struc +@@ -3123,6 +3311,59 @@ static int snd_pcm_mmap_data_fault(struc vmf->page = page; return 0; } @@ -421,7 +434,7 @@ static const struct vm_operations_struct snd_pcm_vm_ops_data = { .open = snd_pcm_mmap_data_open, -@@ -3132,7 +3360,14 @@ static const struct vm_operations_struct +@@ -3132,7 +3373,14 @@ static const struct vm_operations_struct static const struct vm_operations_struct snd_pcm_vm_ops_data_fault = { .open = snd_pcm_mmap_data_open, .close = snd_pcm_mmap_data_close, @@ -436,7 +449,7 @@ }; #ifndef ARCH_HAS_DMA_MMAP_COHERENT -@@ -3180,11 +3415,26 @@ int snd_pcm_lib_mmap_iomem(struct snd_pc +@@ -3180,11 +3428,26 @@ int snd_pcm_lib_mmap_iomem(struct snd_pc area->vm_page_prot = pgprot_noncached(area->vm_page_prot); area->vm_flags |= VM_IO; size = area->vm_end - area->vm_start; @@ -464,7 +477,7 @@ return 0; } -@@ -3228,7 +3478,7 @@ int snd_pcm_mmap_data(struct snd_pcm_sub +@@ -3228,7 +3491,7 @@ int snd_pcm_mmap_data(struct snd_pcm_sub runtime->access == SNDRV_PCM_ACCESS_RW_NONINTERLEAVED) return -EINVAL; size = area->vm_end - area->vm_start; @@ -473,7 +486,7 @@ dma_bytes = PAGE_ALIGN(runtime->dma_bytes); if ((size_t)size > dma_bytes) return -EINVAL; -@@ -3236,7 +3486,11 @@ int snd_pcm_mmap_data(struct snd_pcm_sub +@@ -3236,7 +3499,11 @@ int snd_pcm_mmap_data(struct snd_pcm_sub return -EINVAL; area->vm_ops = &snd_pcm_vm_ops_data; @@ -485,7 +498,7 @@ if (substream->ops->mmap) err = substream->ops->mmap(substream, area); else -@@ -3259,7 +3513,7 @@ static int snd_pcm_mmap(struct file *fil +@@ -3259,7 +3526,7 @@ static int snd_pcm_mmap(struct file *fil if (PCM_RUNTIME_CHECK(substream)) return -ENXIO; @@ -494,7 +507,7 @@ switch (offset) { case SNDRV_PCM_MMAP_OFFSET_STATUS: if (pcm_file->no_compat_mmap) -@@ -3292,12 +3546,34 @@ static int snd_pcm_fasync(int fd, struct +@@ -3292,12 +3559,34 @@ static int snd_pcm_fasync(int fd, struct /* * ioctl32 compat */ @@ -530,7 +543,7 @@ /* * To be removed helpers to keep binary compatibility */ -@@ -3436,31 +3712,55 @@ static unsigned long snd_pcm_get_unmappe +@@ -3436,31 +3725,55 @@ static unsigned long snd_pcm_get_unmappe const struct file_operations snd_pcm_f_ops[2] = { { diff --git a/configure.in b/configure.in index 2fc11b0bc..f5cceaaaa 100644 --- a/configure.in +++ b/configure.in @@ -3361,9 +3361,9 @@ if test "$kversion.$kpatchlevel" = "2.6"; then fi fi -dnl Check for new pm_qos_request() +dnl Check for pm_qos_request() if test "$kversion.$kpatchlevel" = "2.6"; then - AC_MSG_CHECKING(for new pm_qos_request) + AC_MSG_CHECKING(for pm_qos_request) pm_qos_request="0" ac_save_CFLAGS="$CFLAGS" ac_save_CC="$CC" @@ -3392,6 +3392,38 @@ if test "$kversion.$kpatchlevel" = "2.6"; then fi fi +dnl Check for static pm_qos_request() +if test "$kversion.$kpatchlevel" = "2.6"; then + AC_MSG_CHECKING(for static pm_qos_request) + pm_qos_request="0" + ac_save_CFLAGS="$CFLAGS" + ac_save_CC="$CC" + CFLAGS="$KERNEL_CHECK_CFLAGS" + CC=$KCC + AC_TRY_COMPILE([ +#define __KERNEL__ +#ifdef CONFIG_HAVE_DEPRECATED_CONFIG_H +#include <$INCLUDE_AUTOCONF_H> +#else +#include <linux/config.h> +#endif +#include <linux/pm_qos_params.h> +],[ + struct pm_qos_request_list r; + pm_qos_request(&r, PM_QOS_CPU_DMA_LATENCY, 100); +], + AC_MSG_RESULT(yes);pm_qos_request_static="1", + AC_MSG_RESULT(no);pm_qos_request_static="0", + AC_MSG_RESULT(unknown);pm_qos_request_static="0" +) + CFLAGS=$ac_save_CFLAGS + CC=$ac_save_CC + CONFIG_SND_HAVE_PM_QOS_REQUEST_STATIC=$pm_qos_request_static + if test "$CONFIG_SND_HAVE_PM_QOS_REQUEST_STATIC" = "1"; then + AC_DEFINE(CONFIG_SND_HAVE_PM_QOS_REQUEST_STATIC) + fi +fi + dnl New unlocked/compat_ioctl if test "$kversion.$kpatchlevel" = "2.6"; then AC_MSG_CHECKING(for new unlocked/compat_ioctl) diff --git a/include/config.h.in b/include/config.h.in index 09aea6041..ca75ba55f 100644 --- a/include/config.h.in +++ b/include/config.h.in @@ -88,4 +88,5 @@ #undef CONFIG_HAVE_VIDEO_DRVDATA #undef CONFIG_HAVE_GENERATED_AUTOCONF_H #undef CONFIG_SND_HAVE_PM_QOS_REQUEST +#undef CONFIG_SND_HAVE_PM_QOS_REQUEST_STATIC #undef CONFIG_SND_HAVE_USB_ALLOC_COHERENT diff --git a/include/sound/pcm.patch b/include/sound/pcm.patch index 10bec019c..1656e6dea 100644 --- a/include/sound/pcm.patch +++ b/include/sound/pcm.patch @@ -1,6 +1,6 @@ --- ../../alsa-kernel/include/pcm.h 2010-08-09 14:25:40.000000000 +0200 -+++ pcm.h 2010-08-09 14:29:54.000000000 +0200 -@@ -277,9 +277,12 @@ ++++ pcm.h 2010-08-09 14:56:07.000000000 +0200 +@@ -277,9 +277,12 @@ struct snd_pcm_runtime { snd_pcm_uframes_t avail_max; snd_pcm_uframes_t hw_ptr_base; /* Position at buffer restart */ snd_pcm_uframes_t hw_ptr_interrupt; /* Position at interrupt time */ @@ -14,7 +14,7 @@ /* -- HW params -- */ snd_pcm_access_t access; /* access mode */ snd_pcm_format_t format; /* SNDRV_PCM_FORMAT_* */ -@@ -289,6 +292,9 @@ +@@ -289,6 +292,9 @@ struct snd_pcm_runtime { snd_pcm_uframes_t period_size; /* period size */ unsigned int periods; /* periods */ snd_pcm_uframes_t buffer_size; /* buffer size */ @@ -24,7 +24,7 @@ snd_pcm_uframes_t min_align; /* Min alignment for the format */ size_t byte_align; unsigned int frame_bits; -@@ -300,6 +306,10 @@ +@@ -300,6 +306,10 @@ struct snd_pcm_runtime { /* -- SW params -- */ int tstamp_mode; /* mmap timestamp is updated */ unsigned int period_step; @@ -35,7 +35,7 @@ snd_pcm_uframes_t start_threshold; snd_pcm_uframes_t stop_threshold; snd_pcm_uframes_t silence_threshold; /* Silence filling happens when -@@ -317,9 +327,18 @@ +@@ -317,9 +327,18 @@ struct snd_pcm_runtime { struct snd_pcm_mmap_control *control; /* -- locking / scheduling -- */ @@ -54,7 +54,7 @@ struct fasync_struct *fasync; /* -- private section -- */ -@@ -336,8 +355,9 @@ +@@ -336,8 +355,9 @@ struct snd_pcm_runtime { /* -- timer -- */ unsigned int timer_resolution; /* timer resolution */ @@ -65,7 +65,7 @@ /* -- DMA -- */ unsigned char *dma_area; /* DMA area */ dma_addr_t dma_addr; /* physical bus address (not accessible from main CPU) */ -@@ -353,6 +373,24 @@ +@@ -353,6 +373,24 @@ struct snd_pcm_runtime { #ifdef CONFIG_SND_PCM_XRUN_DEBUG struct snd_pcm_hwptr_log *hwptr_log; #endif @@ -90,19 +90,23 @@ }; struct snd_pcm_group { /* keep linked substreams */ -@@ -370,7 +408,11 @@ +@@ -370,7 +408,15 @@ struct snd_pcm_substream { int number; char name[32]; /* substream name */ int stream; /* stream (direction) */ +#ifdef CONFIG_SND_HAVE_PM_QOS_REQUEST ++#ifdef CONFIG_SND_HAVE_PM_QOS_REQUEST_STATIC struct pm_qos_request_list latency_pm_qos_req; /* pm_qos request */ +#else ++ struct pm_qos_request_list *latency_pm_qos_req; /* pm_qos request */ ++#endif ++#else + char latency_id[20]; +#endif size_t buffer_bytes_max; /* limit ring buffer size */ struct snd_dma_buffer dma_buffer; unsigned int dma_buf_id; -@@ -382,6 +424,9 @@ +@@ -382,6 +428,9 @@ struct snd_pcm_substream { /* -- timer section -- */ struct snd_timer *timer; /* timer */ unsigned timer_running: 1; /* time is running */ |