mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-24 10:34:43 +03:00
gpu: nvgpu: add gpc_mask to gr/config unit
We get gpc_mask by calling GR HAL g->ops.gr.get_gpc_mask() But gpc_mask should be logically owned by gr/config unit Hence add new gpc_mask field to nvgpu_gr_config Initialize it in nvgpu_gr_config_init() by calling a new HAL g->ops.gr.config.get_gpc_mask() if available If HAL is not defined we just initialize it based on gpc_count Expose new API nvgpu_gr_config_get_gpc_mask() to get gpc_mask and use this API now Remove gr_gm20b_get_gpc_mask() and HAL g->ops.gr.get_gpc_mask() Update GV100 and TU104 chip HALs to remove old and add new HAL Add gpc_mask to struct tegra_vgpu_constants_params to support this on vGPU. Also get gpc_mask from vGPU private data in vgpu_gr_init_gr_config() Jira NVGPU-1879 Change-Id: Ibdc89ea51df944dc7085920509e3536a5721efc0 Signed-off-by: Deepak Nibade <dnibade@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/2016084 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
6fb2abb153
commit
00aeab6cca
@@ -51,6 +51,12 @@ struct nvgpu_gr_config *nvgpu_gr_config_init(struct gk20a *g)
|
||||
goto clean_up;
|
||||
}
|
||||
|
||||
if (g->ops.gr.config.get_gpc_mask != NULL) {
|
||||
config->gpc_mask = g->ops.gr.config.get_gpc_mask(g, config);
|
||||
} else {
|
||||
config->gpc_mask = BIT32(config->gpc_count) - 1;
|
||||
}
|
||||
|
||||
config->pe_count_per_gpc = nvgpu_get_litter_value(g,
|
||||
GPU_LIT_NUM_PES_PER_GPC);
|
||||
if (config->pe_count_per_gpc > GK20A_GR_MAX_PES_PER_GPC) {
|
||||
@@ -531,3 +537,8 @@ u32 nvgpu_gr_config_get_pes_tpc_mask(struct nvgpu_gr_config *config,
|
||||
{
|
||||
return config->pes_tpc_mask[pes_index][gpc_index];
|
||||
}
|
||||
|
||||
u32 nvgpu_gr_config_get_gpc_mask(struct nvgpu_gr_config *config)
|
||||
{
|
||||
return config->gpc_mask;
|
||||
}
|
||||
|
||||
@@ -77,3 +77,20 @@ u32 gm20b_gr_config_get_pd_dist_skip_table_size(void)
|
||||
{
|
||||
return gr_pd_dist_skip_table__size_1_v();
|
||||
}
|
||||
|
||||
u32 gm20b_gr_config_get_gpc_mask(struct gk20a *g,
|
||||
struct nvgpu_gr_config *config)
|
||||
{
|
||||
u32 val;
|
||||
|
||||
/*
|
||||
* For register NV_FUSE_STATUS_OPT_GPC a set bit with index i indicates
|
||||
* corresponding GPC is floorswept
|
||||
* But for s/w mask a set bit means GPC is enabled and it is disabled
|
||||
* otherwise
|
||||
* Hence toggle the bits of register value to get s/w mask
|
||||
*/
|
||||
val = g->ops.fuse.fuse_status_opt_gpc(g);
|
||||
|
||||
return (~val) & (BIT32(config->max_gpc_count) - 1U);
|
||||
}
|
||||
|
||||
@@ -37,5 +37,7 @@ u32 gm20b_gr_config_get_zcull_count_in_gpc(struct gk20a *g,
|
||||
u32 gm20b_gr_config_get_pes_tpc_mask(struct gk20a *g,
|
||||
struct nvgpu_gr_config *config, u32 gpc_index, u32 pes_index);
|
||||
u32 gm20b_gr_config_get_pd_dist_skip_table_size(void);
|
||||
u32 gm20b_gr_config_get_gpc_mask(struct gk20a *g,
|
||||
struct nvgpu_gr_config *config);
|
||||
|
||||
#endif /* NVGPU_GR_CONFIG_GM20B_H */
|
||||
|
||||
Reference in New Issue
Block a user