summaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorTerje Bergstrom <tbergstrom@nvidia.com>2015-04-20 13:31:09 -0400
committerIshan Mittal <imittal@nvidia.com>2015-05-18 02:02:40 -0400
commitd20afe7bd4a5cf74c7dfab6b9735604ba506215e (patch)
tree9dff668a9730034db48f671cc586b1da5cf00042 /drivers/gpu
parent96ffe0c64d88f4f8154322c00823083ef97f3643 (diff)
gpu: nvgpu: Dynamic betacb size
Allow querying and setting default betacb size via debugfs. For global buffers the value takes effect upon first boot of GPU, and has no effect after that. Bug 1628352 Change-Id: Ib63f4299249c41eab1b36cc501b525cc54211195 Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-on: http://git-master/r/733328
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/nvgpu/gk20a/gk20a.c1
-rw-r--r--drivers/gpu/nvgpu/gk20a/gk20a.h1
-rw-r--r--drivers/gpu/nvgpu/gk20a/gr_gk20a.c19
-rw-r--r--drivers/gpu/nvgpu/gk20a/gr_gk20a.h1
-rw-r--r--drivers/gpu/nvgpu/gm20b/gr_gm20b.c5
5 files changed, 23 insertions, 4 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.c b/drivers/gpu/nvgpu/gk20a/gk20a.c
index b8357c76..470729b7 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)
1518 S_IRUGO|S_IWUSR, 1518 S_IRUGO|S_IWUSR,
1519 platform->debugfs, 1519 platform->debugfs,
1520 &gk20a->mm.disable_bigpage); 1520 &gk20a->mm.disable_bigpage);
1521 gr_gk20a_debugfs_init(gk20a);
1521 gk20a_pmu_debugfs_init(dev); 1522 gk20a_pmu_debugfs_init(dev);
1522 gk20a_cde_debugfs_init(dev); 1523 gk20a_cde_debugfs_init(dev);
1523#endif 1524#endif
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.h b/drivers/gpu/nvgpu/gk20a/gk20a.h
index c310d73c..ce8d1d62 100644
--- a/drivers/gpu/nvgpu/gk20a/gk20a.h
+++ b/drivers/gpu/nvgpu/gk20a/gk20a.h
@@ -472,6 +472,7 @@ struct gk20a {
472 struct dentry *debugfs_gr_idle_timeout_default; 472 struct dentry *debugfs_gr_idle_timeout_default;
473 struct dentry *debugfs_bypass_smmu; 473 struct dentry *debugfs_bypass_smmu;
474 struct dentry *debugfs_disable_bigpage; 474 struct dentry *debugfs_disable_bigpage;
475 struct dentry *debugfs_gr_default_attrib_cb_size;
475#endif 476#endif
476 struct gk20a_ctxsw_ucode_info ctxsw_ucode_info; 477 struct gk20a_ctxsw_ucode_info ctxsw_ucode_info;
477 478
diff --git a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c
index d0c5da0e..78f81513 100644
--- a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c
@@ -21,6 +21,7 @@
21#include <linux/mm.h> /* for totalram_pages */ 21#include <linux/mm.h> /* for totalram_pages */
22#include <linux/scatterlist.h> 22#include <linux/scatterlist.h>
23#include <linux/tegra-soc.h> 23#include <linux/tegra-soc.h>
24#include <linux/debugfs.h>
24#include <uapi/linux/nvgpu.h> 25#include <uapi/linux/nvgpu.h>
25#include <linux/vmalloc.h> 26#include <linux/vmalloc.h>
26#include <linux/dma-mapping.h> 27#include <linux/dma-mapping.h>
@@ -54,6 +55,7 @@
54#include "dbg_gpu_gk20a.h" 55#include "dbg_gpu_gk20a.h"
55#include "debug_gk20a.h" 56#include "debug_gk20a.h"
56#include "semaphore_gk20a.h" 57#include "semaphore_gk20a.h"
58#include "platform_gk20a.h"
57 59
58#define BLK_SIZE (256) 60#define BLK_SIZE (256)
59 61
@@ -6909,8 +6911,9 @@ static void gr_gk20a_cb_size_default(struct gk20a *g)
6909{ 6911{
6910 struct gr_gk20a *gr = &g->gr; 6912 struct gr_gk20a *gr = &g->gr;
6911 6913
6912 gr->attrib_cb_default_size = 6914 if (!gr->attrib_cb_default_size)
6913 gr_gpc0_ppc0_cbm_cfg_size_default_v(); 6915 gr->attrib_cb_default_size =
6916 gr_gpc0_ppc0_cbm_cfg_size_default_v();
6914 gr->alpha_cb_default_size = 6917 gr->alpha_cb_default_size =
6915 gr_gpc0_ppc0_cbm_cfg2_size_default_v(); 6918 gr_gpc0_ppc0_cbm_cfg2_size_default_v();
6916} 6919}
@@ -7267,6 +7270,18 @@ static int gr_gk20a_dump_gr_status_regs(struct gk20a *g,
7267 return 0; 7270 return 0;
7268} 7271}
7269 7272
7273int gr_gk20a_debugfs_init(struct gk20a *g)
7274{
7275 struct gk20a_platform *platform = platform_get_drvdata(g->dev);
7276
7277 g->debugfs_gr_default_attrib_cb_size =
7278 debugfs_create_u32("gr_default_attrib_cb_size",
7279 S_IRUGO|S_IWUSR, platform->debugfs,
7280 &g->gr.attrib_cb_default_size);
7281
7282 return 0;
7283}
7284
7270void gk20a_init_gr_ops(struct gpu_ops *gops) 7285void gk20a_init_gr_ops(struct gpu_ops *gops)
7271{ 7286{
7272 gops->gr.access_smpc_reg = gr_gk20a_access_smpc_reg; 7287 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 1a55e064..b2213739 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,
495void gr_gk20a_free_gr_ctx(struct gk20a *g, 495void gr_gk20a_free_gr_ctx(struct gk20a *g,
496 struct vm_gk20a *vm, struct gr_ctx_desc *gr_ctx); 496 struct vm_gk20a *vm, struct gr_ctx_desc *gr_ctx);
497int gr_gk20a_halt_pipe(struct gk20a *g); 497int gr_gk20a_halt_pipe(struct gk20a *g);
498int gr_gk20a_debugfs_init(struct gk20a *g);
498 499
499#endif /*__GR_GK20A_H__*/ 500#endif /*__GR_GK20A_H__*/
diff --git a/drivers/gpu/nvgpu/gm20b/gr_gm20b.c b/drivers/gpu/nvgpu/gm20b/gr_gm20b.c
index 74761258..55a21c98 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)
85{ 85{
86 struct gr_gk20a *gr = &g->gr; 86 struct gr_gk20a *gr = &g->gr;
87 87
88 gr->attrib_cb_default_size = 88 if (!gr->attrib_cb_default_size)
89 gr_gpc0_ppc0_cbm_beta_cb_size_v_default_v(); 89 gr->attrib_cb_default_size =
90 gr_gpc0_ppc0_cbm_beta_cb_size_v_default_v();
90 gr->alpha_cb_default_size = 91 gr->alpha_cb_default_size =
91 gr_gpc0_ppc0_cbm_alpha_cb_size_v_default_v(); 92 gr_gpc0_ppc0_cbm_alpha_cb_size_v_default_v();
92} 93}