summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gv11b/fb_gv11b.c
diff options
context:
space:
mode:
authorSunny He <suhe@nvidia.com>2017-07-31 17:40:46 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2017-08-11 17:16:53 -0400
commitda8e67f042760d54f3d6b5f84abbd9981d9fcd54 (patch)
treefc8cffa187e14649b474a73ff23e3bb801319e61 /drivers/gpu/nvgpu/gv11b/fb_gv11b.c
parent2660d1d881d1536c1b723d9737ae9a04321d69f3 (diff)
gpu: nvgpu: gv11b: Reorg fb HAL initialization
Reorganize HAL initialization to remove inheritance and construct the gpu_ops struct at compile time. This patch only covers the fb 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: I896d90e0dcffc0e133e6902ff9c3eab39c53080d Signed-off-by: Sunny He <suhe@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1533354 Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com> Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gv11b/fb_gv11b.c')
-rw-r--r--drivers/gpu/nvgpu/gv11b/fb_gv11b.c25
1 files changed, 6 insertions, 19 deletions
diff --git a/drivers/gpu/nvgpu/gv11b/fb_gv11b.c b/drivers/gpu/nvgpu/gv11b/fb_gv11b.c
index 35227576..384dfb20 100644
--- a/drivers/gpu/nvgpu/gv11b/fb_gv11b.c
+++ b/drivers/gpu/nvgpu/gv11b/fb_gv11b.c
@@ -75,7 +75,7 @@ static void gv11b_init_nvlink_soc_credits(struct gk20a *g)
75 75
76} 76}
77 77
78static void gv11b_fb_init_fs_state(struct gk20a *g) 78void gv11b_fb_init_fs_state(struct gk20a *g)
79{ 79{
80 nvgpu_log(g, gpu_dbg_fn, "initialize gv11b fb"); 80 nvgpu_log(g, gpu_dbg_fn, "initialize gv11b fb");
81 81
@@ -87,7 +87,7 @@ static void gv11b_fb_init_fs_state(struct gk20a *g)
87 gk20a_readl(g, fb_mmu_num_active_ltcs_r()))); 87 gk20a_readl(g, fb_mmu_num_active_ltcs_r())));
88} 88}
89 89
90static void gv11b_fb_init_cbc(struct gk20a *g, struct gr_gk20a *gr) 90void gv11b_fb_init_cbc(struct gk20a *g, struct gr_gk20a *gr)
91{ 91{
92 u32 max_size = gr->max_comptag_mem; 92 u32 max_size = gr->max_comptag_mem;
93 /* one tag line covers 64KB */ 93 /* one tag line covers 64KB */
@@ -137,7 +137,7 @@ static void gv11b_fb_init_cbc(struct gk20a *g, struct gr_gk20a *gr)
137 137
138} 138}
139 139
140static void gv11b_fb_reset(struct gk20a *g) 140void gv11b_fb_reset(struct gk20a *g)
141{ 141{
142 u32 val; 142 u32 val;
143 143
@@ -251,7 +251,7 @@ static const char *const gpc_client_descs_gv11b[] = {
251 "t1 36", "t1 37", "t1 38", "t1 39", 251 "t1 36", "t1 37", "t1 38", "t1 39",
252}; 252};
253 253
254static noinline_for_stack void gv11b_init_uncompressed_kind_map(void) 254noinline_for_stack void gv11b_init_uncompressed_kind_map(void)
255{ 255{
256 int i; 256 int i;
257 257
@@ -672,7 +672,7 @@ static noinline_for_stack bool gv11b_kind_zbc(u8 k)
672 k <= gmmu_pte_kind_c128_ms8_ms16_2cr_v()); 672 k <= gmmu_pte_kind_c128_ms8_ms16_2cr_v());
673} 673}
674 674
675static void gv11b_init_kind_attr(void) 675void gv11b_init_kind_attr(void)
676{ 676{
677 u16 k; 677 u16 k;
678 678
@@ -1815,7 +1815,7 @@ static void gv11b_fb_handle_mmu_fault(struct gk20a *g, u32 niso_intr)
1815 fb_mmu_fault_status_valid_clear_f()); 1815 fb_mmu_fault_status_valid_clear_f());
1816} 1816}
1817 1817
1818static void gv11b_fb_hub_isr(struct gk20a *g) 1818void gv11b_fb_hub_isr(struct gk20a *g)
1819{ 1819{
1820 u32 status, niso_intr; 1820 u32 status, niso_intr;
1821 1821
@@ -1967,16 +1967,3 @@ static int gv11b_fb_fix_page_fault(struct gk20a *g,
1967 pte[1], pte[0]); 1967 pte[1], pte[0]);
1968 return err; 1968 return err;
1969} 1969}
1970
1971void gv11b_init_fb(struct gpu_ops *gops)
1972{
1973 gp10b_init_fb(gops);
1974 gops->fb.hub_isr = gv11b_fb_hub_isr;
1975 gops->fb.reset = gv11b_fb_reset;
1976 gops->fb.init_fs_state = gv11b_fb_init_fs_state;
1977 gops->fb.init_cbc = gv11b_fb_init_cbc;
1978
1979 gv11b_init_uncompressed_kind_map();
1980 gv11b_init_kind_attr();
1981
1982}