summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gm20b
diff options
context:
space:
mode:
authorSunny He <suhe@nvidia.com>2017-08-11 17:43:28 -0400
committerShu Zhong <shuz@nvidia.com>2017-08-11 17:57:26 -0400
commit36c07aaf5da4d0e739c5143ed00d4ca8a2263ce1 (patch)
tree2ed7e74b2ff0b3f8dc040e981f495d18f10cab4c /drivers/gpu/nvgpu/gm20b
parentf8399cfa553b6fb6d82c7fa762c372f03bf59d5f (diff)
Revert "gpu: nvgpu: Reorg fb HAL initialization"
Conflicts with gv100 changes This reverts commit 63b74d4b768e0c96367d4983fdd8f1db1d317d01. Change-Id: I5e6a1c93ff613daaa100dee436f4941af74f0ac4 Signed-off-by: Sunny He <suhe@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1537671 Reviewed-by: Shu Zhong <shuz@nvidia.com> Tested-by: Shu Zhong <shuz@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gm20b')
-rw-r--r--drivers/gpu/nvgpu/gm20b/fb_gm20b.c36
-rw-r--r--drivers/gpu/nvgpu/gm20b/fb_gm20b.h13
-rw-r--r--drivers/gpu/nvgpu/gm20b/hal_gm20b.c21
3 files changed, 30 insertions, 40 deletions
diff --git a/drivers/gpu/nvgpu/gm20b/fb_gm20b.c b/drivers/gpu/nvgpu/gm20b/fb_gm20b.c
index 31947ad0..47b4313b 100644
--- a/drivers/gpu/nvgpu/gm20b/fb_gm20b.c
+++ b/drivers/gpu/nvgpu/gm20b/fb_gm20b.c
@@ -25,7 +25,7 @@
25 25
26#define VPR_INFO_FETCH_WAIT (5) 26#define VPR_INFO_FETCH_WAIT (5)
27 27
28void fb_gm20b_init_fs_state(struct gk20a *g) 28static void fb_gm20b_init_fs_state(struct gk20a *g)
29{ 29{
30 gk20a_dbg_info("initialize gm20b fb"); 30 gk20a_dbg_info("initialize gm20b fb");
31 31
@@ -434,7 +434,7 @@ void gm20b_init_kind_attr(void)
434 } 434 }
435} 435}
436 436
437void gm20b_fb_set_mmu_page_size(struct gk20a *g) 437static void gm20b_fb_set_mmu_page_size(struct gk20a *g)
438{ 438{
439 /* set large page size in fb */ 439 /* set large page size in fb */
440 u32 fb_mmu_ctrl = gk20a_readl(g, fb_mmu_ctrl_r()); 440 u32 fb_mmu_ctrl = gk20a_readl(g, fb_mmu_ctrl_r());
@@ -442,7 +442,7 @@ void gm20b_fb_set_mmu_page_size(struct gk20a *g)
442 gk20a_writel(g, fb_mmu_ctrl_r(), fb_mmu_ctrl); 442 gk20a_writel(g, fb_mmu_ctrl_r(), fb_mmu_ctrl);
443} 443}
444 444
445bool gm20b_fb_set_use_full_comp_tag_line(struct gk20a *g) 445static bool gm20b_fb_set_use_full_comp_tag_line(struct gk20a *g)
446{ 446{
447 /* set large page size in fb */ 447 /* set large page size in fb */
448 u32 fb_mmu_ctrl = gk20a_readl(g, fb_mmu_ctrl_r()); 448 u32 fb_mmu_ctrl = gk20a_readl(g, fb_mmu_ctrl_r());
@@ -452,17 +452,17 @@ bool gm20b_fb_set_use_full_comp_tag_line(struct gk20a *g)
452 return true; 452 return true;
453} 453}
454 454
455unsigned int gm20b_fb_compression_page_size(struct gk20a *g) 455static unsigned int gm20b_fb_compression_page_size(struct gk20a *g)
456{ 456{
457 return SZ_128K; 457 return SZ_128K;
458} 458}
459 459
460unsigned int gm20b_fb_compressible_page_size(struct gk20a *g) 460static unsigned int gm20b_fb_compressible_page_size(struct gk20a *g)
461{ 461{
462 return SZ_64K; 462 return SZ_64K;
463} 463}
464 464
465void gm20b_fb_dump_vpr_wpr_info(struct gk20a *g) 465static void gm20b_fb_dump_vpr_wpr_info(struct gk20a *g)
466{ 466{
467 u32 val; 467 u32 val;
468 468
@@ -511,7 +511,7 @@ static int gm20b_fb_vpr_info_fetch_wait(struct gk20a *g,
511 return -ETIMEDOUT; 511 return -ETIMEDOUT;
512} 512}
513 513
514int gm20b_fb_vpr_info_fetch(struct gk20a *g) 514static int gm20b_fb_vpr_info_fetch(struct gk20a *g)
515{ 515{
516 if (gm20b_fb_vpr_info_fetch_wait(g, VPR_INFO_FETCH_WAIT)) { 516 if (gm20b_fb_vpr_info_fetch_wait(g, VPR_INFO_FETCH_WAIT)) {
517 return -ETIME; 517 return -ETIME;
@@ -523,14 +523,14 @@ int gm20b_fb_vpr_info_fetch(struct gk20a *g)
523 return gm20b_fb_vpr_info_fetch_wait(g, VPR_INFO_FETCH_WAIT); 523 return gm20b_fb_vpr_info_fetch_wait(g, VPR_INFO_FETCH_WAIT);
524} 524}
525 525
526bool gm20b_fb_debug_mode_enabled(struct gk20a *g) 526static bool gm20b_fb_debug_mode_enabled(struct gk20a *g)
527{ 527{
528 u32 debug_ctrl = gk20a_readl(g, gr_gpcs_pri_mmu_debug_ctrl_r()); 528 u32 debug_ctrl = gk20a_readl(g, gr_gpcs_pri_mmu_debug_ctrl_r());
529 return gr_gpcs_pri_mmu_debug_ctrl_debug_v(debug_ctrl) == 529 return gr_gpcs_pri_mmu_debug_ctrl_debug_v(debug_ctrl) ==
530 gr_gpcs_pri_mmu_debug_ctrl_debug_enabled_v(); 530 gr_gpcs_pri_mmu_debug_ctrl_debug_enabled_v();
531} 531}
532 532
533void gm20b_fb_set_debug_mode(struct gk20a *g, bool enable) 533static void gm20b_fb_set_debug_mode(struct gk20a *g, bool enable)
534{ 534{
535 u32 reg_val, fb_debug_ctrl, gpc_debug_ctrl; 535 u32 reg_val, fb_debug_ctrl, gpc_debug_ctrl;
536 536
@@ -554,3 +554,21 @@ void gm20b_fb_set_debug_mode(struct gk20a *g, bool enable)
554 gr_gpcs_pri_mmu_debug_ctrl_debug_m(), gpc_debug_ctrl); 554 gr_gpcs_pri_mmu_debug_ctrl_debug_m(), gpc_debug_ctrl);
555 gk20a_writel(g, gr_gpcs_pri_mmu_debug_ctrl_r(), reg_val); 555 gk20a_writel(g, gr_gpcs_pri_mmu_debug_ctrl_r(), reg_val);
556} 556}
557
558void gm20b_init_fb(struct gpu_ops *gops)
559{
560 gops->fb.reset = fb_gk20a_reset;
561 gops->fb.init_hw = gk20a_fb_init_hw;
562 gops->fb.init_fs_state = fb_gm20b_init_fs_state;
563 gops->fb.set_mmu_page_size = gm20b_fb_set_mmu_page_size;
564 gops->fb.set_use_full_comp_tag_line = gm20b_fb_set_use_full_comp_tag_line;
565 gops->fb.compression_page_size = gm20b_fb_compression_page_size;
566 gops->fb.compressible_page_size = gm20b_fb_compressible_page_size;
567 gops->fb.vpr_info_fetch = gm20b_fb_vpr_info_fetch;
568 gops->fb.dump_vpr_wpr_info = gm20b_fb_dump_vpr_wpr_info;
569 gops->fb.is_debug_mode_enabled = gm20b_fb_debug_mode_enabled;
570 gops->fb.set_debug_mode = gm20b_fb_set_debug_mode;
571 gops->fb.tlb_invalidate = gk20a_fb_tlb_invalidate;
572 gm20b_init_uncompressed_kind_map();
573 gm20b_init_kind_attr();
574}
diff --git a/drivers/gpu/nvgpu/gm20b/fb_gm20b.h b/drivers/gpu/nvgpu/gm20b/fb_gm20b.h
index 42e86407..22b848d6 100644
--- a/drivers/gpu/nvgpu/gm20b/fb_gm20b.h
+++ b/drivers/gpu/nvgpu/gm20b/fb_gm20b.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * GM20B FB 2 * GM20B FB
3 * 3 *
4 * Copyright (c) 2014-2017, NVIDIA CORPORATION. All rights reserved. 4 * Copyright (c) 2014, 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,
@@ -17,16 +17,7 @@
17#define _NVHOST_GM20B_FB 17#define _NVHOST_GM20B_FB
18struct gk20a; 18struct gk20a;
19 19
20void fb_gm20b_init_fs_state(struct gk20a *g); 20void gm20b_init_fb(struct gpu_ops *gops);
21void gm20b_fb_set_mmu_page_size(struct gk20a *g);
22bool gm20b_fb_set_use_full_comp_tag_line(struct gk20a *g);
23unsigned int gm20b_fb_compression_page_size(struct gk20a *g);
24unsigned int gm20b_fb_compressible_page_size(struct gk20a *g);
25void gm20b_fb_dump_vpr_wpr_info(struct gk20a *g);
26int gm20b_fb_vpr_info_fetch(struct gk20a *g);
27bool gm20b_fb_debug_mode_enabled(struct gk20a *g);
28void gm20b_fb_set_debug_mode(struct gk20a *g, bool enable);
29
30void gm20b_init_uncompressed_kind_map(void); 21void gm20b_init_uncompressed_kind_map(void);
31void gm20b_init_kind_attr(void); 22void gm20b_init_kind_attr(void);
32#endif 23#endif
diff --git a/drivers/gpu/nvgpu/gm20b/hal_gm20b.c b/drivers/gpu/nvgpu/gm20b/hal_gm20b.c
index a540de64..7861e438 100644
--- a/drivers/gpu/nvgpu/gm20b/hal_gm20b.c
+++ b/drivers/gpu/nvgpu/gm20b/hal_gm20b.c
@@ -16,7 +16,6 @@
16#include "gk20a/gk20a.h" 16#include "gk20a/gk20a.h"
17#include "gk20a/ce2_gk20a.h" 17#include "gk20a/ce2_gk20a.h"
18#include "gk20a/dbg_gpu_gk20a.h" 18#include "gk20a/dbg_gpu_gk20a.h"
19#include "gk20a/fb_gk20a.h"
20#include "gk20a/fifo_gk20a.h" 19#include "gk20a/fifo_gk20a.h"
21#include "gk20a/therm_gk20a.h" 20#include "gk20a/therm_gk20a.h"
22#include "gk20a/css_gr_gk20a.h" 21#include "gk20a/css_gr_gk20a.h"
@@ -162,21 +161,6 @@ static const struct gpu_ops gm20b_ops = {
162 .isr_stall = gk20a_ce2_isr, 161 .isr_stall = gk20a_ce2_isr,
163 .isr_nonstall = gk20a_ce2_nonstall_isr, 162 .isr_nonstall = gk20a_ce2_nonstall_isr,
164 }, 163 },
165 .fb = {
166 .reset = fb_gk20a_reset,
167 .init_hw = gk20a_fb_init_hw,
168 .init_fs_state = fb_gm20b_init_fs_state,
169 .set_mmu_page_size = gm20b_fb_set_mmu_page_size,
170 .set_use_full_comp_tag_line =
171 gm20b_fb_set_use_full_comp_tag_line,
172 .compression_page_size = gm20b_fb_compression_page_size,
173 .compressible_page_size = gm20b_fb_compressible_page_size,
174 .vpr_info_fetch = gm20b_fb_vpr_info_fetch,
175 .dump_vpr_wpr_info = gm20b_fb_dump_vpr_wpr_info,
176 .is_debug_mode_enabled = gm20b_fb_debug_mode_enabled,
177 .set_debug_mode = gm20b_fb_set_debug_mode,
178 .tlb_invalidate = gk20a_fb_tlb_invalidate,
179 },
180 .clock_gating = { 164 .clock_gating = {
181 .slcg_bus_load_gating_prod = 165 .slcg_bus_load_gating_prod =
182 gm20b_slcg_bus_load_gating_prod, 166 gm20b_slcg_bus_load_gating_prod,
@@ -394,7 +378,6 @@ int gm20b_init_hal(struct gk20a *g)
394 378
395 gops->ltc = gm20b_ops.ltc; 379 gops->ltc = gm20b_ops.ltc;
396 gops->ce2 = gm20b_ops.ce2; 380 gops->ce2 = gm20b_ops.ce2;
397 gops->fb = gm20b_ops.fb;
398 gops->clock_gating = gm20b_ops.clock_gating; 381 gops->clock_gating = gm20b_ops.clock_gating;
399 gops->fifo = gm20b_ops.fifo; 382 gops->fifo = gm20b_ops.fifo;
400 gops->gr_ctx = gm20b_ops.gr_ctx; 383 gops->gr_ctx = gm20b_ops.gr_ctx;
@@ -462,12 +445,10 @@ int gm20b_init_hal(struct gk20a *g)
462#endif 445#endif
463 g->bootstrap_owner = LSF_BOOTSTRAP_OWNER_DEFAULT; 446 g->bootstrap_owner = LSF_BOOTSTRAP_OWNER_DEFAULT;
464 gm20b_init_gr(g); 447 gm20b_init_gr(g);
448 gm20b_init_fb(gops);
465 gm20b_init_mm(gops); 449 gm20b_init_mm(gops);
466 gm20b_init_pmu_ops(g); 450 gm20b_init_pmu_ops(g);
467 451
468 gm20b_init_uncompressed_kind_map();
469 gm20b_init_kind_attr();
470
471 g->name = "gm20b"; 452 g->name = "gm20b";
472 453
473 c->twod_class = FERMI_TWOD_A; 454 c->twod_class = FERMI_TWOD_A;