diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.c b/drivers/gpu/nvgpu/gk20a/gk20a.c index b8357c769..470729b72 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gk20a.c @@ -1518,6 +1518,7 @@ static int gk20a_probe(struct platform_device *dev) S_IRUGO|S_IWUSR, platform->debugfs, &gk20a->mm.disable_bigpage); + gr_gk20a_debugfs_init(gk20a); gk20a_pmu_debugfs_init(dev); gk20a_cde_debugfs_init(dev); #endif diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.h b/drivers/gpu/nvgpu/gk20a/gk20a.h index c310d73c9..ce8d1d62e 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/gk20a.h @@ -472,6 +472,7 @@ struct gk20a { struct dentry *debugfs_gr_idle_timeout_default; struct dentry *debugfs_bypass_smmu; struct dentry *debugfs_disable_bigpage; + struct dentry *debugfs_gr_default_attrib_cb_size; #endif struct gk20a_ctxsw_ucode_info ctxsw_ucode_info; diff --git a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c index d0c5da0e0..78f815135 100644 --- a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c @@ -21,6 +21,7 @@ #include /* for totalram_pages */ #include #include +#include #include #include #include @@ -54,6 +55,7 @@ #include "dbg_gpu_gk20a.h" #include "debug_gk20a.h" #include "semaphore_gk20a.h" +#include "platform_gk20a.h" #define BLK_SIZE (256) @@ -6909,8 +6911,9 @@ static void gr_gk20a_cb_size_default(struct gk20a *g) { struct gr_gk20a *gr = &g->gr; - gr->attrib_cb_default_size = - gr_gpc0_ppc0_cbm_cfg_size_default_v(); + if (!gr->attrib_cb_default_size) + gr->attrib_cb_default_size = + gr_gpc0_ppc0_cbm_cfg_size_default_v(); gr->alpha_cb_default_size = gr_gpc0_ppc0_cbm_cfg2_size_default_v(); } @@ -7267,6 +7270,18 @@ static int gr_gk20a_dump_gr_status_regs(struct gk20a *g, return 0; } +int gr_gk20a_debugfs_init(struct gk20a *g) +{ + struct gk20a_platform *platform = platform_get_drvdata(g->dev); + + g->debugfs_gr_default_attrib_cb_size = + debugfs_create_u32("gr_default_attrib_cb_size", + S_IRUGO|S_IWUSR, platform->debugfs, + &g->gr.attrib_cb_default_size); + + return 0; +} + void gk20a_init_gr_ops(struct gpu_ops *gops) { gops->gr.access_smpc_reg = gr_gk20a_access_smpc_reg; diff --git a/drivers/gpu/nvgpu/gk20a/gr_gk20a.h b/drivers/gpu/nvgpu/gk20a/gr_gk20a.h index 1a55e064b..b2213739d 100644 --- a/drivers/gpu/nvgpu/gk20a/gr_gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/gr_gk20a.h @@ -495,5 +495,6 @@ int gr_gk20a_alloc_gr_ctx(struct gk20a *g, void gr_gk20a_free_gr_ctx(struct gk20a *g, struct vm_gk20a *vm, struct gr_ctx_desc *gr_ctx); int gr_gk20a_halt_pipe(struct gk20a *g); +int gr_gk20a_debugfs_init(struct gk20a *g); #endif /*__GR_GK20A_H__*/ diff --git a/drivers/gpu/nvgpu/gm20b/gr_gm20b.c b/drivers/gpu/nvgpu/gm20b/gr_gm20b.c index 74761258d..55a21c987 100644 --- a/drivers/gpu/nvgpu/gm20b/gr_gm20b.c +++ b/drivers/gpu/nvgpu/gm20b/gr_gm20b.c @@ -85,8 +85,9 @@ static void gr_gm20b_cb_size_default(struct gk20a *g) { struct gr_gk20a *gr = &g->gr; - gr->attrib_cb_default_size = - gr_gpc0_ppc0_cbm_beta_cb_size_v_default_v(); + if (!gr->attrib_cb_default_size) + gr->attrib_cb_default_size = + gr_gpc0_ppc0_cbm_beta_cb_size_v_default_v(); gr->alpha_cb_default_size = gr_gpc0_ppc0_cbm_alpha_cb_size_v_default_v(); }