Changeset 598 for GPL/trunk/alsa-kernel/include/sound/pcm.h
- Timestamp:
- Apr 3, 2017, 4:51:56 PM (8 years ago)
- Location:
- GPL/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
GPL/trunk
-
Property svn:mergeinfo
set to
/GPL/branches/uniaud32-2.1.x merged eligible
-
Property svn:mergeinfo
set to
-
GPL/trunk/alsa-kernel/include/sound/pcm.h
r587 r598 30 30 #include <linux/mm.h> 31 31 #include <linux/bitops.h> 32 #include <linux/pm_qos_params.h> 32 33 33 34 #define snd_pcm_substream_chip(substream) ((substream)->private_data) … … 74 75 snd_pcm_uframes_t pos, 75 76 void __user *buf, snd_pcm_uframes_t count); 76 int (*silence)(struct snd_pcm_substream *substream, int channel, 77 int (*silence)(struct snd_pcm_substream *substream, int channel, 77 78 snd_pcm_uframes_t pos, snd_pcm_uframes_t count); 78 79 struct page *(*page)(struct snd_pcm_substream *substream, … … 174 175 #define SNDRV_PCM_FMTBIT_S18_3BE (1ULL << SNDRV_PCM_FORMAT_S18_3BE) 175 176 #define SNDRV_PCM_FMTBIT_U18_3BE (1ULL << SNDRV_PCM_FORMAT_U18_3BE) 177 #define SNDRV_PCM_FMTBIT_G723_24 (1ULL << SNDRV_PCM_FORMAT_G723_24) 178 #define SNDRV_PCM_FMTBIT_G723_24_1B (1ULL << SNDRV_PCM_FORMAT_G723_24_1B) 179 #define SNDRV_PCM_FMTBIT_G723_40 (1ULL << SNDRV_PCM_FORMAT_G723_40) 180 #define SNDRV_PCM_FMTBIT_G723_40_1B (1ULL << SNDRV_PCM_FORMAT_G723_40_1B) 176 181 177 182 #ifdef SNDRV_LITTLE_ENDIAN … … 216 221 217 222 struct snd_pcm_hw_constraints { 218 struct snd_mask masks[SNDRV_PCM_HW_PARAM_LAST_MASK - 223 struct snd_mask masks[SNDRV_PCM_HW_PARAM_LAST_MASK - 219 224 SNDRV_PCM_HW_PARAM_FIRST_MASK + 1]; 220 225 struct snd_interval intervals[SNDRV_PCM_HW_PARAM_LAST_INTERVAL - … … 262 267 unsigned int mask; 263 268 }; 269 270 struct snd_pcm_hwptr_log; 264 271 265 272 struct snd_pcm_runtime { … … 272 279 snd_pcm_uframes_t hw_ptr_interrupt; /* Position at interrupt time */ 273 280 unsigned long hw_ptr_jiffies; /* Time when hw_ptr is updated */ 281 unsigned long hw_ptr_buffer_jiffies; /* buffer time in jiffies */ 274 282 snd_pcm_sframes_t delay; /* extra delay; typically FIFO size */ 275 283 … … 290 298 unsigned int rate_num; 291 299 unsigned int rate_den; 300 unsigned int no_period_wakeup: 1; 292 301 293 302 /* -- SW params -- */ … … 311 320 312 321 /* -- locking / scheduling -- */ 313 wait_queue_head_t sleep; 322 snd_pcm_uframes_t twake; /* do transfer (!poll) wakeup if non-zero */ 323 wait_queue_head_t sleep; /* poll sleep */ 324 wait_queue_head_t tsleep; /* transfer sleep */ 314 325 struct fasync_struct *fasync; 315 326 … … 330 341 int tstamp_type; /* timestamp type */ 331 342 332 /* -- DMA -- */ 343 /* -- DMA -- */ 333 344 unsigned char *dma_area; /* DMA area */ 334 345 dma_addr_t dma_addr; /* physical bus address (not accessible from main CPU) */ … … 340 351 /* -- OSS things -- */ 341 352 struct snd_pcm_oss_runtime oss; 353 #endif 354 355 #ifdef CONFIG_SND_PCM_XRUN_DEBUG 356 struct snd_pcm_hwptr_log *hwptr_log; 342 357 #endif 343 358 }; … … 348 363 int count; 349 364 }; 365 366 struct pid; 350 367 351 368 struct snd_pcm_substream { … … 356 373 char name[32]; /* substream name */ 357 374 int stream; /* stream (direction) */ 358 char latency_id[20]; /* latency identifier */ 375 #ifndef TARGET_OS2 376 struct pm_qos_request_list latency_pm_qos_req; /* pm_qos request */ 377 #else 378 char latency_id[20]; 379 #endif 359 380 size_t buffer_bytes_max; /* limit ring buffer size */ 360 381 struct snd_dma_buffer dma_buffer; … … 380 401 unsigned int f_flags; 381 402 void (*pcm_release)(struct snd_pcm_substream *); 403 struct pid *pid; 382 404 #if defined(CONFIG_SND_PCM_OSS) || defined(CONFIG_SND_PCM_OSS_MODULE) 383 405 /* -- OSS things -- */ … … 538 560 } while (0) 539 561 540 #ifdef TARGET_OS2541 562 #define snd_pcm_group_for_each_entry(s, substream) \ 542 563 list_for_each_entry(s, &substream->group->substreams, link_list, struct snd_pcm_substream) 543 #else544 #define snd_pcm_group_for_each_entry(s, substream) \545 list_for_each_entry(s, &substream->group->substreams, link_list)546 #endif547 564 548 565 static inline int snd_pcm_running(struct snd_pcm_substream *substream) … … 597 614 snd_pcm_sframes_t avail = runtime->status->hw_ptr + runtime->buffer_size - runtime->control->appl_ptr; 598 615 #if defined TARGET_OS2 599 if ( runtime->buffer_size > runtime->control->appl_ptr) 600 avail = runtime->status->hw_ptr + runtime->buffer_size - runtime->control->appl_ptr; 601 else 602 { 603 604 avail = runtime->control->appl_ptr - runtime->status->hw_ptr; 605 if ( avail > runtime->buffer_size ) 606 avail = 0; 607 else 608 avail = runtime->buffer_size - avail; 609 } 610 #endif /* TARGET_OS2 */ 616 if ( runtime->buffer_size > runtime->control->appl_ptr) 617 avail = runtime->status->hw_ptr + runtime->buffer_size - runtime->control->appl_ptr; 618 else 619 { 620 621 avail = runtime->control->appl_ptr - runtime->status->hw_ptr; 622 if ( avail > runtime->buffer_size ) 623 avail = 0; 624 else 625 avail = runtime->buffer_size - avail; 626 } 627 #endif /* TARGET_OS2 */ 611 628 if (avail < 0) 612 629 avail += runtime->boundary; … … 711 728 } 712 729 713 static inline void snd_pcm_trigger_done(struct snd_pcm_substream *substream, 730 static inline void snd_pcm_trigger_done(struct snd_pcm_substream *substream, 714 731 struct snd_pcm_substream *master) 715 732 { … … 768 785 void snd_interval_mul(const struct snd_interval *a, const struct snd_interval *b, struct snd_interval *c); 769 786 void snd_interval_div(const struct snd_interval *a, const struct snd_interval *b, struct snd_interval *c); 770 void snd_interval_muldivk(const struct snd_interval *a, const struct snd_interval *b, 787 void snd_interval_muldivk(const struct snd_interval *a, const struct snd_interval *b, 771 788 unsigned int k, struct snd_interval *c); 772 789 void snd_interval_mulkdiv(const struct snd_interval *a, unsigned int k, … … 793 810 unsigned int min, unsigned int max); 794 811 int snd_pcm_hw_constraint_integer(struct snd_pcm_runtime *runtime, snd_pcm_hw_param_t var); 795 int snd_pcm_hw_constraint_list(struct snd_pcm_runtime *runtime, 812 int snd_pcm_hw_constraint_list(struct snd_pcm_runtime *runtime, 796 813 unsigned int cond, 797 814 snd_pcm_hw_param_t var, 798 815 struct snd_pcm_hw_constraint_list *l); 799 int snd_pcm_hw_constraint_ratnums(struct snd_pcm_runtime *runtime, 816 int snd_pcm_hw_constraint_ratnums(struct snd_pcm_runtime *runtime, 800 817 unsigned int cond, 801 818 snd_pcm_hw_param_t var, 802 819 struct snd_pcm_hw_constraint_ratnums *r); 803 int snd_pcm_hw_constraint_ratdens(struct snd_pcm_runtime *runtime, 820 int snd_pcm_hw_constraint_ratdens(struct snd_pcm_runtime *runtime, 804 821 unsigned int cond, 805 822 snd_pcm_hw_param_t var, 806 823 struct snd_pcm_hw_constraint_ratdens *r); 807 int snd_pcm_hw_constraint_msbits(struct snd_pcm_runtime *runtime, 824 int snd_pcm_hw_constraint_msbits(struct snd_pcm_runtime *runtime, 808 825 unsigned int cond, 809 826 unsigned int width, … … 853 870 int snd_pcm_lib_interleave_len(struct snd_pcm_substream *substream); 854 871 int snd_pcm_lib_ioctl(struct snd_pcm_substream *substream, 855 unsigned int cmd, void *arg); 872 unsigned int cmd, void *arg); 873 int snd_pcm_update_state(struct snd_pcm_substream *substream, 874 struct snd_pcm_runtime *runtime); 856 875 int snd_pcm_update_hw_ptr(struct snd_pcm_substream *substream); 857 876 int snd_pcm_playback_xrun_check(struct snd_pcm_substream *substream); … … 925 944 int snd_pcm_lib_free_pages(struct snd_pcm_substream *substream); 926 945 946 int _snd_pcm_lib_alloc_vmalloc_buffer(struct snd_pcm_substream *substream, 947 size_t size, gfp_t gfp_flags); 948 int snd_pcm_lib_free_vmalloc_buffer(struct snd_pcm_substream *substream); 949 struct page *snd_pcm_lib_get_vmalloc_page(struct snd_pcm_substream *substream, 950 unsigned long offset); 951 #if 0 /* for kernel-doc */ 952 /** 953 * snd_pcm_lib_alloc_vmalloc_buffer - allocate virtual DMA buffer 954 * @substream: the substream to allocate the buffer to 955 * @size: the requested buffer size, in bytes 956 * 957 * Allocates the PCM substream buffer using vmalloc(), i.e., the memory is 958 * contiguous in kernel virtual space, but not in physical memory. Use this 959 * if the buffer is accessed by kernel code but not by device DMA. 960 * 961 * Returns 1 if the buffer was changed, 0 if not changed, or a negative error 962 * code. 963 */ 964 static int snd_pcm_lib_alloc_vmalloc_buffer 965 (struct snd_pcm_substream *substream, size_t size); 966 /** 967 * snd_pcm_lib_alloc_vmalloc_32_buffer - allocate 32-bit-addressable buffer 968 * @substream: the substream to allocate the buffer to 969 * @size: the requested buffer size, in bytes 970 * 971 * This function works like snd_pcm_lib_alloc_vmalloc_buffer(), but uses 972 * vmalloc_32(), i.e., the pages are allocated from 32-bit-addressable memory. 973 */ 974 static int snd_pcm_lib_alloc_vmalloc_32_buffer 975 (struct snd_pcm_substream *substream, size_t size); 976 #endif 977 #define snd_pcm_lib_alloc_vmalloc_buffer(subs, size) \ 978 _snd_pcm_lib_alloc_vmalloc_buffer \ 979 (subs, size, GFP_KERNEL | __GFP_HIGHMEM | __GFP_ZERO) 980 #define snd_pcm_lib_alloc_vmalloc_32_buffer(subs, size) \ 981 _snd_pcm_lib_alloc_vmalloc_buffer \ 982 (subs, size, GFP_KERNEL | GFP_DMA32 | __GFP_ZERO) 983 927 984 #ifdef CONFIG_SND_DMA_SGBUF 928 985 /* … … 995 1052 #endif 996 1053 1054 int snd_pcm_lib_mmap_noncached(struct snd_pcm_substream *substream, 1055 struct vm_area_struct *area); 1056 #define snd_pcm_lib_mmap_vmalloc snd_pcm_lib_mmap_noncached 1057 997 1058 static inline void snd_pcm_limit_isa_dma_size(int dma, size_t *max) 998 1059 { … … 1011 1072 #define PCM_RUNTIME_CHECK(sub) snd_BUG_ON(!(sub) || !(sub)->runtime) 1012 1073 1074 const char *snd_pcm_format_name(snd_pcm_format_t format); 1075 1013 1076 #endif /* __SOUND_PCM_H */
Note:
See TracChangeset
for help on using the changeset viewer.