Merge branch 'topic/noncached-mmap' into topic/misc
authorTakashi Iwai <tiwai@suse.de>
Thu, 21 Jan 2010 14:27:28 +0000 (15:27 +0100)
committerTakashi Iwai <tiwai@suse.de>
Thu, 21 Jan 2010 14:27:28 +0000 (15:27 +0100)
1  2 
include/sound/pcm.h
sound/core/pcm_native.c

diff --combined include/sound/pcm.h
index 768e3098656cbbd4abe5697f57d1c30d273ea599,aabf48bb8ee663024ac436f9d0647302b35cfd81..ee16122a188671e7d554c3bbaa906d2c8996e800
@@@ -311,9 -311,8 +311,9 @@@ struct snd_pcm_runtime 
        struct snd_pcm_mmap_control *control;
  
        /* -- locking / scheduling -- */
 -      unsigned int nowake: 1;         /* no wakeup (data-copy in progress) */
 -      wait_queue_head_t sleep;
 +      unsigned int twake: 1;          /* do transfer (!poll) wakeup */
 +      wait_queue_head_t sleep;        /* poll sleep */
 +      wait_queue_head_t tsleep;       /* transfer sleep */
        struct fasync_struct *fasync;
  
        /* -- private section -- */
@@@ -1022,6 -1021,10 +1022,10 @@@ int snd_pcm_lib_mmap_iomem(struct snd_p
  #define snd_pcm_lib_mmap_iomem        NULL
  #endif
  
+ int snd_pcm_lib_mmap_noncached(struct snd_pcm_substream *substream,
+                              struct vm_area_struct *area);
+ #define snd_pcm_lib_mmap_vmalloc      snd_pcm_lib_mmap_noncached
  static inline void snd_pcm_limit_isa_dma_size(int dma, size_t *max)
  {
        *max = dma < 4 ? 64 * 1024 : 128 * 1024;
diff --combined sound/core/pcm_native.c
index 43552fd73d2467d25f5a24b847a544d867d60fd6,88fff44702a433fcea9a24966359f8ea577d5e13..b53fa845004dac007b5e5b556dbbaa6856fc95f4
@@@ -919,7 -919,6 +919,7 @@@ static void snd_pcm_post_stop(struct sn
                runtime->status->state = state;
        }
        wake_up(&runtime->sleep);
 +      wake_up(&runtime->tsleep);
  }
  
  static struct action_ops snd_pcm_action_stop = {
@@@ -1005,7 -1004,6 +1005,7 @@@ static void snd_pcm_post_pause(struct s
                                         SNDRV_TIMER_EVENT_MPAUSE,
                                         &runtime->trigger_tstamp);
                wake_up(&runtime->sleep);
 +              wake_up(&runtime->tsleep);
        } else {
                runtime->status->state = SNDRV_PCM_STATE_RUNNING;
                if (substream->timer)
@@@ -1063,7 -1061,6 +1063,7 @@@ static void snd_pcm_post_suspend(struc
        runtime->status->suspended_state = runtime->status->state;
        runtime->status->state = SNDRV_PCM_STATE_SUSPENDED;
        wake_up(&runtime->sleep);
 +      wake_up(&runtime->tsleep);
  }
  
  static struct action_ops snd_pcm_action_suspend = {
@@@ -3165,9 -3162,7 +3165,7 @@@ int snd_pcm_lib_mmap_iomem(struct snd_p
        long size;
        unsigned long offset;
  
- #ifdef pgprot_noncached
        area->vm_page_prot = pgprot_noncached(area->vm_page_prot);
- #endif
        area->vm_flags |= VM_IO;
        size = area->vm_end - area->vm_start;
        offset = area->vm_pgoff << PAGE_SHIFT;
  EXPORT_SYMBOL(snd_pcm_lib_mmap_iomem);
  #endif /* SNDRV_PCM_INFO_MMAP */
  
+ /* mmap callback with pgprot_noncached */
+ int snd_pcm_lib_mmap_noncached(struct snd_pcm_substream *substream,
+                              struct vm_area_struct *area)
+ {
+       area->vm_page_prot = pgprot_noncached(area->vm_page_prot);
+       return snd_pcm_default_mmap(substream, area);
+ }
+ EXPORT_SYMBOL(snd_pcm_lib_mmap_noncached);
  /*
   * mmap DMA buffer
   */
This page took 0.042608 seconds and 5 git commands to generate.