summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/ltc_gk20a.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/ltc_gk20a.c')
-rw-r--r--drivers/gpu/nvgpu/gk20a/ltc_gk20a.c33
1 files changed, 9 insertions, 24 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/ltc_gk20a.c b/drivers/gpu/nvgpu/gk20a/ltc_gk20a.c
index 1d517c27..9220685a 100644
--- a/drivers/gpu/nvgpu/gk20a/ltc_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/ltc_gk20a.c
@@ -51,7 +51,7 @@ int gk20a_ltc_alloc_virt_cbc(struct gk20a *g, size_t compbit_backing_size)
51} 51}
52 52
53/* HW reg dependent stuff: */ 53/* HW reg dependent stuff: */
54static int gk20a_ltc_init_comptags(struct gk20a *g, struct gr_gk20a *gr) 54int gk20a_ltc_init_comptags(struct gk20a *g, struct gr_gk20a *gr)
55{ 55{
56 /* max memory size (MB) to cover */ 56 /* max memory size (MB) to cover */
57 u32 max_size = gr->max_comptag_mem; 57 u32 max_size = gr->max_comptag_mem;
@@ -125,7 +125,7 @@ static int gk20a_ltc_init_comptags(struct gk20a *g, struct gr_gk20a *gr)
125 return 0; 125 return 0;
126} 126}
127 127
128static int gk20a_ltc_cbc_ctrl(struct gk20a *g, enum gk20a_cbc_op op, 128int gk20a_ltc_cbc_ctrl(struct gk20a *g, enum gk20a_cbc_op op,
129 u32 min, u32 max) 129 u32 min, u32 max)
130{ 130{
131 int err = 0; 131 int err = 0;
@@ -196,14 +196,14 @@ out:
196} 196}
197 197
198 198
199static void gk20a_ltc_init_fs_state(struct gk20a *g) 199void gk20a_ltc_init_fs_state(struct gk20a *g)
200{ 200{
201 gk20a_dbg_info("initialize gk20a L2"); 201 gk20a_dbg_info("initialize gk20a L2");
202 202
203 g->max_ltc_count = g->ltc_count = 1; 203 g->max_ltc_count = g->ltc_count = 1;
204} 204}
205 205
206static void gk20a_ltc_isr(struct gk20a *g) 206void gk20a_ltc_isr(struct gk20a *g)
207{ 207{
208 u32 intr; 208 u32 intr;
209 209
@@ -212,7 +212,7 @@ static void gk20a_ltc_isr(struct gk20a *g)
212 gk20a_writel(g, ltc_ltc0_ltss_intr_r(), intr); 212 gk20a_writel(g, ltc_ltc0_ltss_intr_r(), intr);
213} 213}
214 214
215static int gk20a_determine_L2_size_bytes(struct gk20a *g) 215int gk20a_determine_L2_size_bytes(struct gk20a *g)
216{ 216{
217 u32 lts_per_ltc; 217 u32 lts_per_ltc;
218 u32 ways; 218 u32 ways;
@@ -256,7 +256,7 @@ static int gk20a_determine_L2_size_bytes(struct gk20a *g)
256/* 256/*
257 * Sets the ZBC color for the passed index. 257 * Sets the ZBC color for the passed index.
258 */ 258 */
259static void gk20a_ltc_set_zbc_color_entry(struct gk20a *g, 259void gk20a_ltc_set_zbc_color_entry(struct gk20a *g,
260 struct zbc_entry *color_val, 260 struct zbc_entry *color_val,
261 u32 index) 261 u32 index)
262{ 262{
@@ -277,7 +277,7 @@ static void gk20a_ltc_set_zbc_color_entry(struct gk20a *g,
277/* 277/*
278 * Sets the ZBC depth for the passed index. 278 * Sets the ZBC depth for the passed index.
279 */ 279 */
280static void gk20a_ltc_set_zbc_depth_entry(struct gk20a *g, 280void gk20a_ltc_set_zbc_depth_entry(struct gk20a *g,
281 struct zbc_entry *depth_val, 281 struct zbc_entry *depth_val,
282 u32 index) 282 u32 index)
283{ 283{
@@ -292,7 +292,7 @@ static void gk20a_ltc_set_zbc_depth_entry(struct gk20a *g,
292 gk20a_readl(g, ltc_ltcs_ltss_dstg_zbc_index_r()); 292 gk20a_readl(g, ltc_ltcs_ltss_dstg_zbc_index_r());
293} 293}
294 294
295static void gk20a_ltc_init_cbc(struct gk20a *g, struct gr_gk20a *gr) 295void gk20a_ltc_init_cbc(struct gk20a *g, struct gr_gk20a *gr)
296{ 296{
297 u32 max_size = gr->max_comptag_mem; 297 u32 max_size = gr->max_comptag_mem;
298 u32 max_comptag_lines = max_size << 3; 298 u32 max_comptag_lines = max_size << 3;
@@ -342,7 +342,7 @@ static void gk20a_ltc_init_cbc(struct gk20a *g, struct gr_gk20a *gr)
342} 342}
343 343
344#ifdef CONFIG_DEBUG_FS 344#ifdef CONFIG_DEBUG_FS
345static void gk20a_ltc_sync_debugfs(struct gk20a *g) 345void gk20a_ltc_sync_debugfs(struct gk20a *g)
346{ 346{
347 u32 reg_f = ltc_ltcs_ltss_tstg_set_mgmt_2_l2_bypass_mode_enabled_f(); 347 u32 reg_f = ltc_ltcs_ltss_tstg_set_mgmt_2_l2_bypass_mode_enabled_f();
348 348
@@ -363,18 +363,3 @@ static void gk20a_ltc_sync_debugfs(struct gk20a *g)
363 nvgpu_spinlock_release(&g->debugfs_lock); 363 nvgpu_spinlock_release(&g->debugfs_lock);
364} 364}
365#endif 365#endif
366
367void gk20a_init_ltc(struct gpu_ops *gops)
368{
369 gops->ltc.determine_L2_size_bytes = gk20a_determine_L2_size_bytes;
370 gops->ltc.init_comptags = gk20a_ltc_init_comptags;
371 gops->ltc.cbc_ctrl = gk20a_ltc_cbc_ctrl;
372 gops->ltc.set_zbc_color_entry = gk20a_ltc_set_zbc_color_entry;
373 gops->ltc.set_zbc_depth_entry = gk20a_ltc_set_zbc_depth_entry;
374 gops->ltc.init_cbc = gk20a_ltc_init_cbc;
375#ifdef CONFIG_DEBUG_FS
376 gops->ltc.sync_debugfs = gk20a_ltc_sync_debugfs;
377#endif
378 gops->ltc.init_fs_state = gk20a_ltc_init_fs_state;
379 gops->ltc.isr = gk20a_ltc_isr;
380}