mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-24 10:34:43 +03:00
gpu: nvgpu: Move gk20a_gr_alloc_global_ctx_buffers to gr.common
Move gk20a_gr_alloc_global_ctx_buffers from gr_gk20a.c to gr.c as static function as gr_alloc_global_ctx_buffers. This function is used locally by gr_init_setup_sw function. Remove alloc_global_ctx_buffers hal function. JIRA NVGPU-1885 Change-Id: I85f1ed85259cd564577b69af8cf01c1a2802004b Signed-off-by: Vinod G <vinodg@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/2093834 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
312f91f991
commit
cd1254d524
@@ -288,73 +288,6 @@ int gr_gk20a_update_hwpm_ctxsw_mode(struct gk20a *g,
|
||||
return ret;
|
||||
}
|
||||
|
||||
int gr_gk20a_alloc_global_ctx_buffers(struct gk20a *g)
|
||||
{
|
||||
struct gr_gk20a *gr = &g->gr;
|
||||
int err;
|
||||
u32 size;
|
||||
|
||||
nvgpu_log_fn(g, " ");
|
||||
|
||||
size = g->ops.gr.init.get_global_ctx_cb_buffer_size(g);
|
||||
nvgpu_log_info(g, "cb_buffer_size : %d", size);
|
||||
|
||||
nvgpu_gr_global_ctx_set_size(gr->global_ctx_buffer,
|
||||
NVGPU_GR_GLOBAL_CTX_CIRCULAR, size);
|
||||
nvgpu_gr_global_ctx_set_size(gr->global_ctx_buffer,
|
||||
NVGPU_GR_GLOBAL_CTX_CIRCULAR_VPR, size);
|
||||
|
||||
size = g->ops.gr.init.get_global_ctx_pagepool_buffer_size(g);
|
||||
nvgpu_log_info(g, "pagepool_buffer_size : %d", size);
|
||||
|
||||
nvgpu_gr_global_ctx_set_size(gr->global_ctx_buffer,
|
||||
NVGPU_GR_GLOBAL_CTX_PAGEPOOL, size);
|
||||
nvgpu_gr_global_ctx_set_size(gr->global_ctx_buffer,
|
||||
NVGPU_GR_GLOBAL_CTX_PAGEPOOL_VPR, size);
|
||||
|
||||
size = g->ops.gr.init.get_global_attr_cb_size(g,
|
||||
nvgpu_gr_config_get_tpc_count(g->gr.config),
|
||||
nvgpu_gr_config_get_max_tpc_count(g->gr.config));
|
||||
nvgpu_log_info(g, "attr_buffer_size : %u", size);
|
||||
|
||||
nvgpu_gr_global_ctx_set_size(gr->global_ctx_buffer,
|
||||
NVGPU_GR_GLOBAL_CTX_ATTRIBUTE, size);
|
||||
nvgpu_gr_global_ctx_set_size(gr->global_ctx_buffer,
|
||||
NVGPU_GR_GLOBAL_CTX_ATTRIBUTE_VPR, size);
|
||||
|
||||
nvgpu_log_info(g, "priv_access_map_size : %d",
|
||||
gr->ctx_vars.priv_access_map_size);
|
||||
|
||||
nvgpu_gr_global_ctx_set_size(gr->global_ctx_buffer,
|
||||
NVGPU_GR_GLOBAL_CTX_PRIV_ACCESS_MAP,
|
||||
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);
|
||||
|
||||
nvgpu_gr_global_ctx_set_size(gr->global_ctx_buffer,
|
||||
NVGPU_GR_GLOBAL_CTX_FECS_TRACE_BUFFER,
|
||||
gr->ctx_vars.fecs_trace_buffer_size);
|
||||
#endif
|
||||
|
||||
if (g->ops.gr.init.get_rtv_cb_size != NULL) {
|
||||
size = g->ops.gr.init.get_rtv_cb_size(g);
|
||||
nvgpu_log_info(g, "rtv_circular_buffer_size : %u", size);
|
||||
|
||||
nvgpu_gr_global_ctx_set_size(gr->global_ctx_buffer,
|
||||
NVGPU_GR_GLOBAL_CTX_RTV_CIRCULAR_BUFFER, size);
|
||||
}
|
||||
|
||||
err = nvgpu_gr_global_ctx_buffer_alloc(g, gr->global_ctx_buffer);
|
||||
if (err != 0) {
|
||||
return err;
|
||||
}
|
||||
|
||||
nvgpu_log_fn(g, "done");
|
||||
return 0;
|
||||
}
|
||||
|
||||
u32 gr_gk20a_get_patch_slots(struct gk20a *g)
|
||||
{
|
||||
return PATCH_CTX_SLOTS_PER_PAGE;
|
||||
|
||||
Reference in New Issue
Block a user