summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gp10b/ltc_gp10b.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/nvgpu/gp10b/ltc_gp10b.c')
-rw-r--r--drivers/gpu/nvgpu/gp10b/ltc_gp10b.c35
1 files changed, 29 insertions, 6 deletions
diff --git a/drivers/gpu/nvgpu/gp10b/ltc_gp10b.c b/drivers/gpu/nvgpu/gp10b/ltc_gp10b.c
index b3026059..d94e56ce 100644
--- a/drivers/gpu/nvgpu/gp10b/ltc_gp10b.c
+++ b/drivers/gpu/nvgpu/gp10b/ltc_gp10b.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * GP10B L2 2 * GP10B L2
3 * 3 *
4 * Copyright (c) 2014-2016, NVIDIA CORPORATION. All rights reserved. 4 * Copyright (c) 2014-2017, NVIDIA CORPORATION. All rights reserved.
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify it 6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms and conditions of the GNU General Public License, 7 * under the terms and conditions of the GNU General Public License,
@@ -24,7 +24,7 @@
24#include <nvgpu/hw/gp10b/hw_mc_gp10b.h> 24#include <nvgpu/hw/gp10b/hw_mc_gp10b.h>
25#include <nvgpu/hw/gp10b/hw_ltc_gp10b.h> 25#include <nvgpu/hw/gp10b/hw_ltc_gp10b.h>
26 26
27#include "gk20a/ltc_common.c" 27#include "gk20a/ltc_gk20a.h"
28#include "ltc_gp10b.h" 28#include "ltc_gp10b.h"
29 29
30static int gp10b_determine_L2_size_bytes(struct gk20a *g) 30static int gp10b_determine_L2_size_bytes(struct gk20a *g)
@@ -205,12 +205,35 @@ static void gp10b_ltc_init_fs_state(struct gk20a *g)
205 ltc_intr); 205 ltc_intr);
206} 206}
207 207
208#ifdef CONFIG_DEBUG_FS
209static void gp10b_ltc_sync_debugfs(struct gk20a *g)
210{
211 u32 reg_f = ltc_ltcs_ltss_tstg_set_mgmt_2_l2_bypass_mode_enabled_f();
212
213 nvgpu_spinlock_acquire(&g->debugfs_lock);
214 if (g->mm.ltc_enabled != g->mm.ltc_enabled_debug) {
215 u32 reg = gk20a_readl(g, ltc_ltcs_ltss_tstg_set_mgmt_2_r());
216
217 if (g->mm.ltc_enabled_debug)
218 /* bypass disabled (normal caching ops)*/
219 reg &= ~reg_f;
220 else
221 /* bypass enabled (no caching) */
222 reg |= reg_f;
223
224 gk20a_writel(g, ltc_ltcs_ltss_tstg_set_mgmt_2_r(), reg);
225 g->mm.ltc_enabled = g->mm.ltc_enabled_debug;
226 }
227 nvgpu_spinlock_release(&g->debugfs_lock);
228}
229#endif
230
208void gp10b_init_ltc(struct gpu_ops *gops) 231void gp10b_init_ltc(struct gpu_ops *gops)
209{ 232{
210 gops->ltc.determine_L2_size_bytes = gp10b_determine_L2_size_bytes; 233 gops->ltc.determine_L2_size_bytes = gp10b_determine_L2_size_bytes;
211 gops->ltc.set_zbc_color_entry = gk20a_ltc_set_zbc_color_entry; 234 gops->ltc.set_zbc_color_entry = gm20b_ltc_set_zbc_color_entry;
212 gops->ltc.set_zbc_depth_entry = gk20a_ltc_set_zbc_depth_entry; 235 gops->ltc.set_zbc_depth_entry = gm20b_ltc_set_zbc_depth_entry;
213 gops->ltc.init_cbc = gk20a_ltc_init_cbc; 236 gops->ltc.init_cbc = gm20b_ltc_init_cbc;
214 237
215 /* GM20b specific ops. */ 238 /* GM20b specific ops. */
216 gops->ltc.init_fs_state = gp10b_ltc_init_fs_state; 239 gops->ltc.init_fs_state = gp10b_ltc_init_fs_state;
@@ -220,6 +243,6 @@ void gp10b_init_ltc(struct gpu_ops *gops)
220 gops->ltc.cbc_fix_config = gm20b_ltc_cbc_fix_config; 243 gops->ltc.cbc_fix_config = gm20b_ltc_cbc_fix_config;
221 gops->ltc.flush = gm20b_flush_ltc; 244 gops->ltc.flush = gm20b_flush_ltc;
222#ifdef CONFIG_DEBUG_FS 245#ifdef CONFIG_DEBUG_FS
223 gops->ltc.sync_debugfs = gk20a_ltc_sync_debugfs; 246 gops->ltc.sync_debugfs = gp10b_ltc_sync_debugfs;
224#endif 247#endif
225} 248}