summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gm20b
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/nvgpu/gm20b')
-rw-r--r--drivers/gpu/nvgpu/gm20b/hal_gm20b.c20
-rw-r--r--drivers/gpu/nvgpu/gm20b/ltc_gm20b.c26
-rw-r--r--drivers/gpu/nvgpu/gm20b/ltc_gm20b.h7
3 files changed, 25 insertions, 28 deletions
diff --git a/drivers/gpu/nvgpu/gm20b/hal_gm20b.c b/drivers/gpu/nvgpu/gm20b/hal_gm20b.c
index 831fd5da..53542702 100644
--- a/drivers/gpu/nvgpu/gm20b/hal_gm20b.c
+++ b/drivers/gpu/nvgpu/gm20b/hal_gm20b.c
@@ -46,7 +46,22 @@
46 46
47#define PRIV_SECURITY_DISABLE 0x01 47#define PRIV_SECURITY_DISABLE 0x01
48 48
49static struct gpu_ops gm20b_ops = { 49static const struct gpu_ops gm20b_ops = {
50 .ltc = {
51 .determine_L2_size_bytes = gm20b_determine_L2_size_bytes,
52 .set_zbc_color_entry = gm20b_ltc_set_zbc_color_entry,
53 .set_zbc_depth_entry = gm20b_ltc_set_zbc_depth_entry,
54 .init_cbc = gm20b_ltc_init_cbc,
55 .init_fs_state = gm20b_ltc_init_fs_state,
56 .init_comptags = gm20b_ltc_init_comptags,
57 .cbc_ctrl = gm20b_ltc_cbc_ctrl,
58 .isr = gm20b_ltc_isr,
59 .cbc_fix_config = gm20b_ltc_cbc_fix_config,
60 .flush = gm20b_flush_ltc,
61#ifdef CONFIG_DEBUG_FS
62 .sync_debugfs = gm20b_ltc_sync_debugfs,
63#endif
64 },
50 .clock_gating = { 65 .clock_gating = {
51 .slcg_bus_load_gating_prod = 66 .slcg_bus_load_gating_prod =
52 gm20b_slcg_bus_load_gating_prod, 67 gm20b_slcg_bus_load_gating_prod,
@@ -189,6 +204,7 @@ int gm20b_init_hal(struct gk20a *g)
189 struct nvgpu_gpu_characteristics *c = &g->gpu_characteristics; 204 struct nvgpu_gpu_characteristics *c = &g->gpu_characteristics;
190 u32 val; 205 u32 val;
191 206
207 gops->ltc = gm20b_ops.ltc;
192 gops->clock_gating = gm20b_ops.clock_gating; 208 gops->clock_gating = gm20b_ops.clock_gating;
193 gops->securegpccs = false; 209 gops->securegpccs = false;
194 gops->pmupstate = false; 210 gops->pmupstate = false;
@@ -222,9 +238,7 @@ int gm20b_init_hal(struct gk20a *g)
222 gk20a_init_bus(gops); 238 gk20a_init_bus(gops);
223 gm20b_init_mc(gops); 239 gm20b_init_mc(gops);
224 gk20a_init_priv_ring(gops); 240 gk20a_init_priv_ring(gops);
225 gm20b_init_ltc(gops);
226 gm20b_init_gr(gops); 241 gm20b_init_gr(gops);
227 gm20b_init_ltc(gops);
228 gm20b_init_fb(gops); 242 gm20b_init_fb(gops);
229 gm20b_init_fifo(gops); 243 gm20b_init_fifo(gops);
230 gm20b_init_ce2(gops); 244 gm20b_init_ce2(gops);
diff --git a/drivers/gpu/nvgpu/gm20b/ltc_gm20b.c b/drivers/gpu/nvgpu/gm20b/ltc_gm20b.c
index e4e385fb..5e938141 100644
--- a/drivers/gpu/nvgpu/gm20b/ltc_gm20b.c
+++ b/drivers/gpu/nvgpu/gm20b/ltc_gm20b.c
@@ -29,7 +29,7 @@
29#include "gk20a/ltc_gk20a.h" 29#include "gk20a/ltc_gk20a.h"
30#include "ltc_gm20b.h" 30#include "ltc_gm20b.h"
31 31
32static int gm20b_ltc_init_comptags(struct gk20a *g, struct gr_gk20a *gr) 32int gm20b_ltc_init_comptags(struct gk20a *g, struct gr_gk20a *gr)
33{ 33{
34 /* max memory size (MB) to cover */ 34 /* max memory size (MB) to cover */
35 u32 max_size = gr->max_comptag_mem; 35 u32 max_size = gr->max_comptag_mem;
@@ -309,7 +309,7 @@ void gm20b_flush_ltc(struct gk20a *g)
309 } 309 }
310} 310}
311 311
312static int gm20b_determine_L2_size_bytes(struct gk20a *g) 312int gm20b_determine_L2_size_bytes(struct gk20a *g)
313{ 313{
314 u32 lts_per_ltc; 314 u32 lts_per_ltc;
315 u32 ways; 315 u32 ways;
@@ -438,7 +438,7 @@ void gm20b_ltc_init_cbc(struct gk20a *g, struct gr_gk20a *gr)
438} 438}
439 439
440#ifdef CONFIG_DEBUG_FS 440#ifdef CONFIG_DEBUG_FS
441static void gm20b_ltc_sync_debugfs(struct gk20a *g) 441void gm20b_ltc_sync_debugfs(struct gk20a *g)
442{ 442{
443 u32 reg_f = ltc_ltcs_ltss_tstg_set_mgmt_2_l2_bypass_mode_enabled_f(); 443 u32 reg_f = ltc_ltcs_ltss_tstg_set_mgmt_2_l2_bypass_mode_enabled_f();
444 444
@@ -459,23 +459,3 @@ static void gm20b_ltc_sync_debugfs(struct gk20a *g)
459 nvgpu_spinlock_release(&g->debugfs_lock); 459 nvgpu_spinlock_release(&g->debugfs_lock);
460} 460}
461#endif 461#endif
462
463void gm20b_init_ltc(struct gpu_ops *gops)
464{
465 /* Gk20a reused ops. */
466 gops->ltc.determine_L2_size_bytes = gm20b_determine_L2_size_bytes;
467 gops->ltc.set_zbc_color_entry = gm20b_ltc_set_zbc_color_entry;
468 gops->ltc.set_zbc_depth_entry = gm20b_ltc_set_zbc_depth_entry;
469 gops->ltc.init_cbc = gm20b_ltc_init_cbc;
470
471 /* GM20b specific ops. */
472 gops->ltc.init_fs_state = gm20b_ltc_init_fs_state;
473 gops->ltc.init_comptags = gm20b_ltc_init_comptags;
474 gops->ltc.cbc_ctrl = gm20b_ltc_cbc_ctrl;
475 gops->ltc.isr = gm20b_ltc_isr;
476 gops->ltc.cbc_fix_config = gm20b_ltc_cbc_fix_config;
477 gops->ltc.flush = gm20b_flush_ltc;
478#ifdef CONFIG_DEBUG_FS
479 gops->ltc.sync_debugfs = gm20b_ltc_sync_debugfs;
480#endif
481}
diff --git a/drivers/gpu/nvgpu/gm20b/ltc_gm20b.h b/drivers/gpu/nvgpu/gm20b/ltc_gm20b.h
index 4fe83250..b5661d4e 100644
--- a/drivers/gpu/nvgpu/gm20b/ltc_gm20b.h
+++ b/drivers/gpu/nvgpu/gm20b/ltc_gm20b.h
@@ -17,6 +17,8 @@
17#define _NVHOST_GM20B_LTC 17#define _NVHOST_GM20B_LTC
18struct gpu_ops; 18struct gpu_ops;
19 19
20int gm20b_ltc_init_comptags(struct gk20a *g, struct gr_gk20a *gr);
21int gm20b_determine_L2_size_bytes(struct gk20a *g);
20void gm20b_ltc_set_zbc_color_entry(struct gk20a *g, 22void gm20b_ltc_set_zbc_color_entry(struct gk20a *g,
21 struct zbc_entry *color_val, 23 struct zbc_entry *color_val,
22 u32 index); 24 u32 index);
@@ -24,8 +26,9 @@ void gm20b_ltc_set_zbc_depth_entry(struct gk20a *g,
24 struct zbc_entry *depth_val, 26 struct zbc_entry *depth_val,
25 u32 index); 27 u32 index);
26void gm20b_ltc_init_cbc(struct gk20a *g, struct gr_gk20a *gr); 28void gm20b_ltc_init_cbc(struct gk20a *g, struct gr_gk20a *gr);
27 29#ifdef CONFIG_DEBUG_FS
28void gm20b_init_ltc(struct gpu_ops *gops); 30void gm20b_ltc_sync_debugfs(struct gk20a *g);
31#endif
29void gm20b_ltc_init_fs_state(struct gk20a *g); 32void gm20b_ltc_init_fs_state(struct gk20a *g);
30int gm20b_ltc_cbc_ctrl(struct gk20a *g, enum gk20a_cbc_op op, 33int gm20b_ltc_cbc_ctrl(struct gk20a *g, enum gk20a_cbc_op op,
31 u32 min, u32 max); 34 u32 min, u32 max);