media: rockchip: isp: dma buf alloc limit to DMA32

Change-Id: Ibc1f4afc45a031714ee4cabfc70b38f930706d46
Signed-off-by: Cai YiWei <cyw@rock-chips.com>
This commit is contained in:
Cai YiWei
2021-04-14 18:35:25 +08:00
committed by Tao Huang
parent fe0ef1d4b5
commit 2d243f431a
5 changed files with 6 additions and 3 deletions

View File

@@ -853,6 +853,7 @@ static int rkisp_init_vb2_queue(struct vb2_queue *q,
q->allow_cache_hints = 1;
if (stream->ispdev->hw_dev->is_dma_contig)
q->dma_attrs = DMA_ATTR_FORCE_CONTIGUOUS;
q->gfp_flags = GFP_DMA32;
return vb2_queue_init(q);
}

View File

@@ -1972,6 +1972,7 @@ static int rkisp_init_vb2_queue(struct vb2_queue *q,
q->bidirectional = 1;
if (stream->ispdev->hw_dev->is_dma_contig)
q->dma_attrs = DMA_ATTR_FORCE_CONTIGUOUS;
q->gfp_flags = GFP_DMA32;
return vb2_queue_init(q);
}

View File

@@ -1264,6 +1264,7 @@ static int rkisp_init_vb2_queue(struct vb2_queue *q,
q->bidirectional = 1;
if (stream->ispdev->hw_dev->is_dma_contig)
q->dma_attrs = DMA_ATTR_FORCE_CONTIGUOUS;
q->gfp_flags = GFP_DMA32;
return vb2_queue_init(q);
}

View File

@@ -87,7 +87,7 @@ int rkisp_alloc_buffer(struct rkisp_device *dev,
attrs |= DMA_ATTR_FORCE_CONTIGUOUS;
buf->size = PAGE_ALIGN(buf->size);
mem_priv = g_ops->alloc(dev->hw_dev->dev, attrs, buf->size,
DMA_BIDIRECTIONAL, GFP_KERNEL);
DMA_BIDIRECTIONAL, GFP_KERNEL | GFP_DMA32);
if (IS_ERR_OR_NULL(mem_priv)) {
ret = -ENOMEM;
goto err;
@@ -209,7 +209,7 @@ static int rkisp_alloc_page_dummy_buf(struct rkisp_device *dev, u32 size)
struct sg_table *sg = NULL;
int ret = -ENOMEM;
page = alloc_pages(GFP_KERNEL, 0);
page = alloc_pages(GFP_KERNEL | GFP_DMA32, 0);
if (!page)
goto err;

View File

@@ -616,7 +616,7 @@ static int rkisp_init_vb2_queue(struct vb2_queue *q,
q->dev = stream->ispdev->hw_dev->dev;
q->allow_cache_hints = 1;
q->bidirectional = 1;
q->gfp_flags = GFP_DMA32;
return vb2_queue_init(q);
}