From f329e674f477f0120f9a92a9e7b4945a1ddaefbb Mon Sep 17 00:00:00 2001 From: Sami Kiminki Date: Fri, 28 Oct 2016 23:05:23 +0300 Subject: 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 Reviewed-on: http://git-master/r/1245294 (cherry picked from commit 0823b33e59defec341ea7919dae4e5f73a36d256) Reviewed-on: http://git-master/r/1249883 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gk20a/gr_gk20a.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'drivers/gpu/nvgpu/gk20a/gr_gk20a.c') diff --git a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c index 41ef5424..4dbdb777 100644 --- a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c @@ -3257,6 +3257,7 @@ static void gk20a_remove_gr_support(struct gr_gk20a *gr) kfree(gr->sm_to_cluster); kfree(gr->gpc_skip_mask); kfree(gr->map_tiles); + kfree(gr->fbp_rop_l2_en_mask); gr->gpc_tpc_count = NULL; gr->gpc_zcb_count = NULL; gr->gpc_ppc_count = NULL; @@ -3266,6 +3267,7 @@ static void gk20a_remove_gr_support(struct gr_gk20a *gr) gr->pes_tpc_mask[1] = NULL; gr->gpc_skip_mask = NULL; gr->map_tiles = NULL; + gr->fbp_rop_l2_en_mask = NULL; gr->ctx_vars.valid = false; kfree(gr->ctx_vars.ucode.fecs.inst.l); @@ -3336,6 +3338,11 @@ static int gr_gk20a_init_gr_config(struct gk20a *g, struct gr_gk20a *gr) gr->fbp_en_mask = g->ops.gr.get_fbp_en_mask(g); + gr->fbp_rop_l2_en_mask = + kzalloc(gr->max_fbps_count * sizeof(u32), GFP_KERNEL); + if (!gr->fbp_rop_l2_en_mask) + goto clean_up; + tmp = gk20a_readl(g, top_tpc_per_gpc_r()); gr->max_tpc_per_gpc_count = top_tpc_per_gpc_value_v(tmp); -- cgit v1.2.2