gpu: nvgpu: gv11b: function to get max veid

Defined function to get max number of subcontexs
supported and used it where max subcontext count required.

JIRA GV11B-23

Change-Id: I4f6307162486bab1e91cbf66abfee7763c70fe7b
Signed-off-by: seshendra Gadagottu <sgadagottu@nvidia.com>
Signed-off-by: Seema Khowala <seemaj@nvidia.com>
Reviewed-on: http://git-master/r/1318146
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
This commit is contained in:
seshendra Gadagottu
2017-03-09 11:30:14 -08:00
committed by mobile promotions
parent 1b4849cda5
commit 7b5b4fc84f
3 changed files with 12 additions and 3 deletions

View File

@@ -1649,10 +1649,9 @@ static void gv11b_write_bundle_veid_state(struct gk20a *g, u32 index)
struct av_list_gk20a *sw_veid_bundle_init =
&g->gr.ctx_vars.sw_veid_bundle_init;
u32 j;
u32 data = gk20a_readl(g, gr_pri_fe_chip_def_info_r());
u32 num_subctx, err = 0;
num_subctx = gr_pri_fe_chip_def_info_max_veid_count_v(data);
num_subctx = gv11b_get_max_subctx_count(g);
for (j = 0; j < num_subctx; j++) {

View File

@@ -25,6 +25,7 @@
#include <nvgpu/hw/gv11b/hw_ram_gv11b.h>
#include <nvgpu/hw/gv11b/hw_ctxsw_prog_gv11b.h>
#include <nvgpu/hw/gv11b/hw_gr_gv11b.h>
static void gv11b_init_subcontext_pdb(struct channel_gk20a *c,
struct nvgpu_mem *inst_block);
@@ -147,3 +148,10 @@ int gv11b_update_subctx_header(struct channel_gk20a *c, u64 gpu_va)
nvgpu_mem_end(g, gr_mem);
return ret;
}
int gv11b_get_max_subctx_count(struct gk20a *g)
{
u32 data = gk20a_readl(g, gr_pri_fe_chip_def_info_r());
return gr_pri_fe_chip_def_info_max_veid_count_v(data);
}

View File

@@ -2,7 +2,7 @@
*
* Volta GPU series Subcontext
*
* Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved.
* Copyright (c) 2016 - 2017, NVIDIA CORPORATION. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
@@ -24,4 +24,6 @@ int gv11b_alloc_subctx_header(struct channel_gk20a *c);
void gv11b_free_subctx_header(struct channel_gk20a *c);
int gv11b_update_subctx_header(struct channel_gk20a *c, u64 gpu_va);
int gv11b_get_max_subctx_count(struct gk20a *g);
#endif /* __SUBCONTEXT_GV11B_H__ */