Ignore:
Timestamp:
Apr 3, 2017, 4:51:56 PM (8 years ago)
Author:
David Azarewicz
Message:

Merged/reintegrated v2 branch into trunk. Trunk is now v2

Location:
GPL/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • GPL/trunk

  • GPL/trunk/alsa-kernel/include/sound/pcm.h

    r587 r598  
    3030#include <linux/mm.h>
    3131#include <linux/bitops.h>
     32#include <linux/pm_qos_params.h>
    3233
    3334#define snd_pcm_substream_chip(substream) ((substream)->private_data)
     
    7475                    snd_pcm_uframes_t pos,
    7576                    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, 
    7778                       snd_pcm_uframes_t pos, snd_pcm_uframes_t count);
    7879        struct page *(*page)(struct snd_pcm_substream *substream,
     
    174175#define SNDRV_PCM_FMTBIT_S18_3BE        (1ULL << SNDRV_PCM_FORMAT_S18_3BE)
    175176#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)
    176181
    177182#ifdef SNDRV_LITTLE_ENDIAN
     
    216221
    217222struct 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 - 
    219224                         SNDRV_PCM_HW_PARAM_FIRST_MASK + 1];
    220225        struct snd_interval intervals[SNDRV_PCM_HW_PARAM_LAST_INTERVAL -
     
    262267        unsigned int mask;
    263268};
     269
     270struct snd_pcm_hwptr_log;
    264271
    265272struct snd_pcm_runtime {
     
    272279        snd_pcm_uframes_t hw_ptr_interrupt; /* Position at interrupt time */
    273280        unsigned long hw_ptr_jiffies;   /* Time when hw_ptr is updated */
     281        unsigned long hw_ptr_buffer_jiffies; /* buffer time in jiffies */
    274282        snd_pcm_sframes_t delay;        /* extra delay; typically FIFO size */
    275283
     
    290298        unsigned int rate_num;
    291299        unsigned int rate_den;
     300        unsigned int no_period_wakeup: 1;
    292301
    293302        /* -- SW params -- */
     
    311320
    312321        /* -- 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 */
    314325        struct fasync_struct *fasync;
    315326
     
    330341        int tstamp_type;                /* timestamp type */
    331342
    332         /* -- DMA -- */
     343        /* -- DMA -- */           
    333344        unsigned char *dma_area;        /* DMA area */
    334345        dma_addr_t dma_addr;            /* physical bus address (not accessible from main CPU) */
     
    340351        /* -- OSS things -- */
    341352        struct snd_pcm_oss_runtime oss;
     353#endif
     354
     355#ifdef CONFIG_SND_PCM_XRUN_DEBUG
     356        struct snd_pcm_hwptr_log *hwptr_log;
    342357#endif
    343358};
     
    348363        int count;
    349364};
     365
     366struct pid;
    350367
    351368struct snd_pcm_substream {
     
    356373        char name[32];                  /* substream name */
    357374        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
    359380        size_t buffer_bytes_max;        /* limit ring buffer size */
    360381        struct snd_dma_buffer dma_buffer;
     
    380401        unsigned int f_flags;
    381402        void (*pcm_release)(struct snd_pcm_substream *);
     403        struct pid *pid;
    382404#if defined(CONFIG_SND_PCM_OSS) || defined(CONFIG_SND_PCM_OSS_MODULE)
    383405        /* -- OSS things -- */
     
    538560} while (0)
    539561
    540 #ifdef TARGET_OS2
    541562#define snd_pcm_group_for_each_entry(s, substream) \
    542563        list_for_each_entry(s, &substream->group->substreams, link_list, struct snd_pcm_substream)
    543 #else   
    544 #define snd_pcm_group_for_each_entry(s, substream) \
    545         list_for_each_entry(s, &substream->group->substreams, link_list)
    546 #endif
    547564
    548565static inline int snd_pcm_running(struct snd_pcm_substream *substream)
     
    597614        snd_pcm_sframes_t avail = runtime->status->hw_ptr + runtime->buffer_size - runtime->control->appl_ptr;
    598615#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  */ 
    611628        if (avail < 0)
    612629                avail += runtime->boundary;
     
    711728}
    712729
    713 static inline void snd_pcm_trigger_done(struct snd_pcm_substream *substream,
     730static inline void snd_pcm_trigger_done(struct snd_pcm_substream *substream, 
    714731                                        struct snd_pcm_substream *master)
    715732{
     
    768785void snd_interval_mul(const struct snd_interval *a, const struct snd_interval *b, struct snd_interval *c);
    769786void 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,
     787void snd_interval_muldivk(const struct snd_interval *a, const struct snd_interval *b, 
    771788                          unsigned int k, struct snd_interval *c);
    772789void snd_interval_mulkdiv(const struct snd_interval *a, unsigned int k,
     
    793810                                 unsigned int min, unsigned int max);
    794811int 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,
     812int snd_pcm_hw_constraint_list(struct snd_pcm_runtime *runtime, 
    796813                               unsigned int cond,
    797814                               snd_pcm_hw_param_t var,
    798815                               struct snd_pcm_hw_constraint_list *l);
    799 int snd_pcm_hw_constraint_ratnums(struct snd_pcm_runtime *runtime,
     816int snd_pcm_hw_constraint_ratnums(struct snd_pcm_runtime *runtime, 
    800817                                  unsigned int cond,
    801818                                  snd_pcm_hw_param_t var,
    802819                                  struct snd_pcm_hw_constraint_ratnums *r);
    803 int snd_pcm_hw_constraint_ratdens(struct snd_pcm_runtime *runtime,
     820int snd_pcm_hw_constraint_ratdens(struct snd_pcm_runtime *runtime, 
    804821                                  unsigned int cond,
    805822                                  snd_pcm_hw_param_t var,
    806823                                  struct snd_pcm_hw_constraint_ratdens *r);
    807 int snd_pcm_hw_constraint_msbits(struct snd_pcm_runtime *runtime,
     824int snd_pcm_hw_constraint_msbits(struct snd_pcm_runtime *runtime, 
    808825                                 unsigned int cond,
    809826                                 unsigned int width,
     
    853870int snd_pcm_lib_interleave_len(struct snd_pcm_substream *substream);
    854871int snd_pcm_lib_ioctl(struct snd_pcm_substream *substream,
    855                       unsigned int cmd, void *arg);
     872                      unsigned int cmd, void *arg);                     
     873int snd_pcm_update_state(struct snd_pcm_substream *substream,
     874                         struct snd_pcm_runtime *runtime);
    856875int snd_pcm_update_hw_ptr(struct snd_pcm_substream *substream);
    857876int snd_pcm_playback_xrun_check(struct snd_pcm_substream *substream);
     
    925944int snd_pcm_lib_free_pages(struct snd_pcm_substream *substream);
    926945
     946int _snd_pcm_lib_alloc_vmalloc_buffer(struct snd_pcm_substream *substream,
     947                                      size_t size, gfp_t gfp_flags);
     948int snd_pcm_lib_free_vmalloc_buffer(struct snd_pcm_substream *substream);
     949struct 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 */
     964static 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 */
     974static 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
    927984#ifdef CONFIG_SND_DMA_SGBUF
    928985/*
     
    9951052#endif
    9961053
     1054int 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
    9971058static inline void snd_pcm_limit_isa_dma_size(int dma, size_t *max)
    9981059{
     
    10111072#define PCM_RUNTIME_CHECK(sub) snd_BUG_ON(!(sub) || !(sub)->runtime)
    10121073
     1074const char *snd_pcm_format_name(snd_pcm_format_t format);
     1075
    10131076#endif /* __SOUND_PCM_H */
Note: See TracChangeset for help on using the changeset viewer.