summaryrefslogtreecommitdiff
path: root/drivers/gpu
diff options
context:
space:
mode:
authorDeepak Nibade <dnibade@nvidia.com>2014-06-05 17:06:17 +0530
committerRiham Haidar <rhaidar@nvidia.com>2014-06-12 17:33:47 -0700
commit4236ab3323ee3c02fac562740d8b80d763589dea (patch)
tree8d9b10cccece5b6ffcb82976328edd0ae6f555c2 /drivers/gpu
parent5391515dab27cc88b921cf81913085dea98197e0 (diff)
gpu: nvgpu: allocate secure buffer in probe
Allocate dummy secure buffer of size PAGE_SIZE during gk20a_probe(). This will also help to initiate first secure memory (VPR) resize call while GPU is rail gated and in reset. This dummy buffer is released after we allocate some more secure memory buffers in alloc_global_ctx_buffers() Bug 1487804 Change-Id: I61604d9e5ffb585801ee893435c98a0d3e69d666 Signed-off-by: Deepak Nibade <dnibade@nvidia.com> Reviewed-on: http://git-master/r/421701 Reviewed-by: Riham Haidar <rhaidar@nvidia.com> Tested-by: Riham Haidar <rhaidar@nvidia.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/nvgpu/gk20a/gk20a.c21
-rw-r--r--drivers/gpu/nvgpu/gk20a/gr_gk20a.c3
2 files changed, 24 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.c b/drivers/gpu/nvgpu/gk20a/gk20a.c
index c0fd508561af..42b13c69c639 100644
--- a/drivers/gpu/nvgpu/gk20a/gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/gk20a.c
@@ -1288,6 +1288,21 @@ static int gk20a_pm_init(struct platform_device *dev)
return err;
}
+int gk20a_secure_page_alloc(struct platform_device *pdev)
+{
+ struct gk20a_platform *platform = platform_get_drvdata(pdev);
+ int err = 0;
+
+ if (platform->secure_page_alloc) {
+ tegra_periph_reset_assert(platform->clk[0]);
+ udelay(10);
+ err = platform->secure_page_alloc(pdev);
+ tegra_periph_reset_deassert(platform->clk[0]);
+ }
+
+ return err;
+}
+
static int gk20a_probe(struct platform_device *dev)
{
struct gk20a *gk20a;
@@ -1386,6 +1401,12 @@ static int gk20a_probe(struct platform_device *dev)
}
}
+ err = gk20a_secure_page_alloc(dev);
+ if (err) {
+ dev_err(&dev->dev, "failed to allocate secure buffer\n");
+ return err;
+ }
+
gk20a_debug_init(dev);
/* Set DMA parameters to allow larger sgt lists */
diff --git a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c
index 97f401adaf34..aced1e650179 100644
--- a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c
@@ -2367,6 +2367,9 @@ static int gr_gk20a_alloc_global_ctx_buffers(struct gk20a *g)
&gr->global_ctx_buffer[ATTRIBUTE_VPR],
attr_buffer_size);
+ if (platform->secure_buffer.destroy)
+ platform->secure_buffer.destroy(pdev, &platform->secure_buffer);
+
gk20a_dbg_info("golden_image_size : %d",
gr->ctx_vars.golden_image_size);