summaryrefslogtreecommitdiff
path: root/drivers/gpu
diff options
context:
space:
mode:
authorBibek Basu <bbasu@nvidia.com>2015-05-22 15:25:53 +0530
committerMatthew Pedro <mapedro@nvidia.com>2015-06-04 21:01:41 -0700
commit3ad19f3e10019cb72d51e506afb9ae6c6b1a9a75 (patch)
tree33667ca8ce014cd51e898c7e8d2d9dc4e79fa754 /drivers/gpu
parent3fa8ce564de498461f567c3917dc4c610388d747 (diff)
gpu: nvgpu: gk20a: dma_alloc only if needed
if vpr memory is carved out, then only call dma_alloc for secure memory. Bug 200057068 Change-Id: I12557cfaa48f7db729ccab17d3151916d35ce0f1 Signed-off-by: Bibek Basu <bbasu@nvidia.com> Reviewed-on: http://git-master/r/746153 GVS: Gerrit_Virtual_Submit Reviewed-by: Venkat Moganty <vmoganty@nvidia.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/nvgpu/gk20a/gk20a.c5
-rw-r--r--drivers/gpu/nvgpu/gk20a/platform_gk20a_tegra.c3
2 files changed, 5 insertions, 3 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.c b/drivers/gpu/nvgpu/gk20a/gk20a.c
index 03d466ef3dc8..f5f2c130241d 100644
--- a/drivers/gpu/nvgpu/gk20a/gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/gk20a.c
@@ -1310,11 +1310,10 @@ int gk20a_secure_page_alloc(struct platform_device *pdev)
udelay(10);
err = platform->secure_page_alloc(pdev);
tegra_periph_reset_deassert(platform->clk[0]);
+ if (!err)
+ platform->secure_alloc_ready = true;
}
- if (!err)
- platform->secure_alloc_ready = true;
-
return err;
}
diff --git a/drivers/gpu/nvgpu/gk20a/platform_gk20a_tegra.c b/drivers/gpu/nvgpu/gk20a/platform_gk20a_tegra.c
index edeacdac6e5c..c94d35176c11 100644
--- a/drivers/gpu/nvgpu/gk20a/platform_gk20a_tegra.c
+++ b/drivers/gpu/nvgpu/gk20a/platform_gk20a_tegra.c
@@ -39,6 +39,7 @@
#define TEGRA_GK20A_SIM_SIZE 0x1000 /*tbd: this is a high-side guess */
extern struct device tegra_vpr_dev;
+extern phys_addr_t tegra_vpr_size;
struct gk20a_platform t132_gk20a_tegra_platform;
struct gk20a_emc_params {
@@ -457,6 +458,8 @@ static int gk20a_tegra_probe(struct platform_device *dev)
*platform = t132_gk20a_tegra_platform;
}
+ if (tegra_vpr_size == 0)
+ platform->secure_page_alloc = NULL;
gk20a_tegra_get_clocks(dev);
return 0;