From 36c07aaf5da4d0e739c5143ed00d4ca8a2263ce1 Mon Sep 17 00:00:00 2001 From: Sunny He Date: Fri, 11 Aug 2017 14:43:28 -0700 Subject: Revert "gpu: nvgpu: Reorg fb HAL initialization" Conflicts with gv100 changes This reverts commit 63b74d4b768e0c96367d4983fdd8f1db1d317d01. Change-Id: I5e6a1c93ff613daaa100dee436f4941af74f0ac4 Signed-off-by: Sunny He Reviewed-on: https://git-master.nvidia.com/r/1537671 Reviewed-by: Shu Zhong Tested-by: Shu Zhong --- drivers/gpu/nvgpu/gp10b/fb_gp10b.c | 18 ++++++++++++++---- drivers/gpu/nvgpu/gp10b/fb_gp10b.h | 10 +++------- drivers/gpu/nvgpu/gp10b/hal_gp10b.c | 22 +--------------------- 3 files changed, 18 insertions(+), 32 deletions(-) (limited to 'drivers/gpu/nvgpu/gp10b') diff --git a/drivers/gpu/nvgpu/gp10b/fb_gp10b.c b/drivers/gpu/nvgpu/gp10b/fb_gp10b.c index 775dc5c9..8ba9ff8e 100644 --- a/drivers/gpu/nvgpu/gp10b/fb_gp10b.c +++ b/drivers/gpu/nvgpu/gp10b/fb_gp10b.c @@ -20,7 +20,7 @@ #include -noinline_for_stack void gp10b_init_uncompressed_kind_map(void) +static noinline_for_stack void gp10b_init_uncompressed_kind_map(void) { int i; @@ -438,7 +438,7 @@ static noinline_for_stack bool gp10b_kind_zbc(u8 k) k <= gmmu_pte_kind_c128_ms8_ms16_2cr_v()); } -void gp10b_init_kind_attr(void) +static void gp10b_init_kind_attr(void) { u16 k; @@ -456,12 +456,22 @@ void gp10b_init_kind_attr(void) } } -unsigned int gp10b_fb_compression_page_size(struct gk20a *g) +static unsigned int gp10b_fb_compression_page_size(struct gk20a *g) { return SZ_64K; } -unsigned int gp10b_fb_compressible_page_size(struct gk20a *g) +static unsigned int gp10b_fb_compressible_page_size(struct gk20a *g) { return SZ_4K; } + +void gp10b_init_fb(struct gpu_ops *gops) +{ + gm20b_init_fb(gops); + gops->fb.compression_page_size = gp10b_fb_compression_page_size; + gops->fb.compressible_page_size = gp10b_fb_compressible_page_size; + + gp10b_init_uncompressed_kind_map(); + gp10b_init_kind_attr(); +} diff --git a/drivers/gpu/nvgpu/gp10b/fb_gp10b.h b/drivers/gpu/nvgpu/gp10b/fb_gp10b.h index 626cf54d..76efd331 100644 --- a/drivers/gpu/nvgpu/gp10b/fb_gp10b.h +++ b/drivers/gpu/nvgpu/gp10b/fb_gp10b.h @@ -1,7 +1,7 @@ /* * GP10B FB * - * Copyright (c) 2014-2017, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2014, NVIDIA CORPORATION. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, @@ -15,11 +15,7 @@ #ifndef _NVGPU_GP10B_FB #define _NVGPU_GP10B_FB -struct gk20a; - -noinline_for_stack void gp10b_init_uncompressed_kind_map(void); -void gp10b_init_kind_attr(void); -unsigned int gp10b_fb_compression_page_size(struct gk20a *g); -unsigned int gp10b_fb_compressible_page_size(struct gk20a *g); +struct gpu_ops; +void gp10b_init_fb(struct gpu_ops *gops); #endif diff --git a/drivers/gpu/nvgpu/gp10b/hal_gp10b.c b/drivers/gpu/nvgpu/gp10b/hal_gp10b.c index b0871155..197c4fad 100644 --- a/drivers/gpu/nvgpu/gp10b/hal_gp10b.c +++ b/drivers/gpu/nvgpu/gp10b/hal_gp10b.c @@ -24,7 +24,6 @@ #include "gk20a/flcn_gk20a.h" #include "gk20a/regops_gk20a.h" #include "gk20a/mc_gk20a.h" -#include "gk20a/fb_gk20a.h" #include "gp10b/gr_gp10b.h" #include "gp10b/fecs_trace_gp10b.h" @@ -48,7 +47,6 @@ #include "gm20b/pmu_gm20b.h" #include "gm20b/clk_gm20b.h" #include "gm20b/fifo_gm20b.h" -#include "gm20b/fb_gm20b.h" #include "gp10b.h" #include "hal_gp10b.h" @@ -172,21 +170,6 @@ static const struct gpu_ops gp10b_ops = { .isr_stall = gp10b_ce_isr, .isr_nonstall = gp10b_ce_nonstall_isr, }, - .fb = { - .reset = fb_gk20a_reset, - .init_hw = gk20a_fb_init_hw, - .init_fs_state = fb_gm20b_init_fs_state, - .set_mmu_page_size = gm20b_fb_set_mmu_page_size, - .set_use_full_comp_tag_line = - gm20b_fb_set_use_full_comp_tag_line, - .compression_page_size = gp10b_fb_compression_page_size, - .compressible_page_size = gp10b_fb_compressible_page_size, - .vpr_info_fetch = gm20b_fb_vpr_info_fetch, - .dump_vpr_wpr_info = gm20b_fb_dump_vpr_wpr_info, - .is_debug_mode_enabled = gm20b_fb_debug_mode_enabled, - .set_debug_mode = gm20b_fb_set_debug_mode, - .tlb_invalidate = gk20a_fb_tlb_invalidate, - }, .clock_gating = { .slcg_bus_load_gating_prod = gp10b_slcg_bus_load_gating_prod, @@ -422,7 +405,6 @@ int gp10b_init_hal(struct gk20a *g) gops->ltc = gp10b_ops.ltc; gops->ce2 = gp10b_ops.ce2; - gops->fb = gp10b_ops.fb; gops->clock_gating = gp10b_ops.clock_gating; gops->fifo = gp10b_ops.fifo; gops->gr_ctx = gp10b_ops.gr_ctx; @@ -489,12 +471,10 @@ int gp10b_init_hal(struct gk20a *g) g->bootstrap_owner = LSF_BOOTSTRAP_OWNER_DEFAULT; gp10b_init_gr(g); + gp10b_init_fb(gops); gp10b_init_mm(gops); gp10b_init_pmu_ops(g); - gp10b_init_uncompressed_kind_map(); - gp10b_init_kind_attr(); - g->name = "gp10b"; c->twod_class = FERMI_TWOD_A; -- cgit v1.2.2