summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gm20b/gr_gm20b.c
diff options
context:
space:
mode:
authorSami Kiminki <skiminki@nvidia.com>2016-10-28 16:05:23 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2016-11-11 05:21:04 -0500
commitf329e674f477f0120f9a92a9e7b4945a1ddaefbb (patch)
tree55107ad03a029e438e93c1793afd5e940ab7206b /drivers/gpu/nvgpu/gm20b/gr_gm20b.c
parentcc4208a27831faf95409b491aa29b8a161bf630a (diff)
gpu: nvgpu: gk20a: Fix FBP/L2 masks, add GET_FBP_L2_MASKS
Fix FBP and ROP_L2 enable masks for Maxwell+. Deprecate rop_l2_en_mask in GPU characteristics by adding _DEPRECATED postfix. The array is too small to hold ROP_L2 enable masks for desktop GPUs. Add NVGPU_GPU_IOCTL_GET_FBP_L2_MASKS to expose the ROP_L2 masks for userspace. Bug 200136909 Bug 200241845 Change-Id: I5ad5a5c09f3962ebb631b8d6e7a2f9df02f75ac7 Signed-off-by: Sami Kiminki <skiminki@nvidia.com> Reviewed-on: http://git-master/r/1245294 (cherry picked from commit 0823b33e59defec341ea7919dae4e5f73a36d256) Reviewed-on: http://git-master/r/1249883 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gm20b/gr_gm20b.c')
-rw-r--r--drivers/gpu/nvgpu/gm20b/gr_gm20b.c27
1 files changed, 20 insertions, 7 deletions
diff --git a/drivers/gpu/nvgpu/gm20b/gr_gm20b.c b/drivers/gpu/nvgpu/gm20b/gr_gm20b.c
index 23144275..37b9737b 100644
--- a/drivers/gpu/nvgpu/gm20b/gr_gm20b.c
+++ b/drivers/gpu/nvgpu/gm20b/gr_gm20b.c
@@ -1028,8 +1028,15 @@ static int gr_gm20b_update_pc_sampling(struct channel_gk20a *c,
1028static u32 gr_gm20b_get_fbp_en_mask(struct gk20a *g) 1028static u32 gr_gm20b_get_fbp_en_mask(struct gk20a *g)
1029{ 1029{
1030 u32 fbp_en_mask, opt_fbio; 1030 u32 fbp_en_mask, opt_fbio;
1031 opt_fbio = gk20a_readl(g, fuse_status_opt_fbio_r()); 1031 u32 tmp, max_fbps_count;
1032 fbp_en_mask = fuse_status_opt_fbio_data_v(opt_fbio); 1032
1033 tmp = gk20a_readl(g, top_num_fbps_r());
1034 max_fbps_count = top_num_fbps_value_v(tmp);
1035
1036 opt_fbio = gk20a_readl(g, fuse_status_opt_fbio_r());
1037 fbp_en_mask =
1038 ((1 << max_fbps_count) - 1) ^
1039 fuse_status_opt_fbio_data_v(opt_fbio);
1033 return fbp_en_mask; 1040 return fbp_en_mask;
1034} 1041}
1035 1042
@@ -1051,16 +1058,22 @@ static u32 gr_gm20b_get_max_lts_per_ltc(struct gk20a *g)
1051 1058
1052static u32 *gr_gm20b_rop_l2_en_mask(struct gk20a *g) 1059static u32 *gr_gm20b_rop_l2_en_mask(struct gk20a *g)
1053{ 1060{
1054 struct nvgpu_gpu_characteristics *gpu = &g->gpu_characteristics; 1061 struct gr_gk20a *gr = &g->gr;
1055 u32 i, tmp, max_fbps_count; 1062 u32 i, tmp, max_fbps_count, max_ltc_per_fbp;
1063 u32 rop_l2_all_en;
1064
1056 tmp = gk20a_readl(g, top_num_fbps_r()); 1065 tmp = gk20a_readl(g, top_num_fbps_r());
1057 max_fbps_count = top_num_fbps_value_v(tmp); 1066 max_fbps_count = top_num_fbps_value_v(tmp);
1067 max_ltc_per_fbp = gr_gm20b_get_max_ltc_per_fbp(g);
1068 rop_l2_all_en = (1 << max_ltc_per_fbp) - 1;
1058 1069
1059 /* mask of Rop_L2 for each FBP */ 1070 /* mask of Rop_L2 for each FBP */
1060 for (i = 0; i < max_fbps_count; i++) 1071 for (i = 0; i < max_fbps_count; i++) {
1061 gpu->rop_l2_en_mask[i] = fuse_status_opt_rop_l2_fbp_r(i); 1072 tmp = gk20a_readl(g, fuse_status_opt_rop_l2_fbp_r(i));
1073 gr->fbp_rop_l2_en_mask[i] = rop_l2_all_en ^ tmp;
1074 }
1062 1075
1063 return gpu->rop_l2_en_mask; 1076 return gr->fbp_rop_l2_en_mask;
1064} 1077}
1065 1078
1066static u32 gr_gm20b_get_max_fbps_count(struct gk20a *g) 1079static u32 gr_gm20b_get_max_fbps_count(struct gk20a *g)