• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ dma_mmap_writecombine函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中dma_mmap_writecombine函数的典型用法代码示例。如果您正苦于以下问题:C++ dma_mmap_writecombine函数的具体用法?C++ dma_mmap_writecombine怎么用?C++ dma_mmap_writecombine使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了dma_mmap_writecombine函数的18个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
开发者ID:a2hojsjsjs,项目名称:linux,代码行数:34,代码来源:vc4_bo.c


示例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);
}
开发者ID:souljasteve84,项目名称:Engine-SM_N9005,代码行数:25,代码来源:ion_cma_heap.c


示例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);
}
开发者ID:antonywcl,项目名称:AR-5315u_PLD,代码行数:9,代码来源:pxa2xx-pcm-lib.c


示例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);
}
开发者ID:vlasenko,项目名称:kernel.rk,代码行数:11,代码来源:nexell-pcm.c


示例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);
}
开发者ID:wondermedia,项目名称:wm8850,代码行数:12,代码来源:wmt-pdm-pcm.c


示例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);
}
开发者ID:mik9,项目名称:i5700-leshak-kernel,代码行数:12,代码来源:s3c-pcm-sol.c


示例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);
}
开发者ID:FrozenCow,项目名称:FIRE-ICE,代码行数:14,代码来源:tegra_pcm.c


示例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);
	}

}
开发者ID:alex-deng,项目名称:a33_linux,代码行数:23,代码来源:sunxi-i2s0dma.c


示例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;
}
开发者ID:fread-ink,项目名称:fread-kernel-k4,代码行数:14,代码来源:stmp37xxfb.c


示例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);
}
开发者ID:zp8001,项目名称:STUDY_4.0.3,代码行数:15,代码来源:nusmart-plat.c


示例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;
	}
}
开发者ID:GREYFOXRGR,项目名称:BPI-M3-bsp,代码行数:15,代码来源:sunxi_codecdma.c


示例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;
}
开发者ID:HuaweiHonor4C,项目名称:kernel_hi6210sft_mm,代码行数:15,代码来源:hi3630_srcup_normal.c


示例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;
}
开发者ID:404992361,项目名称:mi1_kernel,代码行数:15,代码来源:imx-pcm.c


示例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);

}
开发者ID:mausvt,项目名称:seagate_central_cns3420_2-6-35,代码行数:17,代码来源:cns3xxx-pcm.c


示例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
}
开发者ID:markyzq,项目名称:px2-android-kernel-3.0,代码行数:19,代码来源:rk29_pcm.c


示例16: drm_gem_cma_mmap_obj

static int drm_gem_cma_mmap_obj(struct drm_gem_cma_object *cma_obj,
				struct vm_area_struct *vma)
{
	int ret;

	/*
	 * 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(cma_obj->base.dev->dev, vma,
				    cma_obj->vaddr, cma_obj->paddr,
				    vma->vm_end - vma->vm_start);
	if (ret)
		drm_gem_vm_close(vma);

	return ret;
}
开发者ID:tohipfortheroom,项目名称:RPI-Kernels,代码行数:21,代码来源:drm_gem_cma_helper.c


示例17: exynos_drm_fb_mmap

static int
exynos_drm_fb_mmap(struct fb_info *info, struct vm_area_struct * vma)
{
	int ret;

	DRM_DEBUG_KMS("pgoff: 0x%lx vma: 0x%lx - 0x%lx (0x%lx)\n",
			vma->vm_pgoff, vma->vm_start, vma->vm_end,
			vma->vm_end - vma->vm_start);

	DRM_DEBUG_KMS("screen: 0x%p (0x%lx) smem: 0x%lx (0x%x)\n",
			info->screen_base, info->screen_size,
			info->fix.smem_start, info->fix.smem_len);

	vma->vm_pgoff = 0;
	ret = dma_mmap_writecombine(info->device, vma, info->screen_base,
			info->fix.smem_start, vma->vm_end - vma->vm_start);
	if (ret)
		printk(KERN_ERR "Remapping memory failed, error: %d\n", ret);

	return ret;
}
开发者ID:ArthySundaram,项目名称:chromeos-kvm,代码行数:21,代码来源:exynos_drm_fbdev.c


示例18: tegra_drm_mmap

int tegra_drm_mmap(struct file *file, struct vm_area_struct *vma)
{
	struct drm_gem_object *gem;
	struct tegra_bo *bo;
	int ret;

	ret = drm_gem_mmap(file, vma);
	if (ret)
		return ret;

	gem = vma->vm_private_data;
	bo = to_tegra_bo(gem);

	if (!bo->pages) {
		unsigned long vm_pgoff = vma->vm_pgoff;

		vma->vm_flags &= ~VM_PFNMAP;
		vma->vm_pgoff = 0;

		ret = dma_mmap_writecombine(gem->dev->dev, vma, bo->vaddr,
					    bo->paddr, gem->size);
		if (ret) {
			drm_gem_vm_close(vma);
			return ret;
		}

		vma->vm_pgoff = vm_pgoff;
	} else {
		pgprot_t prot = vm_get_page_prot(vma->vm_flags);

		vma->vm_flags |= VM_MIXEDMAP;
		vma->vm_flags &= ~VM_PFNMAP;

		vma->vm_page_prot = pgprot_writecombine(prot);
	}

	return 0;
}
开发者ID:JaneDu,项目名称:ath,代码行数:38,代码来源:gem.c



注:本文中的dma_mmap_writecombine函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ dma_pool_create函数代码示例发布时间:2022-05-30
下一篇:
C++ dma_mapping_error函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap