日期:2014-05-16  浏览次数:20610 次

lcd驱动dma问题
lcd驱动中,分配dma buffer用的是dma_alloc_writecombine,用dma_alloc_coherent可以吗?这两个函数申请的都是一致性DMA映射吧?

------解决方案--------------------
关于dma_alloc_writecombine和dma_alloc_coherent的区别网上很多
dma_alloc_coherent 实时性更强一些,无cache,无写缓冲;任何对memory的读写都反映到总线上
dma_alloc_writecombine 慢一些,无cache,有写缓冲;读操作直接反映到总线上;写操作,CPU将数据写入到写缓冲后继续运行,由写缓冲进行写回操作。

但是不见得所有的lcd驱动都用dma_alloc_writecombine,内核源码里也能搜到使用dma_alloc_coherent的驱动。看起来并没有什么必然。lz可以试试换用dma_alloc_coherent看看有没有问题