vpu: imx6: add decoder/encoder

fix dma_alloc_attrs failure issue:
need to set valid device pointer instead of null pointer in
parameters of functions: dma_alloc_coherent/dma_free_coherent

Signed-off-by: Zhou Peng <eagle.zhou@nxp.com>
This commit is contained in:
Zhou Peng 2019-08-29 09:55:26 +08:00 committed by Dong Aisheng
parent bca0c6dcb1
commit e9d52b0f5e
1 changed files with 2 additions and 2 deletions

View File

@ -262,7 +262,7 @@ static int cpu_is_mx51(void)
static int vpu_alloc_dma_buffer(struct vpu_mem_desc *mem)
{
mem->cpu_addr = (unsigned long)
dma_alloc_coherent(NULL, PAGE_ALIGN(mem->size),
dma_alloc_coherent(vpu_dev, PAGE_ALIGN(mem->size),
(dma_addr_t *) (&mem->phy_addr),
GFP_DMA | GFP_KERNEL);
dev_dbg(vpu_dev, "[ALLOC] mem alloc cpu_addr = 0x%x\n", mem->cpu_addr);
@ -279,7 +279,7 @@ static int vpu_alloc_dma_buffer(struct vpu_mem_desc *mem)
static void vpu_free_dma_buffer(struct vpu_mem_desc *mem)
{
if (mem->cpu_addr != 0) {
dma_free_coherent(0, PAGE_ALIGN(mem->size),
dma_free_coherent(vpu_dev, PAGE_ALIGN(mem->size),
(void *)mem->cpu_addr, mem->phy_addr);
}
}