From 0b6eff29656a4ee3d3d0bf94fd6a6328ded4ac7a Mon Sep 17 00:00:00 2001 From: Terje Bergstrom Date: Mon, 19 Jun 2017 14:23:16 -0700 Subject: gpu: nvgpu: Pass struct gk20a to secure alloc Pass struct gk20a to secure alloc API instead of Linux specific struct device. JIRA NVGPU-38 Change-Id: I6d9afaeeff9b957351072caa29690f2caf58f858 Signed-off-by: Terje Bergstrom Reviewed-on: http://git-master/r/1505179 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gk20a/gk20a.h | 2 +- drivers/gpu/nvgpu/gk20a/gr_gk20a.c | 7 +++---- drivers/gpu/nvgpu/gk20a/platform_gk20a.h | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) (limited to 'drivers/gpu/nvgpu/gk20a') diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.h b/drivers/gpu/nvgpu/gk20a/gk20a.h index f91e86df..19012bf5 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/gk20a.h @@ -695,7 +695,7 @@ struct gpu_ops { * context buffer descriptor (especially fields destroy, sgt, * size). */ - int (*secure_alloc)(struct device *dev, + int (*secure_alloc)(struct gk20a *g, struct gr_ctx_buffer_desc *desc, size_t size); } mm; diff --git a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c index 7631decf..f101d3ba 100644 --- a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c @@ -2728,7 +2728,6 @@ static int gr_gk20a_alloc_global_ctx_buffers(struct gk20a *g) { struct gr_gk20a *gr = &g->gr; int attr_buffer_size, err; - struct device *dev = g->dev; u32 cb_buffer_size = gr->bundle_cb_default_size * gr_scc_bundle_cb_size_div_256b_byte_granularity_v(); @@ -2748,7 +2747,7 @@ static int gr_gk20a_alloc_global_ctx_buffers(struct gk20a *g) goto clean_up; if (g->ops.mm.secure_alloc) - g->ops.mm.secure_alloc(dev, + g->ops.mm.secure_alloc(g, &gr->global_ctx_buffer[CIRCULAR_VPR], cb_buffer_size); @@ -2760,7 +2759,7 @@ static int gr_gk20a_alloc_global_ctx_buffers(struct gk20a *g) goto clean_up; if (g->ops.mm.secure_alloc) - g->ops.mm.secure_alloc(dev, + g->ops.mm.secure_alloc(g, &gr->global_ctx_buffer[PAGEPOOL_VPR], pagepool_buffer_size); @@ -2772,7 +2771,7 @@ static int gr_gk20a_alloc_global_ctx_buffers(struct gk20a *g) goto clean_up; if (g->ops.mm.secure_alloc) - g->ops.mm.secure_alloc(dev, + g->ops.mm.secure_alloc(g, &gr->global_ctx_buffer[ATTRIBUTE_VPR], attr_buffer_size); diff --git a/drivers/gpu/nvgpu/gk20a/platform_gk20a.h b/drivers/gpu/nvgpu/gk20a/platform_gk20a.h index 9499f91a..72322e54 100644 --- a/drivers/gpu/nvgpu/gk20a/platform_gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/platform_gk20a.h @@ -31,7 +31,7 @@ struct gr_ctx_buffer_desc; struct gk20a_scale_profile; struct secure_page_buffer { - void (*destroy)(struct device *, struct secure_page_buffer *); + void (*destroy)(struct gk20a *, struct secure_page_buffer *); size_t size; u64 iova; }; -- cgit v1.2.2