移植exynos4412的MFC驱动时,出现了dma_alloc_coherent失败,于是展开其了解作用,如下:
dma_alloc_coherent & dma_alloc_writecombine 都是分配连续物理内存,返回虚拟地址 dma_alloc_coherent #define pgprot_noncached(prot) __pgprot(pgprot_val(prot) & ~(L_PTE_CACHEABLE | L_PTE_BUFFERABLE)) 禁用cahceable 和 bufferable dma_alloc_writecombine #define pgprot_writecombine(prot) __pgprot(pgprot_val(prot) & ~L_PTE_CACHEABLE) 禁用cahceable
谈到dma_alloc_coherent ,就不得不提
cma,和ump
cma & ump cma: 管理连续内存,可以预留好,可以用到时分配。4412BSP中为预留。 ump:mali使用内存,使用时动态配分(alloc_page)