From 2c1218d0061f64e0343e3ca6c00935e91f6f8ae8 Mon Sep 17 00:00:00 2001 From: Deepak Nibade Date: Thu, 11 Apr 2019 17:27:31 +0530 Subject: [PATCH] gpu: nvgpu: remove fecs_size from gr.ctx_vars struct common.gr.fecs_trace API already exposes API nvgpu_gr_fecs_trace_buffer_size() to get fecs trace buffer size and hence we don't need to store the size in gr.ctx_vars struct Use nvgpu_gr_fecs_trace_buffer_size() wherever we need size and remove the variable from gr.ctx_vars struct Jira NVGPU-3112 Change-Id: I2afe22ef0910a63d854f2a232017861ab91611bc Signed-off-by: Deepak Nibade Reviewed-on: https://git-master.nvidia.com/r/2096157 Reviewed-by: svc-mobile-coverity Reviewed-by: svc-mobile-misra Reviewed-by: svc-misra-checker GVS: Gerrit_Virtual_Submit Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/common/gr/gr.c | 10 +++++----- drivers/gpu/nvgpu/common/gr/gr_falcon.c | 5 ----- drivers/gpu/nvgpu/common/vgpu/gr/gr_vgpu.c | 10 +++------- drivers/gpu/nvgpu/gk20a/gr_gk20a.h | 2 -- 4 files changed, 8 insertions(+), 19 deletions(-) diff --git a/drivers/gpu/nvgpu/common/gr/gr.c b/drivers/gpu/nvgpu/common/gr/gr.c index 6ef1b7360..4354162a2 100644 --- a/drivers/gpu/nvgpu/common/gr/gr.c +++ b/drivers/gpu/nvgpu/common/gr/gr.c @@ -22,6 +22,7 @@ #include #include +#include #include #include #include @@ -29,10 +30,10 @@ #include #include #include -#include #include #include #include +#include #include static int gr_alloc_global_ctx_buffers(struct gk20a *g) @@ -77,12 +78,11 @@ static int gr_alloc_global_ctx_buffers(struct gk20a *g) gr->ctx_vars.priv_access_map_size); #ifdef CONFIG_GK20A_CTXSW_TRACE - nvgpu_log_info(g, "fecs_trace_buffer_size : %d", - gr->ctx_vars.fecs_trace_buffer_size); + size = nvgpu_gr_fecs_trace_buffer_size(g); + nvgpu_log_info(g, "fecs_trace_buffer_size : %d", size); nvgpu_gr_global_ctx_set_size(gr->global_ctx_buffer, - NVGPU_GR_GLOBAL_CTX_FECS_TRACE_BUFFER, - gr->ctx_vars.fecs_trace_buffer_size); + NVGPU_GR_GLOBAL_CTX_FECS_TRACE_BUFFER, size); #endif if (g->ops.gr.init.get_rtv_cb_size != NULL) { diff --git a/drivers/gpu/nvgpu/common/gr/gr_falcon.c b/drivers/gpu/nvgpu/common/gr/gr_falcon.c index 49fd52753..5ecf19342 100644 --- a/drivers/gpu/nvgpu/common/gr/gr_falcon.c +++ b/drivers/gpu/nvgpu/common/gr/gr_falcon.c @@ -26,7 +26,6 @@ #include #include #include -#include #include #include #include @@ -136,10 +135,6 @@ int nvgpu_gr_falcon_init_ctx_state(struct gk20a *g) } g->gr.ctx_vars.priv_access_map_size = 512 * 1024; -#ifdef CONFIG_GK20A_CTXSW_TRACE - g->gr.ctx_vars.fecs_trace_buffer_size = - nvgpu_gr_fecs_trace_buffer_size(g); -#endif } out: diff --git a/drivers/gpu/nvgpu/common/vgpu/gr/gr_vgpu.c b/drivers/gpu/nvgpu/common/vgpu/gr/gr_vgpu.c index 175e61447..fd4a843e2 100644 --- a/drivers/gpu/nvgpu/common/vgpu/gr/gr_vgpu.c +++ b/drivers/gpu/nvgpu/common/vgpu/gr/gr_vgpu.c @@ -150,9 +150,6 @@ int vgpu_gr_init_ctx_state(struct gk20a *g) } g->gr.ctx_vars.priv_access_map_size = 512 * 1024; -#ifdef CONFIG_GK20A_CTXSW_TRACE - g->gr.ctx_vars.fecs_trace_buffer_size = nvgpu_gr_fecs_trace_buffer_size(g); -#endif g->gr.ctx_vars.preempt_image_size = priv->constants.preempt_ctx_size; @@ -203,12 +200,11 @@ int vgpu_gr_alloc_global_ctx_buffers(struct gk20a *g) gr->ctx_vars.priv_access_map_size); #ifdef CONFIG_GK20A_CTXSW_TRACE - nvgpu_log_info(g, "fecs_trace_buffer_size : %d", - gr->ctx_vars.fecs_trace_buffer_size); + size = nvgpu_gr_fecs_trace_buffer_size(g); + nvgpu_log_info(g, "fecs_trace_buffer_size : %d", size); nvgpu_gr_global_ctx_set_size(gr->global_ctx_buffer, - NVGPU_GR_GLOBAL_CTX_FECS_TRACE_BUFFER, - gr->ctx_vars.fecs_trace_buffer_size); + NVGPU_GR_GLOBAL_CTX_FECS_TRACE_BUFFER, size); #endif return 0; } diff --git a/drivers/gpu/nvgpu/gk20a/gr_gk20a.h b/drivers/gpu/nvgpu/gk20a/gr_gk20a.h index 13faae3ce..05c8c1253 100644 --- a/drivers/gpu/nvgpu/gk20a/gr_gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/gr_gk20a.h @@ -132,8 +132,6 @@ struct gr_gk20a { u32 priv_access_map_size; - u32 fecs_trace_buffer_size; - u32 preempt_image_size; bool force_preemption_gfxp; bool force_preemption_cilp;