diff --git a/drivers/gpu/nvgpu/common/acr/acr_blob_construct_v0.c b/drivers/gpu/nvgpu/common/acr/acr_blob_construct_v0.c index dfda2e681..0027d8d8f 100644 --- a/drivers/gpu/nvgpu/common/acr/acr_blob_construct_v0.c +++ b/drivers/gpu/nvgpu/common/acr/acr_blob_construct_v0.c @@ -27,6 +27,7 @@ #include #include #include +#include "common/gr/gr_priv.h" #include "acr_blob_construct_v0.h" #include "acr_falcon_bl.h" diff --git a/drivers/gpu/nvgpu/common/acr/acr_blob_construct_v1.c b/drivers/gpu/nvgpu/common/acr/acr_blob_construct_v1.c index 5a0eb14f5..0f7d5b68b 100644 --- a/drivers/gpu/nvgpu/common/acr/acr_blob_construct_v1.c +++ b/drivers/gpu/nvgpu/common/acr/acr_blob_construct_v1.c @@ -26,6 +26,7 @@ #include #include #include +#include "common/gr/gr_priv.h" #include "acr_blob_construct_v1.h" #include "acr_falcon_bl.h" diff --git a/drivers/gpu/nvgpu/common/ecc.c b/drivers/gpu/nvgpu/common/ecc.c index 8c885e71d..6dd41a467 100644 --- a/drivers/gpu/nvgpu/common/ecc.c +++ b/drivers/gpu/nvgpu/common/ecc.c @@ -25,6 +25,8 @@ #include #include +#include "common/gr/gr_priv.h" + static void nvgpu_ecc_stat_add(struct gk20a *g, struct nvgpu_ecc_stat *stat) { struct nvgpu_ecc *ecc = &g->ecc; diff --git a/drivers/gpu/nvgpu/common/fifo/channel.c b/drivers/gpu/nvgpu/common/fifo/channel.c index efad6ad66..7a8d73a77 100644 --- a/drivers/gpu/nvgpu/common/fifo/channel.c +++ b/drivers/gpu/nvgpu/common/fifo/channel.c @@ -52,6 +52,7 @@ #include #include +#include "common/gr/gr_priv.h" #include "gk20a/gr_gk20a.h" static void free_channel(struct fifo_gk20a *f, struct channel_gk20a *ch); diff --git a/drivers/gpu/nvgpu/common/fifo/tsg.c b/drivers/gpu/nvgpu/common/fifo/tsg.c index 654e14614..3cf87ad44 100644 --- a/drivers/gpu/nvgpu/common/fifo/tsg.c +++ b/drivers/gpu/nvgpu/common/fifo/tsg.c @@ -34,6 +34,8 @@ #include #include +#include "common/gr/gr_priv.h" + #include "gk20a/gr_gk20a.h" void nvgpu_tsg_disable(struct tsg_gk20a *tsg) diff --git a/drivers/gpu/nvgpu/common/gr/fecs_trace.c b/drivers/gpu/nvgpu/common/gr/fecs_trace.c index 094c8c733..03944b53c 100644 --- a/drivers/gpu/nvgpu/common/gr/fecs_trace.c +++ b/drivers/gpu/nvgpu/common/gr/fecs_trace.c @@ -33,6 +33,8 @@ #include #include +#include "common/gr/gr_priv.h" + #ifdef CONFIG_GK20A_CTXSW_TRACE static int nvgpu_gr_fecs_trace_periodic_polling(void *arg); diff --git a/drivers/gpu/nvgpu/common/gr/gr.c b/drivers/gpu/nvgpu/common/gr/gr.c index a2dfce2f7..9d6883090 100644 --- a/drivers/gpu/nvgpu/common/gr/gr.c +++ b/drivers/gpu/nvgpu/common/gr/gr.c @@ -36,6 +36,8 @@ #include #include +#include "gr_priv.h" + static int gr_alloc_global_ctx_buffers(struct gk20a *g) { struct nvgpu_gr *gr = g->gr; diff --git a/drivers/gpu/nvgpu/common/gr/gr_falcon.c b/drivers/gpu/nvgpu/common/gr/gr_falcon.c index 86aef7132..7a7118492 100644 --- a/drivers/gpu/nvgpu/common/gr/gr_falcon.c +++ b/drivers/gpu/nvgpu/common/gr/gr_falcon.c @@ -36,6 +36,7 @@ #include #include "gr_falcon_priv.h" +#include "common/gr/gr_priv.h" #define NVGPU_FECS_UCODE_IMAGE "fecs.bin" #define NVGPU_GPCCS_UCODE_IMAGE "gpccs.bin" diff --git a/drivers/gpu/nvgpu/common/gr/gr_intr.c b/drivers/gpu/nvgpu/common/gr/gr_intr.c index 2f5772eba..3248fa0ba 100644 --- a/drivers/gpu/nvgpu/common/gr/gr_intr.c +++ b/drivers/gpu/nvgpu/common/gr/gr_intr.c @@ -30,6 +30,7 @@ #include #include #include +#include "common/gr/gr_priv.h" static int gr_intr_handle_tpc_exception(struct gk20a *g, u32 gpc, u32 tpc, bool *post_event, struct channel_gk20a *fault_ch, diff --git a/drivers/gpu/nvgpu/common/gr/gr_priv.h b/drivers/gpu/nvgpu/common/gr/gr_priv.h new file mode 100644 index 000000000..7231f35b4 --- /dev/null +++ b/drivers/gpu/nvgpu/common/gr/gr_priv.h @@ -0,0 +1,105 @@ +/* + * Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +#ifndef NVGPU_GR_PRIV_H +#define NVGPU_GR_PRIV_H + +#include +#include + +struct nvgpu_gr_ctx_desc; +struct nvgpu_gr_global_ctx_buffer_desc; +struct nvgpu_gr_obj_ctx_golden_image; +struct nvgpu_gr_config; +struct nvgpu_gr_zbc; +struct nvgpu_gr_hwpm_map; +struct nvgpu_gr_zcull; +struct gk20a_cs_snapshot; + +struct gr_channel_map_tlb_entry { + u32 curr_ctx; + u32 chid; + u32 tsgid; +}; + +struct nvgpu_gr { + struct gk20a *g; + struct { + bool golden_image_initialized; + u32 golden_image_size; + + u32 pm_ctxsw_image_size; + + u32 preempt_image_size; + + u32 zcull_image_size; + } ctx_vars; + + struct nvgpu_mutex ctx_mutex; /* protect golden ctx init */ + + struct nvgpu_cond init_wq; + bool initialized; + + u32 num_fbps; + u32 max_fbps_count; + + struct nvgpu_gr_global_ctx_buffer_desc *global_ctx_buffer; + + struct nvgpu_gr_obj_ctx_golden_image *golden_image; + + struct nvgpu_gr_ctx_desc *gr_ctx_desc; + + struct nvgpu_gr_config *config; + + struct nvgpu_gr_hwpm_map *hwpm_map; + + struct nvgpu_gr_zcull *zcull; + + struct nvgpu_gr_zbc *zbc; + + struct nvgpu_gr_falcon *falcon; + +#define GR_CHANNEL_MAP_TLB_SIZE 2U /* must of power of 2 */ + struct gr_channel_map_tlb_entry chid_tlb[GR_CHANNEL_MAP_TLB_SIZE]; + u32 channel_tlb_flush_index; + struct nvgpu_spinlock ch_tlb_lock; + + void (*remove_support)(struct gk20a *g); + bool sw_ready; + + u32 fecs_feature_override_ecc_val; + + u32 cilp_preempt_pending_chid; + + u32 fbp_en_mask; + u32 *fbp_rop_l2_en_mask; + +#if defined(CONFIG_GK20A_CYCLE_STATS) + struct nvgpu_mutex cs_lock; + struct gk20a_cs_snapshot *cs_data; +#endif + u32 max_css_buffer_size; + u32 max_ctxsw_ring_buffer_size; +}; + +#endif /* NVGPU_GR_PRIV_H */ + diff --git a/drivers/gpu/nvgpu/common/gr/gr_setup.c b/drivers/gpu/nvgpu/common/gr/gr_setup.c index 362e73a46..86aa7c86e 100644 --- a/drivers/gpu/nvgpu/common/gr/gr_setup.c +++ b/drivers/gpu/nvgpu/common/gr/gr_setup.c @@ -29,6 +29,8 @@ #include #include +#include "gr_priv.h" + static int nvgpu_gr_setup_zcull(struct gk20a *g, struct channel_gk20a *c, struct nvgpu_gr_ctx *gr_ctx) { diff --git a/drivers/gpu/nvgpu/common/gr/hwpm_map.c b/drivers/gpu/nvgpu/common/gr/hwpm_map.c index dc3acff61..44f86d990 100644 --- a/drivers/gpu/nvgpu/common/gr/hwpm_map.c +++ b/drivers/gpu/nvgpu/common/gr/hwpm_map.c @@ -31,6 +31,7 @@ /* needed for pri_is_ppc_addr_shared */ #include "gk20a/gr_pri_gk20a.h" +#include "gr_priv.h" #define NV_PCFG_BASE 0x00088000U #define NV_PERF_PMM_FBP_ROUTER_STRIDE 0x0200U @@ -223,9 +224,10 @@ static int add_ctxsw_buffer_map_entries_subunits( static int add_ctxsw_buffer_map_entries_gpcs(struct gk20a *g, struct ctxsw_buf_offset_map_entry *map, - u32 *count, u32 *offset, u32 max_cnt) + u32 *count, u32 *offset, u32 max_cnt, + struct nvgpu_gr_config *config) { - u32 num_gpcs = nvgpu_gr_config_get_gpc_count(g->gr->config); + u32 num_gpcs = nvgpu_gr_config_get_gpc_count(config); u32 num_ppcs, num_tpcs, gpc_num, base; u32 gpc_base = nvgpu_get_litter_value(g, GPU_LIT_GPC_BASE); u32 gpc_stride = nvgpu_get_litter_value(g, GPU_LIT_GPC_STRIDE); @@ -235,7 +237,7 @@ static int add_ctxsw_buffer_map_entries_gpcs(struct gk20a *g, u32 tpc_in_gpc_stride = nvgpu_get_litter_value(g, GPU_LIT_TPC_IN_GPC_STRIDE); for (gpc_num = 0; gpc_num < num_gpcs; gpc_num++) { - num_tpcs = nvgpu_gr_config_get_gpc_tpc_count(g->gr->config, gpc_num); + num_tpcs = nvgpu_gr_config_get_gpc_tpc_count(config, gpc_num); base = gpc_base + (gpc_stride * gpc_num) + tpc_in_gpc_base; if (add_ctxsw_buffer_map_entries_subunits(map, nvgpu_netlist_get_pm_tpc_ctxsw_regs(g), @@ -245,7 +247,7 @@ static int add_ctxsw_buffer_map_entries_gpcs(struct gk20a *g, return -EINVAL; } - num_ppcs = nvgpu_gr_config_get_gpc_ppc_count(g->gr->config, gpc_num); + num_ppcs = nvgpu_gr_config_get_gpc_ppc_count(config, gpc_num); base = gpc_base + (gpc_stride * gpc_num) + ppc_in_gpc_base; if (add_ctxsw_buffer_map_entries_subunits(map, nvgpu_netlist_get_pm_ppc_ctxsw_regs(g), @@ -368,7 +370,7 @@ static int add_ctxsw_buffer_map_entries_gpcs(struct gk20a *g, */ static int nvgpu_gr_hwpm_map_create(struct gk20a *g, - struct nvgpu_gr_hwpm_map *hwpm_map) + struct nvgpu_gr_hwpm_map *hwpm_map, struct nvgpu_gr_config *config) { u32 hwpm_ctxsw_buffer_size = hwpm_map->pm_ctxsw_image_size; struct ctxsw_buf_offset_map_entry *map; @@ -485,7 +487,7 @@ static int nvgpu_gr_hwpm_map_create(struct gk20a *g, /* Add GPC entries */ if (add_ctxsw_buffer_map_entries_gpcs(g, map, &count, &offset, - hwpm_ctxsw_reg_count_max) != 0) { + hwpm_ctxsw_reg_count_max, config) != 0) { goto cleanup; } @@ -520,7 +522,7 @@ cleanup: */ int nvgpu_gr_hwmp_map_find_priv_offset(struct gk20a *g, struct nvgpu_gr_hwpm_map *hwpm_map, - u32 addr, u32 *priv_offset) + u32 addr, u32 *priv_offset, struct nvgpu_gr_config *config) { struct ctxsw_buf_offset_map_entry *map, *result, map_key; int err = 0; @@ -530,7 +532,7 @@ int nvgpu_gr_hwmp_map_find_priv_offset(struct gk20a *g, /* Create map of pri address and pm offset if necessary */ if (!hwpm_map->init) { - err = nvgpu_gr_hwpm_map_create(g, hwpm_map); + err = nvgpu_gr_hwpm_map_create(g, hwpm_map, config); if (err != 0) { return err; } diff --git a/drivers/gpu/nvgpu/common/gr/obj_ctx.c b/drivers/gpu/nvgpu/common/gr/obj_ctx.c index ed281afed..6eff895c9 100644 --- a/drivers/gpu/nvgpu/common/gr/obj_ctx.c +++ b/drivers/gpu/nvgpu/common/gr/obj_ctx.c @@ -35,6 +35,7 @@ #include #include "obj_ctx_priv.h" +#include "gr_priv.h" void nvgpu_gr_obj_ctx_commit_inst_gpu_va(struct gk20a *g, struct nvgpu_mem *inst_block, u64 gpu_va) diff --git a/drivers/gpu/nvgpu/common/perf/cyclestats_snapshot.c b/drivers/gpu/nvgpu/common/perf/cyclestats_snapshot.c index b6207ec26..d8a48f1b9 100644 --- a/drivers/gpu/nvgpu/common/perf/cyclestats_snapshot.c +++ b/drivers/gpu/nvgpu/common/perf/cyclestats_snapshot.c @@ -39,6 +39,8 @@ #include #include +#include "common/gr/gr_priv.h" + /* check client for pointed perfmon ownership */ #define CONTAINS_PERFMON(cl, pm) \ ((cl)->perfmon_start <= (pm) && \ diff --git a/drivers/gpu/nvgpu/common/pmu/pg/pmu_pg.c b/drivers/gpu/nvgpu/common/pmu/pg/pmu_pg.c index f2a3466d0..0d01c2e5a 100644 --- a/drivers/gpu/nvgpu/common/pmu/pg/pmu_pg.c +++ b/drivers/gpu/nvgpu/common/pmu/pg/pmu_pg.c @@ -32,6 +32,8 @@ #include #include +#include "common/gr/gr_priv.h" + /* state transition : * OFF => [OFF_ON_PENDING optional] => ON_PENDING => ON => OFF * ON => OFF is always synchronized diff --git a/drivers/gpu/nvgpu/common/rc/rc.c b/drivers/gpu/nvgpu/common/rc/rc.c index ce170e694..b73bb5092 100644 --- a/drivers/gpu/nvgpu/common/rc/rc.c +++ b/drivers/gpu/nvgpu/common/rc/rc.c @@ -32,6 +32,7 @@ #include #include #include +#include "common/gr/gr_priv.h" void nvgpu_rc_fifo_recover(struct gk20a *g, u32 eng_bitmask, u32 hw_id, bool id_is_tsg, diff --git a/drivers/gpu/nvgpu/common/regops/regops.c b/drivers/gpu/nvgpu/common/regops/regops.c index 1b54738fb..09bca3c47 100644 --- a/drivers/gpu/nvgpu/common/regops/regops.c +++ b/drivers/gpu/nvgpu/common/regops/regops.c @@ -23,6 +23,7 @@ */ #include "gk20a/gr_gk20a.h" +#include "common/gr/gr_priv.h" #include #include diff --git a/drivers/gpu/nvgpu/common/vgpu/gr/ctx_vgpu.c b/drivers/gpu/nvgpu/common/vgpu/gr/ctx_vgpu.c index a95a03c7c..362aa8c5c 100644 --- a/drivers/gpu/nvgpu/common/vgpu/gr/ctx_vgpu.c +++ b/drivers/gpu/nvgpu/common/vgpu/gr/ctx_vgpu.c @@ -38,6 +38,7 @@ #include "ctx_vgpu.h" #include "common/vgpu/ivc/comm_vgpu.h" +#include "common/gr/gr_priv.h" int vgpu_gr_alloc_gr_ctx(struct gk20a *g, struct nvgpu_gr_ctx *gr_ctx, diff --git a/drivers/gpu/nvgpu/common/vgpu/gr/gr_vgpu.c b/drivers/gpu/nvgpu/common/vgpu/gr/gr_vgpu.c index 98addc4d3..0ad0a1126 100644 --- a/drivers/gpu/nvgpu/common/vgpu/gr/gr_vgpu.c +++ b/drivers/gpu/nvgpu/common/vgpu/gr/gr_vgpu.c @@ -58,6 +58,7 @@ #include "common/gr/ctx_priv.h" #include "common/gr/zcull_priv.h" #include "common/gr/zbc_priv.h" +#include "common/gr/gr_priv.h" static int vgpu_gr_set_ctxsw_preemption_mode(struct gk20a *g, struct nvgpu_gr_ctx *gr_ctx, diff --git a/drivers/gpu/nvgpu/common/vgpu/init/init_vgpu.c b/drivers/gpu/nvgpu/common/vgpu/init/init_vgpu.c index 0069c7626..03365a3a5 100644 --- a/drivers/gpu/nvgpu/common/vgpu/init/init_vgpu.c +++ b/drivers/gpu/nvgpu/common/vgpu/init/init_vgpu.c @@ -40,6 +40,7 @@ #include "common/vgpu/mm/mm_vgpu.h" #include "common/vgpu/gr/gr_vgpu.h" #include "common/vgpu/ivc/comm_vgpu.h" +#include "common/gr/gr_priv.h" u64 vgpu_connect(void) { diff --git a/drivers/gpu/nvgpu/common/vgpu/perf/cyclestats_snapshot_vgpu.c b/drivers/gpu/nvgpu/common/vgpu/perf/cyclestats_snapshot_vgpu.c index 3a21cba20..6a832985f 100644 --- a/drivers/gpu/nvgpu/common/vgpu/perf/cyclestats_snapshot_vgpu.c +++ b/drivers/gpu/nvgpu/common/vgpu/perf/cyclestats_snapshot_vgpu.c @@ -32,6 +32,7 @@ #include "cyclestats_snapshot_vgpu.h" #include "common/vgpu/ivc/comm_vgpu.h" +#include "common/gr/gr_priv.h" static struct tegra_hv_ivm_cookie *css_cookie; diff --git a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c index 3caf9e57f..3d3b93940 100644 --- a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c @@ -64,6 +64,8 @@ #include "gr_gk20a.h" #include "gr_pri_gk20a.h" +#include "common/gr/gr_priv.h" + #include #include @@ -870,7 +872,7 @@ int gr_gk20a_get_pm_ctx_buffer_offsets(struct gk20a *g, for (i = 0; i < num_registers; i++) { err = nvgpu_gr_hwmp_map_find_priv_offset(g, g->gr->hwpm_map, priv_registers[i], - &priv_offset); + &priv_offset, gr->config); if (err != 0) { nvgpu_log_fn(g, "Could not determine priv_offset for addr:0x%x", addr); /*, grPriRegStr(addr)));*/ diff --git a/drivers/gpu/nvgpu/gk20a/gr_gk20a.h b/drivers/gpu/nvgpu/gk20a/gr_gk20a.h index e43f35d8f..6a7e97690 100644 --- a/drivers/gpu/nvgpu/gk20a/gr_gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/gr_gk20a.h @@ -25,7 +25,6 @@ #define GR_GK20A_H #include -#include #include "mm_gk20a.h" @@ -60,12 +59,6 @@ enum { NVGPU_EVENT_ID_MAX = 6U, }; -struct gr_channel_map_tlb_entry { - u32 curr_ctx; - u32 chid; - u32 tsgid; -}; - #if defined(CONFIG_GK20A_CYCLE_STATS) struct gk20a_cs_snapshot_client; struct gk20a_cs_snapshot; @@ -79,68 +72,6 @@ struct nvgpu_preemption_modes_rec { u32 default_compute_preempt_mode; /* default mode */ }; -struct nvgpu_gr { - struct gk20a *g; - struct { - bool golden_image_initialized; - u32 golden_image_size; - - u32 pm_ctxsw_image_size; - - u32 preempt_image_size; - - u32 zcull_image_size; - } ctx_vars; - - struct nvgpu_mutex ctx_mutex; /* protect golden ctx init */ - - struct nvgpu_cond init_wq; - bool initialized; - - u32 num_fbps; - u32 max_fbps_count; - - struct nvgpu_gr_global_ctx_buffer_desc *global_ctx_buffer; - - struct nvgpu_gr_obj_ctx_golden_image *golden_image; - - struct nvgpu_gr_ctx_desc *gr_ctx_desc; - - struct nvgpu_gr_config *config; - - struct nvgpu_gr_hwpm_map *hwpm_map; - - struct nvgpu_gr_zcull *zcull; - - struct nvgpu_gr_zbc *zbc; - - struct nvgpu_gr_falcon *falcon; - -#define GR_CHANNEL_MAP_TLB_SIZE 2U /* must of power of 2 */ - struct gr_channel_map_tlb_entry chid_tlb[GR_CHANNEL_MAP_TLB_SIZE]; - u32 channel_tlb_flush_index; - struct nvgpu_spinlock ch_tlb_lock; - - void (*remove_support)(struct gk20a *g); - bool sw_ready; - - u32 fecs_feature_override_ecc_val; - - u32 cilp_preempt_pending_chid; - - u32 fbp_en_mask; - u32 *fbp_rop_l2_en_mask; - -#if defined(CONFIG_GK20A_CYCLE_STATS) - struct nvgpu_mutex cs_lock; - struct gk20a_cs_snapshot *cs_data; -#endif - u32 max_css_buffer_size; - u32 max_ctxsw_ring_buffer_size; -}; - - - struct nvgpu_warpstate { u64 valid_warps[2]; u64 trapped_warps[2]; diff --git a/drivers/gpu/nvgpu/gm20b/gr_gm20b.c b/drivers/gpu/nvgpu/gm20b/gr_gm20b.c index fe44597c5..15606bb3f 100644 --- a/drivers/gpu/nvgpu/gm20b/gr_gm20b.c +++ b/drivers/gpu/nvgpu/gm20b/gr_gm20b.c @@ -41,6 +41,7 @@ #include #include "gk20a/gr_gk20a.h" +#include "common/gr/gr_priv.h" #include "gr_gm20b.h" diff --git a/drivers/gpu/nvgpu/gp10b/gr_gp10b.c b/drivers/gpu/nvgpu/gp10b/gr_gp10b.c index 92345c67c..1a3691c65 100644 --- a/drivers/gpu/nvgpu/gp10b/gr_gp10b.c +++ b/drivers/gpu/nvgpu/gp10b/gr_gp10b.c @@ -48,10 +48,11 @@ #include #include "gk20a/gr_gk20a.h" - #include "gm20b/gr_gm20b.h" #include "gp10b/gr_gp10b.h" +#include "common/gr/gr_priv.h" + #include #include diff --git a/drivers/gpu/nvgpu/gv100/gr_gv100.c b/drivers/gpu/nvgpu/gv100/gr_gv100.c index f6f9943b7..1d4354dd8 100644 --- a/drivers/gpu/nvgpu/gv100/gr_gv100.c +++ b/drivers/gpu/nvgpu/gv100/gr_gv100.c @@ -32,6 +32,7 @@ #include "gk20a/gr_gk20a.h" #include "gk20a/gr_pri_gk20a.h" +#include "common/gr/gr_priv.h" #include "gv100/gr_gv100.h" diff --git a/drivers/gpu/nvgpu/gv11b/gr_gv11b.c b/drivers/gpu/nvgpu/gv11b/gr_gv11b.c index ba3a99e7a..b66ed928b 100644 --- a/drivers/gpu/nvgpu/gv11b/gr_gv11b.c +++ b/drivers/gpu/nvgpu/gv11b/gr_gv11b.c @@ -49,8 +49,8 @@ #include #include -#include "gk20a/gr_gk20a.h" #include "gk20a/gr_pri_gk20a.h" +#include "common/gr/gr_priv.h" #include "gm20b/gr_gm20b.h" diff --git a/drivers/gpu/nvgpu/hal/gr/falcon/gr_falcon_gm20b.c b/drivers/gpu/nvgpu/hal/gr/falcon/gr_falcon_gm20b.c index 140f461ec..7ee565df6 100644 --- a/drivers/gpu/nvgpu/hal/gr/falcon/gr_falcon_gm20b.c +++ b/drivers/gpu/nvgpu/hal/gr/falcon/gr_falcon_gm20b.c @@ -29,6 +29,7 @@ #include "gr_falcon_gm20b.h" #include "common/gr/gr_falcon_priv.h" +#include "common/gr/gr_priv.h" #include #include diff --git a/drivers/gpu/nvgpu/hal/gr/falcon/gr_falcon_gp10b.c b/drivers/gpu/nvgpu/hal/gr/falcon/gr_falcon_gp10b.c index 91d77608c..d828743ee 100644 --- a/drivers/gpu/nvgpu/hal/gr/falcon/gr_falcon_gp10b.c +++ b/drivers/gpu/nvgpu/hal/gr/falcon/gr_falcon_gp10b.c @@ -26,6 +26,7 @@ #include "gr_falcon_gp10b.h" #include "gr_falcon_gm20b.h" #include "common/gr/gr_falcon_priv.h" +#include "common/gr/gr_priv.h" #include diff --git a/drivers/gpu/nvgpu/hal/gr/init/gr_init_gp10b.c b/drivers/gpu/nvgpu/hal/gr/init/gr_init_gp10b.c index f6be5bd5d..adb0d3455 100644 --- a/drivers/gpu/nvgpu/hal/gr/init/gr_init_gp10b.c +++ b/drivers/gpu/nvgpu/hal/gr/init/gr_init_gp10b.c @@ -30,6 +30,8 @@ #include #include +#include "common/gr/gr_priv.h" + #include "gr_init_gm20b.h" #include "gr_init_gp10b.h" diff --git a/drivers/gpu/nvgpu/hal/gr/init/gr_init_gv11b.c b/drivers/gpu/nvgpu/hal/gr/init/gr_init_gv11b.c index 78056c4c6..c7141d2a1 100644 --- a/drivers/gpu/nvgpu/hal/gr/init/gr_init_gv11b.c +++ b/drivers/gpu/nvgpu/hal/gr/init/gr_init_gv11b.c @@ -30,6 +30,7 @@ #include #include +#include "common/gr/gr_priv.h" #include "gr_init_gm20b.h" #include "gr_init_gv11b.h" diff --git a/drivers/gpu/nvgpu/hal/ltc/ltc_gm20b.c b/drivers/gpu/nvgpu/hal/ltc/ltc_gm20b.c index bd9aceba6..3bf13e9a8 100644 --- a/drivers/gpu/nvgpu/hal/ltc/ltc_gm20b.c +++ b/drivers/gpu/nvgpu/hal/ltc/ltc_gm20b.c @@ -37,6 +37,7 @@ #include #include "ltc_gm20b.h" +#include "common/gr/gr_priv.h" void gm20b_ltc_init_fs_state(struct gk20a *g) { diff --git a/drivers/gpu/nvgpu/include/nvgpu/gr/hwpm_map.h b/drivers/gpu/nvgpu/include/nvgpu/gr/hwpm_map.h index b2de73bf3..3e4faa657 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/gr/hwpm_map.h +++ b/drivers/gpu/nvgpu/include/nvgpu/gr/hwpm_map.h @@ -27,6 +27,7 @@ struct gk20a; struct ctxsw_buf_offset_map_entry; +struct nvgpu_gr_config; struct nvgpu_gr_hwpm_map { u32 pm_ctxsw_image_size; @@ -46,6 +47,6 @@ u32 nvgpu_gr_hwpm_map_get_size(struct nvgpu_gr_hwpm_map *hwpm_map); int nvgpu_gr_hwmp_map_find_priv_offset(struct gk20a *g, struct nvgpu_gr_hwpm_map *hwpm_map, - u32 addr, u32 *priv_offset); + u32 addr, u32 *priv_offset, struct nvgpu_gr_config *config); #endif /* NVGPU_GR_HWPM_MAP_H */ diff --git a/drivers/gpu/nvgpu/os/linux/debug_gr.c b/drivers/gpu/nvgpu/os/linux/debug_gr.c index cf8ee5c04..5c9ac041f 100644 --- a/drivers/gpu/nvgpu/os/linux/debug_gr.c +++ b/drivers/gpu/nvgpu/os/linux/debug_gr.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2017 NVIDIA Corporation. All rights reserved. + * Copyright (C) 2017-2019 NVIDIA Corporation. All rights reserved. * * This software is licensed under the terms of the GNU General Public * License version 2, as published by the Free Software Foundation, and @@ -12,9 +12,11 @@ * */ +#include #include #include "common/gr/ctx_priv.h" +#include "common/gr/gr_priv.h" #include "debug_gr.h" #include "os_linux.h" diff --git a/drivers/gpu/nvgpu/os/linux/fecs_trace_linux.c b/drivers/gpu/nvgpu/os/linux/fecs_trace_linux.c index 184e91e81..e4552d081 100644 --- a/drivers/gpu/nvgpu/os/linux/fecs_trace_linux.c +++ b/drivers/gpu/nvgpu/os/linux/fecs_trace_linux.c @@ -30,6 +30,7 @@ #include #include "gk20a/gr_gk20a.h" +#include "common/gr/gr_priv.h" #include "platform_gk20a.h" #include "os_linux.h" diff --git a/drivers/gpu/nvgpu/os/linux/ioctl_ctrl.c b/drivers/gpu/nvgpu/os/linux/ioctl_ctrl.c index 9986b9a50..0598f601b 100644 --- a/drivers/gpu/nvgpu/os/linux/ioctl_ctrl.c +++ b/drivers/gpu/nvgpu/os/linux/ioctl_ctrl.c @@ -40,6 +40,8 @@ #include #include +#include "common/gr/gr_priv.h" + #include "ioctl_ctrl.h" #include "ioctl_dbg.h" #include "ioctl_as.h" diff --git a/drivers/gpu/nvgpu/os/linux/ioctl_dbg.c b/drivers/gpu/nvgpu/os/linux/ioctl_dbg.c index 900f6276f..27698de03 100644 --- a/drivers/gpu/nvgpu/os/linux/ioctl_dbg.c +++ b/drivers/gpu/nvgpu/os/linux/ioctl_dbg.c @@ -42,6 +42,8 @@ #include +#include "common/gr/gr_priv.h" + #include "gk20a/gr_gk20a.h" #include "os_linux.h" #include "platform_gk20a.h" diff --git a/drivers/gpu/nvgpu/os/linux/ioctl_tsg.c b/drivers/gpu/nvgpu/os/linux/ioctl_tsg.c index f3fbe77ba..b2b5d2564 100644 --- a/drivers/gpu/nvgpu/os/linux/ioctl_tsg.c +++ b/drivers/gpu/nvgpu/os/linux/ioctl_tsg.c @@ -30,6 +30,8 @@ #include #include +#include "common/gr/gr_priv.h" + #include "gv11b/fifo_gv11b.h" #include "platform_gk20a.h" #include "ioctl_tsg.h" diff --git a/drivers/gpu/nvgpu/os/linux/module.c b/drivers/gpu/nvgpu/os/linux/module.c index 329819496..410d6d409 100644 --- a/drivers/gpu/nvgpu/os/linux/module.c +++ b/drivers/gpu/nvgpu/os/linux/module.c @@ -50,6 +50,8 @@ #include #include +#include "common/gr/gr_priv.h" + #include "platform_gk20a.h" #include "sysfs.h" #include "vgpu/vgpu_linux.h" diff --git a/drivers/gpu/nvgpu/os/linux/sysfs.c b/drivers/gpu/nvgpu/os/linux/sysfs.c index 36330993c..21b3874a8 100644 --- a/drivers/gpu/nvgpu/os/linux/sysfs.c +++ b/drivers/gpu/nvgpu/os/linux/sysfs.c @@ -29,6 +29,8 @@ #include #include +#include "common/gr/gr_priv.h" + #include "os_linux.h" #include "sysfs.h" #include "platform_gk20a.h"