本文整理汇总了C++中dma_mmap_writecombine函数的典型用法代码示例。如果您正苦于以下问题:C++ dma_mmap_writecombine函数的具体用法?C++ dma_mmap_writecombine怎么用?C++ dma_mmap_writecombine使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了dma_mmap_writecombine函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: vc4_mmap
int vc4_mmap(struct file *filp, struct vm_area_struct *vma)
{
struct drm_gem_object *gem_obj;
struct vc4_bo *bo;
int ret;
ret = drm_gem_mmap(filp, vma);
if (ret)
return ret;
gem_obj = vma->vm_private_data;
bo = to_vc4_bo(gem_obj);
if (bo->validated_shader && (vma->vm_flags & VM_WRITE)) {
DRM_ERROR("mmaping of shader BOs for writing not allowed.\n");
return -EINVAL;
}
/*
* Clear the VM_PFNMAP flag that was set by drm_gem_mmap(), and set the
* vm_pgoff (used as a fake buffer offset by DRM) to 0 as we want to map
* the whole buffer.
*/
vma->vm_flags &= ~VM_PFNMAP;
vma->vm_pgoff = 0;
ret = dma_mmap_writecombine(bo->base.base.dev->dev, vma,
bo->base.vaddr, bo->base.paddr,
vma->vm_end - vma->vm_start);
if (ret)
drm_gem_vm_close(vma);
return ret;
}
示例2: ion_cma_mmap
static int ion_cma_mmap(struct ion_heap *mapper, struct ion_buffer *buffer,
struct vm_area_struct *vma)
{
struct device *dev = buffer->heap->priv;
struct ion_cma_buffer_info *info = buffer->priv_virt;
#ifdef CONFIG_TIMA_RKP
if (buffer->size) {
/* iommu optimization- needs to be turned ON from
* the tz side.
*/
cpu_v7_tima_iommu_opt(vma->vm_start, vma->vm_end, (unsigned long)vma->vm_mm->pgd);
__asm__ __volatile__ (
"mcr p15, 0, r0, c8, c3, 0\n"
"dsb\n"
"isb\n");
}
#endif
if (info->is_cached)
return dma_mmap_nonconsistent(dev, vma, info->cpu_addr,
info->handle, buffer->size);
else
return dma_mmap_writecombine(dev, vma, info->cpu_addr,
info->handle, buffer->size);
}
示例3: pxa2xx_pcm_mmap
int pxa2xx_pcm_mmap(struct snd_pcm_substream *substream,
struct vm_area_struct *vma)
{
struct snd_pcm_runtime *runtime = substream->runtime;
return dma_mmap_writecombine(substream->pcm->card->dev, vma,
runtime->dma_area,
runtime->dma_addr,
runtime->dma_bytes);
}
示例4: nx_pcm_ops_mmap
static int nx_pcm_ops_mmap(struct snd_pcm_substream *substream, struct vm_area_struct *vma)
{
struct snd_pcm_runtime *runtime = substream->runtime;
DBGOUT("%s\n", __func__);
return dma_mmap_writecombine(substream->pcm->card->dev, vma,
runtime->dma_area,
runtime->dma_addr,
runtime->dma_bytes);
}
示例5: wmt_pdm_pcm_mmap
static int wmt_pdm_pcm_mmap(struct snd_pcm_substream *substream,
struct vm_area_struct *vma)
{
struct snd_pcm_runtime *runtime = substream->runtime;
DBG_DETAIL();
return dma_mmap_writecombine(substream->pcm->card->dev, vma,
runtime->dma_area,
runtime->dma_addr,
runtime->dma_bytes);
}
示例6: s3c24xx_pcm_mmap
static int s3c24xx_pcm_mmap(struct snd_pcm_substream *substream,
struct vm_area_struct *vma)
{
struct snd_pcm_runtime *runtime = substream->runtime;
s3cdbg("Entered %s\n", __FUNCTION__);
return dma_mmap_writecombine(substream->pcm->card->dev, vma,
runtime->dma_area,
runtime->dma_addr,
runtime->dma_bytes);
}
示例7: tegra_pcm_mmap
static int tegra_pcm_mmap(struct snd_pcm_substream *substream,
struct vm_area_struct *vma)
{
struct snd_soc_pcm_runtime *rtd = substream->private_data;
struct snd_pcm_runtime *runtime = substream->runtime;
if (rtd->dai_link->no_pcm)
return 0;
return dma_mmap_writecombine(substream->pcm->card->dev, vma,
runtime->dma_area,
runtime->dma_addr,
runtime->dma_bytes);
}
示例8: sunxi_pcm_mmap
static int sunxi_pcm_mmap(struct snd_pcm_substream *substream,
struct vm_area_struct *vma)
{
struct snd_pcm_runtime *play_runtime = NULL;
struct snd_pcm_runtime *capture_runtime = NULL;
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
play_runtime = substream->runtime;
return dma_mmap_writecombine(substream->pcm->card->dev, vma,
play_runtime->dma_area,
play_runtime->dma_addr,
play_runtime->dma_bytes);
} else {
capture_runtime = substream->runtime;
return dma_mmap_writecombine(substream->pcm->card->dev, vma,
play_runtime->dma_area,
play_runtime->dma_addr,
play_runtime->dma_bytes);
}
}
示例9: stmp3xxxfb_mmap
static int stmp3xxxfb_mmap(struct fb_info *info, struct vm_area_struct *vma)
{
struct stmp3xxx_fb_data *data = (struct stmp3xxx_fb_data *)info;
unsigned long off = vma->vm_pgoff << PAGE_SHIFT;
if (off < info->fix.smem_len)
return dma_mmap_writecombine(data->dev, vma,
data->virt_start,
data->phys_start,
info->fix.smem_len);
else
return -EINVAL;
}
示例10: nusmart_pcm_mmap
int nusmart_pcm_mmap(struct snd_pcm_substream *substream,
struct vm_area_struct *vma)
{
struct snd_pcm_runtime *runtime = substream->runtime;
DBG_PRINT("nusmart_pcm_mmap, area = %x, phy_addr = %x, bytes = %d\n",
(unsigned int)runtime->dma_area,
(unsigned int)runtime->dma_addr,
runtime->dma_bytes
);
return dma_mmap_writecombine(substream->pcm->card->dev, vma,
runtime->dma_area,
runtime->dma_addr,
runtime->dma_bytes);
}
示例11: sunxi_pcm_mmap
static int sunxi_pcm_mmap(struct snd_pcm_substream *substream,
struct vm_area_struct *vma)
{
struct snd_pcm_runtime *runtime = NULL;
if (substream->runtime!=NULL) {
runtime = substream->runtime;
return dma_mmap_writecombine(substream->pcm->card->dev, vma,
runtime->dma_area,
runtime->dma_addr,
runtime->dma_bytes);
} else {
return -1;
}
}
示例12: hi3630_srcup_normal_mmap
static int hi3630_srcup_normal_mmap(struct snd_pcm_substream *substream,
struct vm_area_struct *vma)
{
int ret = 0;
struct snd_pcm_runtime *runtime = substream->runtime;
if (NULL != runtime)
ret = dma_mmap_writecombine(substream->pcm->card->dev,
vma,
runtime->dma_area,
runtime->dma_addr,
runtime->dma_bytes);
return ret;
}
示例13: snd_imx_pcm_mmap
int snd_imx_pcm_mmap(struct snd_pcm_substream *substream,
struct vm_area_struct *vma)
{
struct snd_pcm_runtime *runtime = substream->runtime;
int ret;
ret = dma_mmap_writecombine(substream->pcm->card->dev, vma,
runtime->dma_area, runtime->dma_addr, runtime->dma_bytes);
pr_debug("%s: ret: %d %p 0x%08x 0x%08x\n", __func__, ret,
runtime->dma_area,
runtime->dma_addr,
runtime->dma_bytes);
return ret;
}
示例14: cns3xxx_pcm_mmap
static int cns3xxx_pcm_mmap(struct snd_pcm_substream *substream,
struct vm_area_struct *vma)
{
struct snd_pcm_runtime *runtime = substream->runtime;
#ifdef __DEBUG_PATH
printk("%s=>%d\n", __FUNCTION__, __LINE__);
#endif
// printk("runtime->dma_area: 0x%08x\n", (unsigned int)runtime->dma_area);
// printk("runtime->dma_addr: 0x%08x\n", runtime->dma_addr);
// printk("runtime->dma_bytes: 0x%08x\n", runtime->dma_bytes);
return dma_mmap_writecombine(substream->pcm->card->dev, vma,
runtime->dma_area,
runtime->dma_addr,
runtime->dma_bytes);
}
示例15: rockchip_pcm_mmap
static int rockchip_pcm_mmap(struct snd_pcm_substream *substream,
struct vm_area_struct *vma)
{
struct snd_pcm_runtime *runtime = substream->runtime;
DBG("Enter::%s----%d\n",__FUNCTION__,__LINE__);
#ifdef CONFIG_RK_SRAM_DMA
vma->vm_page_prot = pgprot_writecombine(vma->vm_page_prot);
return remap_pfn_range(vma, vma->vm_start,
substream->dma_buffer.addr >> PAGE_SHIFT,
vma->vm_end - vma->vm_start, vma->vm_page_prot);
#else
return dma_mmap_writecombine(substream->pcm->card->dev, vma,
runtime->dma_area,
runtime->dma_addr,
runtime->dma_bytes);
#endif
}