From 170d7464d6bfa02128b2d5cd28eb5ec10272e318 Mon Sep 17 00:00:00 2001 From: Seema Khowala Date: Fri, 26 Apr 2019 14:57:54 -0700 Subject: [PATCH] gpu: nvgpu: move fifo_gk20a.[ch] to hal/fifo Move fifo_gk20a struct to fifo.h Move fifo_gk20a.[ch] to hal/fifo Add missing includes for fifo subunits. JIRA NVGPU-2012 Change-Id: I8bf5402bd5a9f8ff9f6a818cee553b57e117f3bc Signed-off-by: Seema Khowala Reviewed-on: https://git-master.nvidia.com/r/2109012 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/Makefile | 2 +- drivers/gpu/nvgpu/Makefile.sources | 2 +- drivers/gpu/nvgpu/common/ce/ce.c | 1 + drivers/gpu/nvgpu/common/fifo/channel.c | 1 + drivers/gpu/nvgpu/common/fifo/engines.c | 3 +- drivers/gpu/nvgpu/common/fifo/fifo.c | 3 +- drivers/gpu/nvgpu/common/fifo/preempt.c | 1 + drivers/gpu/nvgpu/common/fifo/runlist.c | 1 + drivers/gpu/nvgpu/common/fifo/submit.c | 1 + drivers/gpu/nvgpu/common/mm/mm.c | 1 + .../gpu/nvgpu/common/power_features/cg/cg.c | 1 + .../gpu/nvgpu/common/vgpu/fifo/fifo_vgpu.c | 1 + .../nvgpu/common/vgpu/gp10b/vgpu_hal_gp10b.c | 1 + drivers/gpu/nvgpu/hal/fb/fb_gv11b.c | 2 + drivers/gpu/nvgpu/hal/fb/fb_mmu_fault_gv11b.c | 1 + .../gpu/nvgpu/hal/fifo/engine_status_gm20b.c | 2 +- .../gpu/nvgpu/hal/fifo/engine_status_gv100.c | 1 - .../nvgpu/{gk20a => hal/fifo}/fifo_gk20a.c | 5 +- drivers/gpu/nvgpu/hal/fifo/fifo_gk20a.h | 36 ++++++++ drivers/gpu/nvgpu/hal/fifo/ramfc_gp10b.c | 3 +- .../gpu/nvgpu/hal/fifo/runlist_fifo_gk20a.c | 1 + drivers/gpu/nvgpu/hal/gr/init/gr_init_gm20b.c | 1 + drivers/gpu/nvgpu/hal/init/hal_gm20b.c | 2 + drivers/gpu/nvgpu/hal/init/hal_gp10b.c | 2 + drivers/gpu/nvgpu/hal/init/hal_gv100.c | 2 + drivers/gpu/nvgpu/hal/init/hal_gv11b.c | 2 + drivers/gpu/nvgpu/hal/init/hal_tu104.c | 2 + .../nvgpu/hal/mm/gmmu/gmmu_mmu_fault_gv11b.c | 1 + drivers/gpu/nvgpu/hal/rc/rc_gv11b.c | 1 + drivers/gpu/nvgpu/include/nvgpu/fifo.h | 86 +++++++++++++++++++ drivers/gpu/nvgpu/include/nvgpu/gk20a.h | 2 +- drivers/gpu/nvgpu/os/linux/debug_fifo.c | 1 + drivers/gpu/nvgpu/os/linux/ioctl_channel.c | 1 + drivers/gpu/nvgpu/os/linux/ioctl_ctrl.c | 1 + 34 files changed, 160 insertions(+), 14 deletions(-) rename drivers/gpu/nvgpu/{gk20a => hal/fifo}/fifo_gk20a.c (98%) create mode 100644 drivers/gpu/nvgpu/hal/fifo/fifo_gk20a.h diff --git a/drivers/gpu/nvgpu/Makefile b/drivers/gpu/nvgpu/Makefile index 7496b17ac..ab4584f8e 100644 --- a/drivers/gpu/nvgpu/Makefile +++ b/drivers/gpu/nvgpu/Makefile @@ -272,6 +272,7 @@ nvgpu-y += \ hal/func/func_tu104.o \ hal/rc/rc_gk20a.o \ hal/rc/rc_gv11b.o \ + hal/fifo/fifo_gk20a.o \ hal/fifo/fifo_gv11b.o \ hal/fifo/fifo_tu104.o \ hal/fifo/preempt_gk20a.o \ @@ -551,7 +552,6 @@ nvgpu-y += \ common/ecc.o \ common/ce/ce.o \ common/debugger.o \ - gk20a/fifo_gk20a.o \ nvgpu-$(CONFIG_GK20A_VIDMEM) += \ common/mm/vidmem.o diff --git a/drivers/gpu/nvgpu/Makefile.sources b/drivers/gpu/nvgpu/Makefile.sources index 58d42cdbd..1efdebc0a 100644 --- a/drivers/gpu/nvgpu/Makefile.sources +++ b/drivers/gpu/nvgpu/Makefile.sources @@ -243,7 +243,6 @@ srcs += common/sim/sim.c \ common/nvlink/nvlink_tu104.c \ common/nvlink/nvlink.c \ common/fence/fence.c \ - gk20a/fifo_gk20a.c \ gv11b/mmu_fault_gv11b.c \ gv100/mm_gv100.c \ tu104/mm_tu104.c \ @@ -370,6 +369,7 @@ srcs += common/sim/sim.c \ hal/func/func_tu104.c \ hal/rc/rc_gk20a.c \ hal/rc/rc_gv11b.c \ + hal/fifo/fifo_gk20a.c \ hal/fifo/fifo_gv11b.c \ hal/fifo/fifo_tu104.c \ hal/fifo/preempt_gk20a.c \ diff --git a/drivers/gpu/nvgpu/common/ce/ce.c b/drivers/gpu/nvgpu/common/ce/ce.c index 67f761e08..3d4f2109f 100644 --- a/drivers/gpu/nvgpu/common/ce/ce.c +++ b/drivers/gpu/nvgpu/common/ce/ce.c @@ -22,6 +22,7 @@ #include #include +#include #include #include #include diff --git a/drivers/gpu/nvgpu/common/fifo/channel.c b/drivers/gpu/nvgpu/common/fifo/channel.c index 594da7784..34bb5eb3e 100644 --- a/drivers/gpu/nvgpu/common/fifo/channel.c +++ b/drivers/gpu/nvgpu/common/fifo/channel.c @@ -46,6 +46,7 @@ #include #include #include +#include #include #include #include diff --git a/drivers/gpu/nvgpu/common/fifo/engines.c b/drivers/gpu/nvgpu/common/fifo/engines.c index 1174bbc34..98d3fa1de 100644 --- a/drivers/gpu/nvgpu/common/fifo/engines.c +++ b/drivers/gpu/nvgpu/common/fifo/engines.c @@ -36,8 +36,7 @@ #include #include #include - -#include "gk20a/fifo_gk20a.h" +#include #define FECS_METHOD_WFI_RESTORE 0x80000U diff --git a/drivers/gpu/nvgpu/common/fifo/fifo.c b/drivers/gpu/nvgpu/common/fifo/fifo.c index 578569b4e..26d7f2030 100644 --- a/drivers/gpu/nvgpu/common/fifo/fifo.c +++ b/drivers/gpu/nvgpu/common/fifo/fifo.c @@ -26,6 +26,7 @@ #include #include +#include #include #include #include @@ -34,8 +35,6 @@ #include #include -#include - void nvgpu_fifo_cleanup_sw_common(struct gk20a *g) { struct fifo_gk20a *f = &g->fifo; diff --git a/drivers/gpu/nvgpu/common/fifo/preempt.c b/drivers/gpu/nvgpu/common/fifo/preempt.c index e88bde793..f5e44e28a 100644 --- a/drivers/gpu/nvgpu/common/fifo/preempt.c +++ b/drivers/gpu/nvgpu/common/fifo/preempt.c @@ -21,6 +21,7 @@ */ #include +#include #include #include #include diff --git a/drivers/gpu/nvgpu/common/fifo/runlist.c b/drivers/gpu/nvgpu/common/fifo/runlist.c index 57316f186..7960675eb 100644 --- a/drivers/gpu/nvgpu/common/fifo/runlist.c +++ b/drivers/gpu/nvgpu/common/fifo/runlist.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include diff --git a/drivers/gpu/nvgpu/common/fifo/submit.c b/drivers/gpu/nvgpu/common/fifo/submit.c index 1901cf2df..8844f04ac 100644 --- a/drivers/gpu/nvgpu/common/fifo/submit.c +++ b/drivers/gpu/nvgpu/common/fifo/submit.c @@ -29,6 +29,7 @@ #include #include #include +#include #include diff --git a/drivers/gpu/nvgpu/common/mm/mm.c b/drivers/gpu/nvgpu/common/mm/mm.c index 6004455fa..916cd7b39 100644 --- a/drivers/gpu/nvgpu/common/mm/mm.c +++ b/drivers/gpu/nvgpu/common/mm/mm.c @@ -32,6 +32,7 @@ #include #include #include +#include #include /* diff --git a/drivers/gpu/nvgpu/common/power_features/cg/cg.c b/drivers/gpu/nvgpu/common/power_features/cg/cg.c index 85d487bd7..aa954b501 100644 --- a/drivers/gpu/nvgpu/common/power_features/cg/cg.c +++ b/drivers/gpu/nvgpu/common/power_features/cg/cg.c @@ -21,6 +21,7 @@ */ #include +#include #include #include diff --git a/drivers/gpu/nvgpu/common/vgpu/fifo/fifo_vgpu.c b/drivers/gpu/nvgpu/common/vgpu/fifo/fifo_vgpu.c index 57df2e462..d24b7ac22 100644 --- a/drivers/gpu/nvgpu/common/vgpu/fifo/fifo_vgpu.c +++ b/drivers/gpu/nvgpu/common/vgpu/fifo/fifo_vgpu.c @@ -36,6 +36,7 @@ #include #include #include +#include #include #include #include diff --git a/drivers/gpu/nvgpu/common/vgpu/gp10b/vgpu_hal_gp10b.c b/drivers/gpu/nvgpu/common/vgpu/gp10b/vgpu_hal_gp10b.c index 3365784ec..7eaa16bec 100644 --- a/drivers/gpu/nvgpu/common/vgpu/gp10b/vgpu_hal_gp10b.c +++ b/drivers/gpu/nvgpu/common/vgpu/gp10b/vgpu_hal_gp10b.c @@ -42,6 +42,7 @@ #include "hal/mm/gmmu/gmmu_gp10b.h" #include "hal/regops/regops_gp10b.h" #include "hal/class/class_gp10b.h" +#include "hal/fifo/fifo_gk20a.h" #include "hal/fifo/engines_gm20b.h" #include "hal/fifo/pbdma_gm20b.h" #include "hal/fifo/pbdma_gp10b.h" diff --git a/drivers/gpu/nvgpu/hal/fb/fb_gv11b.c b/drivers/gpu/nvgpu/hal/fb/fb_gv11b.c index ee0bb2fb0..089a6332a 100644 --- a/drivers/gpu/nvgpu/hal/fb/fb_gv11b.c +++ b/drivers/gpu/nvgpu/hal/fb/fb_gv11b.c @@ -37,6 +37,8 @@ #include #include #include +#include +#include #include "fb_gm20b.h" diff --git a/drivers/gpu/nvgpu/hal/fb/fb_mmu_fault_gv11b.c b/drivers/gpu/nvgpu/hal/fb/fb_mmu_fault_gv11b.c index d20a21c0a..82214f16a 100644 --- a/drivers/gpu/nvgpu/hal/fb/fb_mmu_fault_gv11b.c +++ b/drivers/gpu/nvgpu/hal/fb/fb_mmu_fault_gv11b.c @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include diff --git a/drivers/gpu/nvgpu/hal/fifo/engine_status_gm20b.c b/drivers/gpu/nvgpu/hal/fifo/engine_status_gm20b.c index b79d693fa..bb77cb4e4 100644 --- a/drivers/gpu/nvgpu/hal/fifo/engine_status_gm20b.c +++ b/drivers/gpu/nvgpu/hal/fifo/engine_status_gm20b.c @@ -24,11 +24,11 @@ #include #include #include +#include #include #include "engine_status_gm20b.h" -#include "gk20a/fifo_gk20a.h" static void populate_invalid_ctxsw_status_info( struct nvgpu_engine_status_info *status_info) diff --git a/drivers/gpu/nvgpu/hal/fifo/engine_status_gv100.c b/drivers/gpu/nvgpu/hal/fifo/engine_status_gv100.c index 8738f6a81..5e056904f 100644 --- a/drivers/gpu/nvgpu/hal/fifo/engine_status_gv100.c +++ b/drivers/gpu/nvgpu/hal/fifo/engine_status_gv100.c @@ -29,7 +29,6 @@ #include "engine_status_gm20b.h" #include "engine_status_gv100.h" -#include "gk20a/fifo_gk20a.h" void gv100_read_engine_status_info(struct gk20a *g, u32 engine_id, struct nvgpu_engine_status_info *status) diff --git a/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c b/drivers/gpu/nvgpu/hal/fifo/fifo_gk20a.c similarity index 98% rename from drivers/gpu/nvgpu/gk20a/fifo_gk20a.c rename to drivers/gpu/nvgpu/hal/fifo/fifo_gk20a.c index 9a4e7e9a6..8d81ed011 100644 --- a/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c +++ b/drivers/gpu/nvgpu/hal/fifo/fifo_gk20a.c @@ -27,10 +27,9 @@ #include #include #include -#include #include -#include "fifo_gk20a.h" +#include "hal/fifo/fifo_gk20a.h" #include @@ -99,7 +98,7 @@ int gk20a_fifo_init_pbdma_map(struct gk20a *g, u32 *pbdma_map, u32 num_pbdma) pbdma_map[id] = nvgpu_readl(g, fifo_pbdma_map_r(id)); } - return 0; + return 0U; } u32 gk20a_fifo_get_runlist_timeslice(struct gk20a *g) diff --git a/drivers/gpu/nvgpu/hal/fifo/fifo_gk20a.h b/drivers/gpu/nvgpu/hal/fifo/fifo_gk20a.h new file mode 100644 index 000000000..e93303581 --- /dev/null +++ b/drivers/gpu/nvgpu/hal/fifo/fifo_gk20a.h @@ -0,0 +1,36 @@ +/* + * GK20A graphics fifo (gr host) + * + * Copyright (c) 2011-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_FIFO_GK20A_H +#define NVGPU_FIFO_GK20A_H + +#include + +int gk20a_init_fifo_reset_enable_hw(struct gk20a *g); +int gk20a_init_fifo_setup_hw(struct gk20a *g); +void gk20a_fifo_bar1_snooping_disable(struct gk20a *g); +int gk20a_fifo_init_pbdma_map(struct gk20a *g, u32 *pbdma_map, u32 num_pbdma); +u32 gk20a_fifo_get_runlist_timeslice(struct gk20a *g); +u32 gk20a_fifo_get_pb_timeslice(struct gk20a *g); + +#endif /* NVGPU_FIFO_GK20A_H */ diff --git a/drivers/gpu/nvgpu/hal/fifo/ramfc_gp10b.c b/drivers/gpu/nvgpu/hal/fifo/ramfc_gp10b.c index a29ceef3f..a4b23efca 100644 --- a/drivers/gpu/nvgpu/hal/fifo/ramfc_gp10b.c +++ b/drivers/gpu/nvgpu/hal/fifo/ramfc_gp10b.c @@ -26,8 +26,7 @@ #include #include #include - -#include "gk20a/fifo_gk20a.h" +#include #include "hal/fifo/ramfc_gk20a.h" #include "hal/fifo/ramfc_gp10b.h" diff --git a/drivers/gpu/nvgpu/hal/fifo/runlist_fifo_gk20a.c b/drivers/gpu/nvgpu/hal/fifo/runlist_fifo_gk20a.c index abe5888e2..156965775 100644 --- a/drivers/gpu/nvgpu/hal/fifo/runlist_fifo_gk20a.c +++ b/drivers/gpu/nvgpu/hal/fifo/runlist_fifo_gk20a.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include diff --git a/drivers/gpu/nvgpu/hal/gr/init/gr_init_gm20b.c b/drivers/gpu/nvgpu/hal/gr/init/gr_init_gm20b.c index 8bea5588c..5360536aa 100644 --- a/drivers/gpu/nvgpu/hal/gr/init/gr_init_gm20b.c +++ b/drivers/gpu/nvgpu/hal/gr/init/gr_init_gm20b.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include diff --git a/drivers/gpu/nvgpu/hal/init/hal_gm20b.c b/drivers/gpu/nvgpu/hal/init/hal_gm20b.c index 5cb6eb212..de55c203b 100644 --- a/drivers/gpu/nvgpu/hal/init/hal_gm20b.c +++ b/drivers/gpu/nvgpu/hal/init/hal_gm20b.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -60,6 +61,7 @@ #include "hal/fuse/fuse_gm20b.h" #include "hal/ptimer/ptimer_gk20a.h" #include "hal/regops/regops_gm20b.h" +#include "hal/fifo/fifo_gk20a.h" #include "hal/fifo/preempt_gk20a.h" #include "hal/fifo/pbdma_gm20b.h" #include "hal/fifo/engines_gm20b.h" diff --git a/drivers/gpu/nvgpu/hal/init/hal_gp10b.c b/drivers/gpu/nvgpu/hal/init/hal_gp10b.c index d0ced1923..0ab0dcb32 100644 --- a/drivers/gpu/nvgpu/hal/init/hal_gp10b.c +++ b/drivers/gpu/nvgpu/hal/init/hal_gp10b.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -69,6 +70,7 @@ #include "hal/fuse/fuse_gp10b.h" #include "hal/ptimer/ptimer_gk20a.h" #include "hal/regops/regops_gp10b.h" +#include "hal/fifo/fifo_gk20a.h" #include "hal/fifo/preempt_gk20a.h" #include "hal/fifo/pbdma_gm20b.h" #include "hal/fifo/pbdma_gp10b.h" diff --git a/drivers/gpu/nvgpu/hal/init/hal_gv100.c b/drivers/gpu/nvgpu/hal/init/hal_gv100.c index 1b41ca9b2..fd324ec29 100644 --- a/drivers/gpu/nvgpu/hal/init/hal_gv100.c +++ b/drivers/gpu/nvgpu/hal/init/hal_gv100.c @@ -65,6 +65,7 @@ #include "hal/ptimer/ptimer_gk20a.h" #include "hal/rc/rc_gv11b.h" #include "hal/regops/regops_gv100.h" +#include "hal/fifo/fifo_gk20a.h" #include "hal/fifo/fifo_gv11b.h" #include "hal/fifo/preempt_gv11b.h" #include "hal/fifo/pbdma_gm20b.h" @@ -164,6 +165,7 @@ #include #include #include +#include #include #include #include diff --git a/drivers/gpu/nvgpu/hal/init/hal_gv11b.c b/drivers/gpu/nvgpu/hal/init/hal_gv11b.c index e334338e4..515a88fd4 100644 --- a/drivers/gpu/nvgpu/hal/init/hal_gv11b.c +++ b/drivers/gpu/nvgpu/hal/init/hal_gv11b.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include @@ -67,6 +68,7 @@ #include "hal/ptimer/ptimer_gk20a.h" #include "hal/regops/regops_gv11b.h" #include "hal/rc/rc_gv11b.h" +#include "hal/fifo/fifo_gk20a.h" #include "hal/fifo/fifo_gv11b.h" #include "hal/fifo/pbdma_gm20b.h" #include "hal/fifo/preempt_gv11b.h" diff --git a/drivers/gpu/nvgpu/hal/init/hal_tu104.c b/drivers/gpu/nvgpu/hal/init/hal_tu104.c index 12f5cc92a..d86db4cb0 100644 --- a/drivers/gpu/nvgpu/hal/init/hal_tu104.c +++ b/drivers/gpu/nvgpu/hal/init/hal_tu104.c @@ -69,6 +69,7 @@ #include "hal/fuse/fuse_gp10b.h" #include "hal/fuse/fuse_gp106.h" #include "hal/rc/rc_gv11b.h" +#include "hal/fifo/fifo_gk20a.h" #include "hal/fifo/fifo_gv11b.h" #include "hal/fifo/fifo_tu104.h" #include "hal/fifo/preempt_gv11b.h" @@ -186,6 +187,7 @@ #include #include #include +#include #include #include #include diff --git a/drivers/gpu/nvgpu/hal/mm/gmmu/gmmu_mmu_fault_gv11b.c b/drivers/gpu/nvgpu/hal/mm/gmmu/gmmu_mmu_fault_gv11b.c index bdb2f74dc..f22062451 100644 --- a/drivers/gpu/nvgpu/hal/mm/gmmu/gmmu_mmu_fault_gv11b.c +++ b/drivers/gpu/nvgpu/hal/mm/gmmu/gmmu_mmu_fault_gv11b.c @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include diff --git a/drivers/gpu/nvgpu/hal/rc/rc_gv11b.c b/drivers/gpu/nvgpu/hal/rc/rc_gv11b.c index 4a1d17a95..e442ca6d8 100644 --- a/drivers/gpu/nvgpu/hal/rc/rc_gv11b.c +++ b/drivers/gpu/nvgpu/hal/rc/rc_gv11b.c @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #include diff --git a/drivers/gpu/nvgpu/include/nvgpu/fifo.h b/drivers/gpu/nvgpu/include/nvgpu/fifo.h index 94242c3a1..16a7974a1 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/fifo.h +++ b/drivers/gpu/nvgpu/include/nvgpu/fifo.h @@ -26,6 +26,9 @@ #define NVGPU_FIFO_COMMON_H #include +#include +#include +#include #define ID_TYPE_CHANNEL 0U #define ID_TYPE_TSG 1U @@ -40,6 +43,89 @@ #define CHANNEL_INFO_VEID0 0U struct gk20a; +struct nvgpu_engine_info; +struct nvgpu_runlist_info; +struct channel_gk20a; +struct tsg_gk20a; + +struct fifo_gk20a { + struct gk20a *g; + unsigned int num_channels; + unsigned int runlist_entry_size; + unsigned int num_runlist_entries; + + unsigned int num_pbdma; + u32 *pbdma_map; + + struct nvgpu_engine_info *engine_info; + u32 max_engines; + u32 num_engines; + u32 *active_engines_list; + + /* Pointers to runlists, indexed by real hw runlist_id. + * If a runlist is active, then runlist_info[runlist_id] points + * to one entry in active_runlist_info. Otherwise, it is NULL. + */ + struct nvgpu_runlist_info **runlist_info; + u32 max_runlists; + + /* Array of runlists that are actually in use */ + struct nvgpu_runlist_info *active_runlist_info; + u32 num_runlists; /* number of active runlists */ +#ifdef CONFIG_DEBUG_FS + struct { + struct nvgpu_profile *data; + nvgpu_atomic_t get; + bool enabled; + u64 *sorted; + struct nvgpu_ref ref; + struct nvgpu_mutex lock; + } profile; +#endif + struct nvgpu_mutex userd_mutex; + struct nvgpu_mem *userd_slabs; + u32 num_userd_slabs; + u32 num_channels_per_slab; + u32 userd_entry_size; + u64 userd_gpu_va; + + unsigned int used_channels; + struct channel_gk20a *channel; + /* zero-kref'd channels here */ + struct nvgpu_list_node free_chs; + struct nvgpu_mutex free_chs_mutex; + struct nvgpu_mutex engines_reset_mutex; + struct nvgpu_spinlock runlist_submit_lock; + + struct tsg_gk20a *tsg; + struct nvgpu_mutex tsg_inuse_mutex; + + void (*remove_support)(struct fifo_gk20a *f); + bool sw_ready; + struct { + /* share info between isrs and non-isr code */ + struct { + struct nvgpu_mutex mutex; + } isr; + struct { + u32 device_fatal_0; + u32 channel_fatal_0; + u32 restartable_0; + } pbdma; + struct { + + } engine; + + + } intr; + + unsigned long deferred_fault_engines; + bool deferred_reset_pending; + struct nvgpu_mutex deferred_reset_mutex; + + u32 max_subctx_count; + u32 channel_base; +}; int nvgpu_fifo_init_support(struct gk20a *g); int nvgpu_fifo_setup_sw(struct gk20a *g); diff --git a/drivers/gpu/nvgpu/include/nvgpu/gk20a.h b/drivers/gpu/nvgpu/include/nvgpu/gk20a.h index 11cd7f912..e14de1414 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/gk20a.h +++ b/drivers/gpu/nvgpu/include/nvgpu/gk20a.h @@ -120,9 +120,9 @@ typedef void (*global_ctx_mem_destroy_fn)(struct gk20a *g, #include #include #include +#include #include "hal/clk/clk_gk20a.h" -#include "gk20a/fifo_gk20a.h" #ifdef CONFIG_DEBUG_FS struct railgate_stats { diff --git a/drivers/gpu/nvgpu/os/linux/debug_fifo.c b/drivers/gpu/nvgpu/os/linux/debug_fifo.c index b3041e197..e3cec326d 100644 --- a/drivers/gpu/nvgpu/os/linux/debug_fifo.c +++ b/drivers/gpu/nvgpu/os/linux/debug_fifo.c @@ -23,6 +23,7 @@ #include #include #include +#include #include void __gk20a_fifo_profile_free(struct nvgpu_ref *ref); diff --git a/drivers/gpu/nvgpu/os/linux/ioctl_channel.c b/drivers/gpu/nvgpu/os/linux/ioctl_channel.c index f35b8b98f..3b04d841e 100644 --- a/drivers/gpu/nvgpu/os/linux/ioctl_channel.c +++ b/drivers/gpu/nvgpu/os/linux/ioctl_channel.c @@ -35,6 +35,7 @@ #include #include #include +#include #include #include #include diff --git a/drivers/gpu/nvgpu/os/linux/ioctl_ctrl.c b/drivers/gpu/nvgpu/os/linux/ioctl_ctrl.c index ab229298c..18a498f41 100644 --- a/drivers/gpu/nvgpu/os/linux/ioctl_ctrl.c +++ b/drivers/gpu/nvgpu/os/linux/ioctl_ctrl.c @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include