diff options
author | Terje Bergstrom <tbergstrom@nvidia.com> | 2017-05-01 16:37:03 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-05-11 14:05:31 -0400 |
commit | bd68f98ba76f43954e9858252a30e6c3b054c146 (patch) | |
tree | faa4e213603b9fe91d911cf5e0f06977c4232db4 /drivers/gpu/nvgpu/gk20a/gr_gk20a.c | |
parent | c3fa78b1d9cba28547ca59154207d434931ae746 (diff) |
gpu: nvgpu: Move secure_alloc to struct gk20a
Move the function pointer for VPR page allocation to struct gk20a
and use it from there. At the same time remove secure_page_alloc
pointer and add a direct call to it in probe.
Move platform_tegra.h as tegra/linux/platform_gk20a_tegra.h, as it's
only declaring functions defined in platform_gk20a_tegra.c to other
files in the same directory.
JIRA NVGPU-16
Change-Id: I19ac9ee0b2f6734203ae32a1f51d67fd51aced9f
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/1473706
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/gr_gk20a.c')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gr_gk20a.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c index 2f52fdcf..2d87911d 100644 --- a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c | |||
@@ -2722,7 +2722,6 @@ static void gr_gk20a_free_global_ctx_buffers(struct gk20a *g) | |||
2722 | 2722 | ||
2723 | static int gr_gk20a_alloc_global_ctx_buffers(struct gk20a *g) | 2723 | static int gr_gk20a_alloc_global_ctx_buffers(struct gk20a *g) |
2724 | { | 2724 | { |
2725 | struct gk20a_platform *platform = dev_get_drvdata(g->dev); | ||
2726 | struct gr_gk20a *gr = &g->gr; | 2725 | struct gr_gk20a *gr = &g->gr; |
2727 | int attr_buffer_size, err; | 2726 | int attr_buffer_size, err; |
2728 | struct device *dev = g->dev; | 2727 | struct device *dev = g->dev; |
@@ -2744,8 +2743,8 @@ static int gr_gk20a_alloc_global_ctx_buffers(struct gk20a *g) | |||
2744 | if (err) | 2743 | if (err) |
2745 | goto clean_up; | 2744 | goto clean_up; |
2746 | 2745 | ||
2747 | if (platform->secure_alloc) | 2746 | if (g->ops.mm.secure_alloc) |
2748 | platform->secure_alloc(dev, | 2747 | g->ops.mm.secure_alloc(dev, |
2749 | &gr->global_ctx_buffer[CIRCULAR_VPR], | 2748 | &gr->global_ctx_buffer[CIRCULAR_VPR], |
2750 | cb_buffer_size); | 2749 | cb_buffer_size); |
2751 | 2750 | ||
@@ -2756,8 +2755,8 @@ static int gr_gk20a_alloc_global_ctx_buffers(struct gk20a *g) | |||
2756 | if (err) | 2755 | if (err) |
2757 | goto clean_up; | 2756 | goto clean_up; |
2758 | 2757 | ||
2759 | if (platform->secure_alloc) | 2758 | if (g->ops.mm.secure_alloc) |
2760 | platform->secure_alloc(dev, | 2759 | g->ops.mm.secure_alloc(dev, |
2761 | &gr->global_ctx_buffer[PAGEPOOL_VPR], | 2760 | &gr->global_ctx_buffer[PAGEPOOL_VPR], |
2762 | pagepool_buffer_size); | 2761 | pagepool_buffer_size); |
2763 | 2762 | ||
@@ -2768,14 +2767,11 @@ static int gr_gk20a_alloc_global_ctx_buffers(struct gk20a *g) | |||
2768 | if (err) | 2767 | if (err) |
2769 | goto clean_up; | 2768 | goto clean_up; |
2770 | 2769 | ||
2771 | if (platform->secure_alloc) | 2770 | if (g->ops.mm.secure_alloc) |
2772 | platform->secure_alloc(dev, | 2771 | g->ops.mm.secure_alloc(dev, |
2773 | &gr->global_ctx_buffer[ATTRIBUTE_VPR], | 2772 | &gr->global_ctx_buffer[ATTRIBUTE_VPR], |
2774 | attr_buffer_size); | 2773 | attr_buffer_size); |
2775 | 2774 | ||
2776 | if (platform->secure_buffer.destroy) | ||
2777 | platform->secure_buffer.destroy(dev, &platform->secure_buffer); | ||
2778 | |||
2779 | gk20a_dbg_info("golden_image_size : %d", | 2775 | gk20a_dbg_info("golden_image_size : %d", |
2780 | gr->ctx_vars.golden_image_size); | 2776 | gr->ctx_vars.golden_image_size); |
2781 | 2777 | ||