Skip to content

Commit c6a26a0

Browse files
YiChongZhZhengShunQian
authored andcommitted
media: rockchip: rkcif: support get continuous memory from specific CMA region
If no IOMMU support for CIF, we prefer to alloc continuous physical memory from our reserved CMA region than from system reserved. Change-Id: Icbe1f206593ffc10eba96e12f77f499455dbcd55 Signed-off-by: Zhong Yichong <zyc@rock-chips.com>
1 parent be9d090 commit c6a26a0

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

  • drivers/media/platform/rockchip/cif

drivers/media/platform/rockchip/cif/dev.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include <linux/of.h>
1313
#include <linux/of_graph.h>
1414
#include <linux/of_platform.h>
15+
#include <linux/of_reserved_mem.h>
1516
#include <linux/reset.h>
1617
#include <linux/pm_runtime.h>
1718
#include <linux/pinctrl/consumer.h>
@@ -486,8 +487,15 @@ static int rkcif_plat_probe(struct platform_device *pdev)
486487
goto err_unreg_media_dev;
487488

488489
cif_dev->iommu_en = is_iommu_enable(dev);
489-
if (cif_dev->iommu_en)
490+
if (cif_dev->iommu_en) {
490491
rkcif_iommu_init(cif_dev);
492+
} else {
493+
ret = of_reserved_mem_device_init(dev);
494+
if (ret)
495+
v4l2_warn(v4l2_dev,
496+
"No reserved memory region assign to CIF\n");
497+
}
498+
491499
pm_runtime_enable(&pdev->dev);
492500

493501
return 0;

0 commit comments

Comments
 (0)