From bd68f98ba76f43954e9858252a30e6c3b054c146 Mon Sep 17 00:00:00 2001 From: Terje Bergstrom Date: Mon, 1 May 2017 13:37:03 -0700 Subject: 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 Reviewed-on: http://git-master/r/1473706 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gk20a/gr_gk20a.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'drivers/gpu/nvgpu/gk20a/gr_gk20a.c') 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) static int gr_gk20a_alloc_global_ctx_buffers(struct gk20a *g) { - struct gk20a_platform *platform = dev_get_drvdata(g->dev); struct gr_gk20a *gr = &g->gr; int attr_buffer_size, err; struct device *dev = g->dev; @@ -2744,8 +2743,8 @@ static int gr_gk20a_alloc_global_ctx_buffers(struct gk20a *g) if (err) goto clean_up; - if (platform->secure_alloc) - platform->secure_alloc(dev, + if (g->ops.mm.secure_alloc) + g->ops.mm.secure_alloc(dev, &gr->global_ctx_buffer[CIRCULAR_VPR], cb_buffer_size); @@ -2756,8 +2755,8 @@ static int gr_gk20a_alloc_global_ctx_buffers(struct gk20a *g) if (err) goto clean_up; - if (platform->secure_alloc) - platform->secure_alloc(dev, + if (g->ops.mm.secure_alloc) + g->ops.mm.secure_alloc(dev, &gr->global_ctx_buffer[PAGEPOOL_VPR], pagepool_buffer_size); @@ -2768,14 +2767,11 @@ static int gr_gk20a_alloc_global_ctx_buffers(struct gk20a *g) if (err) goto clean_up; - if (platform->secure_alloc) - platform->secure_alloc(dev, + if (g->ops.mm.secure_alloc) + g->ops.mm.secure_alloc(dev, &gr->global_ctx_buffer[ATTRIBUTE_VPR], attr_buffer_size); - if (platform->secure_buffer.destroy) - platform->secure_buffer.destroy(dev, &platform->secure_buffer); - gk20a_dbg_info("golden_image_size : %d", gr->ctx_vars.golden_image_size); -- cgit v1.2.2