arm:tegra: set cma data for nvmap platform data
Vandana Salve [Thu, 19 Sep 2013 13:24:04 +0000 (18:24 +0530)]
Pass the cma dev pointers, resize flag and
CMA chunk size in nvmap platform data
for the reserved contiguous memory using CMA

Bug 1279160

Change-Id: I5420bcdf859c463fed6e7c8715b82da71922c2ed
Signed-off-by: Vandana Salve <vsalve@nvidia.com>
Signed-off-by: Krishna Reddy <vdumpa@nvidia.com>
Reviewed-on: http://git-master/r/289421
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Hiroshi Doyu <hdoyu@nvidia.com>

arch/arm/mach-tegra/board-ardbeg-panel.c
arch/arm/mach-tegra/board-dalmore-panel.c
arch/arm/mach-tegra/board-loki-panel.c
arch/arm/mach-tegra/board-pluto-panel.c

index 4c14345..7c5a237 100644 (file)
@@ -28,6 +28,7 @@
 #include <linux/regulator/consumer.h>
 #include <linux/pwm_backlight.h>
 #include <linux/of.h>
+#include <linux/dma-contiguous.h>
 
 #include <mach/irqs.h>
 #include <mach/dc.h>
@@ -560,6 +561,13 @@ int __init ardbeg_panel_init(void)
        ardbeg_carveouts[1].size = tegra_carveout_size;
        ardbeg_carveouts[2].base = tegra_vpr_start;
        ardbeg_carveouts[2].size = tegra_vpr_size;
+#ifdef CONFIG_NVMAP_USE_CMA_FOR_CARVEOUT
+       ardbeg_carveouts[1].cma_dev = &tegra_generic_cma_dev;
+       ardbeg_carveouts[1].resize = false;
+       ardbeg_carveouts[2].cma_dev = &tegra_vpr_cma_dev;
+       ardbeg_carveouts[2].resize = true;
+       ardbeg_carveouts[2].cma_chunk_size = SZ_32M;
+#endif
 
        err = platform_device_register(&ardbeg_nvmap_device);
        if (err) {
index 81d8490..ab47791 100644 (file)
@@ -512,6 +512,13 @@ int __init dalmore_panel_init(void)
        dalmore_carveouts[1].size = tegra_carveout_size;
        dalmore_carveouts[2].base = tegra_vpr_start;
        dalmore_carveouts[2].size = tegra_vpr_size;
+#ifdef CONFIG_NVMAP_USE_CMA_FOR_CARVEOUT
+       dalmore_carveouts[1].cma_dev =  &tegra_generic_cma_dev;
+       dalmore_carveouts[1].resize = false;
+       dalmore_carveouts[2].cma_dev =  &tegra_vpr_cma_dev;
+       dalmore_carveouts[2].resize = true;
+       dalmore_carveouts[2].cma_chunk_size = SZ_32M;
+#endif
 
        err = platform_device_register(&dalmore_nvmap_device);
        if (err) {
index d0fe2e1..56693aa 100644 (file)
@@ -38,6 +38,7 @@
 #include "iomap.h"
 #include "tegra12_host1x_devices.h"
 #include "board-panel.h"
+#include "common.h"
 
 struct platform_device * __init loki_host1x_init(void)
 {
@@ -474,6 +475,13 @@ int __init loki_panel_init(int board_id)
        loki_carveouts[1].size = tegra_carveout_size;
        loki_carveouts[2].base = tegra_vpr_start;
        loki_carveouts[2].size = tegra_vpr_size;
+#ifdef CONFIG_NVMAP_USE_CMA_FOR_CARVEOUT
+       loki_carveouts[1].cma_dev = &tegra_generic_cma_dev;
+       loki_carveouts[1].resize = false;
+       loki_carveouts[2].cma_dev = &tegra_vpr_cma_dev;
+       loki_carveouts[2].resize = true;
+       loki_carveouts[2].cma_chunk_size = SZ_32M;
+#endif
 
        err = platform_device_register(&loki_nvmap_device);
        if (err) {
index 2649108..2d0a777 100644 (file)
@@ -445,6 +445,13 @@ int __init pluto_panel_init(void)
        pluto_carveouts[1].size = tegra_carveout_size;
        pluto_carveouts[2].base = tegra_vpr_start;
        pluto_carveouts[2].size = tegra_vpr_size;
+#ifdef CONFIG_NVMAP_USE_CMA_FOR_CARVEOUT
+       pluto_carveouts[1].cma_dev = &tegra_generic_cma_dev;
+       pluto_carveouts[1].resize = false;
+       pluto_carveouts[2].cma_dev = &tegra_vpr_cma_dev;
+       pluto_carveouts[2].resize = true;
+       pluto_carveouts[2].cma_chunk_size = SZ_32M;
+#endif
 
        err = platform_device_register(&pluto_nvmap_device);
        if (err) {