summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gm20b/ltc_gm20b.c
diff options
context:
space:
mode:
authorSunny He <suhe@nvidia.com>2017-06-22 19:43:51 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2017-06-27 13:44:11 -0400
commit0dc80244eea4c7e504976d8028a3ddb72ba60b0e (patch)
tree99e87c3d5cab98a4593a7bb0fe2737d72ccfb805 /drivers/gpu/nvgpu/gm20b/ltc_gm20b.c
parent773df3f5e9fdda028ade319990d1b672ce68592f (diff)
gpu: nvgpu: Reorganize ltc HAL initialization
Reorganize HAL initialization to remove inheritance and construct the gpu_ops struct at compile time. This patch only covers the ltc sub-module of the gpu_ops struct. Perform HAL function assignments in hal_gxxxx.c through the population of a chip-specific copy of gpu_ops. Jira NVGPU-74 Change-Id: I1110e301e57b502cf7f97e6739424cb33cc52a69 Signed-off-by: Sunny He <suhe@nvidia.com> Reviewed-on: https://git-master/r/1507564 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gm20b/ltc_gm20b.c')
-rw-r--r--drivers/gpu/nvgpu/gm20b/ltc_gm20b.c26
1 files changed, 3 insertions, 23 deletions
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}