diff --git a/drivers/gpu/nvgpu/common/acr/acr_sw_tu104.c b/drivers/gpu/nvgpu/common/acr/acr_sw_tu104.c index 589256967..d4daa3995 100644 --- a/drivers/gpu/nvgpu/common/acr/acr_sw_tu104.c +++ b/drivers/gpu/nvgpu/common/acr/acr_sw_tu104.c @@ -24,7 +24,6 @@ #include #include -#include #include "acr_wpr.h" #include "acr_priv.h" diff --git a/drivers/gpu/nvgpu/common/fifo/runlist.c b/drivers/gpu/nvgpu/common/fifo/runlist.c index 226317995..96afcce89 100644 --- a/drivers/gpu/nvgpu/common/fifo/runlist.c +++ b/drivers/gpu/nvgpu/common/fifo/runlist.c @@ -25,6 +25,7 @@ #include #include #include +#include void nvgpu_fifo_lock_active_runlists(struct gk20a *g) { diff --git a/drivers/gpu/nvgpu/common/fifo/userd.c b/drivers/gpu/nvgpu/common/fifo/userd.c index a93b64e4c..7a1dbc542 100644 --- a/drivers/gpu/nvgpu/common/fifo/userd.c +++ b/drivers/gpu/nvgpu/common/fifo/userd.c @@ -29,6 +29,7 @@ #include #include #include +#include #ifdef NVGPU_USERD int nvgpu_userd_init_slabs(struct gk20a *g) diff --git a/drivers/gpu/nvgpu/common/gr/ctx.c b/drivers/gpu/nvgpu/common/gr/ctx.c index 354ee946a..aa4e44483 100644 --- a/drivers/gpu/nvgpu/common/gr/ctx.c +++ b/drivers/gpu/nvgpu/common/gr/ctx.c @@ -26,6 +26,7 @@ #include #include #include +#include static void nvgpu_gr_ctx_unmap_global_ctx_buffers(struct gk20a *g, struct nvgpu_gr_ctx *gr_ctx, diff --git a/drivers/gpu/nvgpu/common/gr/global_ctx.c b/drivers/gpu/nvgpu/common/gr/global_ctx.c index 0b1dfdfdf..85b98aa33 100644 --- a/drivers/gpu/nvgpu/common/gr/global_ctx.c +++ b/drivers/gpu/nvgpu/common/gr/global_ctx.c @@ -25,6 +25,7 @@ #include #include #include +#include #include diff --git a/drivers/gpu/nvgpu/common/gr/gr_falcon.c b/drivers/gpu/nvgpu/common/gr/gr_falcon.c index e2b218d97..125899a4f 100644 --- a/drivers/gpu/nvgpu/common/gr/gr_falcon.c +++ b/drivers/gpu/nvgpu/common/gr/gr_falcon.c @@ -29,11 +29,11 @@ #include #include #include -#include #include #include #include #include +#include #include "gr_falcon_priv.h" diff --git a/drivers/gpu/nvgpu/common/gr/subctx.c b/drivers/gpu/nvgpu/common/gr/subctx.c index 42b7d84d8..0c10ce436 100644 --- a/drivers/gpu/nvgpu/common/gr/subctx.c +++ b/drivers/gpu/nvgpu/common/gr/subctx.c @@ -24,6 +24,7 @@ #include #include #include +#include #include "common/gr/subctx_priv.h" diff --git a/drivers/gpu/nvgpu/common/sec2/sec2.c b/drivers/gpu/nvgpu/common/sec2/sec2.c index ad472088e..d753ce63d 100644 --- a/drivers/gpu/nvgpu/common/sec2/sec2.c +++ b/drivers/gpu/nvgpu/common/sec2/sec2.c @@ -22,12 +22,9 @@ #include #include -#include -#include -#include +#include #include #include -#include #include #include diff --git a/drivers/gpu/nvgpu/common/sec2/sec2_cmd.c b/drivers/gpu/nvgpu/common/sec2/sec2_cmd.c index 1da4882df..032290cbd 100644 --- a/drivers/gpu/nvgpu/common/sec2/sec2_cmd.c +++ b/drivers/gpu/nvgpu/common/sec2/sec2_cmd.c @@ -23,9 +23,8 @@ #include #include #include -#include +#include #include -#include #include /* command post operation functions */ diff --git a/drivers/gpu/nvgpu/common/sec2/sec2_lsfm.c b/drivers/gpu/nvgpu/common/sec2/sec2_lsfm.c index 3dbb5a2d0..d3df9af59 100644 --- a/drivers/gpu/nvgpu/common/sec2/sec2_lsfm.c +++ b/drivers/gpu/nvgpu/common/sec2/sec2_lsfm.c @@ -25,7 +25,6 @@ #include #include #include -#include /* Add code below to handle SEC2 RTOS commands */ /* LSF's bootstrap command */ diff --git a/drivers/gpu/nvgpu/common/sec2/sec2_msg.c b/drivers/gpu/nvgpu/common/sec2/sec2_msg.c index 04fdfd0d2..504c457bf 100644 --- a/drivers/gpu/nvgpu/common/sec2/sec2_msg.c +++ b/drivers/gpu/nvgpu/common/sec2/sec2_msg.c @@ -20,14 +20,13 @@ * DEALINGS IN THE SOFTWARE. */ -#include #include #include #include #include +#include #include #include -#include /* Message/Event request handlers */ static int sec2_response_handle(struct nvgpu_sec2 *sec2, diff --git a/drivers/gpu/nvgpu/include/nvgpu/gk20a.h b/drivers/gpu/nvgpu/include/nvgpu/gk20a.h index 4414769ab..b7fa8af28 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/gk20a.h +++ b/drivers/gpu/nvgpu/include/nvgpu/gk20a.h @@ -100,7 +100,7 @@ typedef void (*global_ctx_mem_destroy_fn)(struct gk20a *g, #include #include #include -#include +#include #include #include #include diff --git a/drivers/gpu/nvgpu/include/nvgpu/sec2/msg.h b/drivers/gpu/nvgpu/include/nvgpu/sec2/msg.h index 1d137b415..979e63983 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/sec2/msg.h +++ b/drivers/gpu/nvgpu/include/nvgpu/sec2/msg.h @@ -24,7 +24,7 @@ #define NVGPU_SEC2_MSG_H #include -#include +#include #include #include diff --git a/drivers/gpu/nvgpu/include/nvgpu/sec2/queue_cmn.h b/drivers/gpu/nvgpu/include/nvgpu/sec2/queue_cmn.h deleted file mode 100644 index b6c73ce2a..000000000 --- a/drivers/gpu/nvgpu/include/nvgpu/sec2/queue_cmn.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - * 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_SEC2_CMN_H -#define NVGPU_SEC2_CMN_H - -/* - * Defines the logical queue IDs that must be used when submitting commands - * to or reading messages from SEC2. The identifiers must begin with zero and - * should increment sequentially. _CMDQ_LOG_ID__LAST must always be set to the - * last command queue identifier. _NUM must always be set to the last - * identifier plus one. - */ -#define SEC2_NV_CMDQ_LOG_ID 0U -#define SEC2_NV_CMDQ_LOG_ID__LAST 0U -#define SEC2_NV_MSGQ_LOG_ID 1U -#define SEC2_QUEUE_NUM 2U - -#endif /* NVGPU_SEC2_CMN_H */ diff --git a/drivers/gpu/nvgpu/include/nvgpu/sec2.h b/drivers/gpu/nvgpu/include/nvgpu/sec2/sec2.h similarity index 93% rename from drivers/gpu/nvgpu/include/nvgpu/sec2.h rename to drivers/gpu/nvgpu/include/nvgpu/sec2/sec2.h index 5fb89cec4..2bb119c97 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/sec2.h +++ b/drivers/gpu/nvgpu/include/nvgpu/sec2/sec2.h @@ -23,16 +23,16 @@ #ifndef NVGPU_SEC2_H #define NVGPU_SEC2_H -#include -#include #include #include #include -#include #include -#include #include -#include +#include + +struct gk20a; +struct nv_flcn_msg_sec2; +struct nvgpu_engine_mem_queue; #define nvgpu_sec2_dbg(g, fmt, args...) \ nvgpu_log(g, gpu_dbg_pmu, fmt, ##args) diff --git a/drivers/gpu/nvgpu/include/nvgpu/sec2if/sec2_if_cmn.h b/drivers/gpu/nvgpu/include/nvgpu/sec2/sec2_cmn.h similarity index 83% rename from drivers/gpu/nvgpu/include/nvgpu/sec2if/sec2_if_cmn.h rename to drivers/gpu/nvgpu/include/nvgpu/sec2/sec2_cmn.h index 92b8c903f..9952340c2 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/sec2if/sec2_if_cmn.h +++ b/drivers/gpu/nvgpu/include/nvgpu/sec2/sec2_cmn.h @@ -20,8 +20,20 @@ * DEALINGS IN THE SOFTWARE. */ -#ifndef NVGPU_SEC2_IF_CMN_H -#define NVGPU_SEC2_IF_CMN_H +#ifndef NVGPU_SEC2_CMN_H +#define NVGPU_SEC2_CMN_H + +/* + * Defines the logical queue IDs that must be used when submitting commands + * to or reading messages from SEC2. The identifiers must begin with zero and + * should increment sequentially. _CMDQ_LOG_ID__LAST must always be set to the + * last command queue identifier. _NUM must always be set to the last + * identifier plus one. + */ +#define SEC2_NV_CMDQ_LOG_ID 0U +#define SEC2_NV_CMDQ_LOG_ID__LAST 0U +#define SEC2_NV_MSGQ_LOG_ID 1U +#define SEC2_QUEUE_NUM 2U /* * Define the maximum number of command sequences that can be in flight at @@ -54,7 +66,8 @@ * enumeration that gives name to each index based on type of memory-aperture * the index is used to access. * - * Pre-Turing, NV_SEC2_DMAIDX_PHYS_VID_FN0 == NV_SEC2_DMAIDX_GUEST_PHYS_VID_BOUND. + * Pre-Turing, + * NV_SEC2_DMAIDX_PHYS_VID_FN0 == NV_SEC2_DMAIDX_GUEST_PHYS_VID_BOUND. * From Turing, engine context is stored in GPA, requiring a separate aperture. * * Traditionally, video falcons have used the 6th index for ucode, and we will @@ -75,4 +88,4 @@ #define NV_SEC2_DMAIDX_UCODE 6U #define NV_SEC2_DMAIDX_GUEST_PHYS_SYS_NCOH_BOUND 7U -#endif /* NVGPU_SEC2_IF_CMN_H */ +#endif /* NVGPU_SEC2_CMN_H */ diff --git a/drivers/gpu/nvgpu/tu104/sec2_tu104.c b/drivers/gpu/nvgpu/tu104/sec2_tu104.c index bbaf15311..0a110e8ca 100644 --- a/drivers/gpu/nvgpu/tu104/sec2_tu104.c +++ b/drivers/gpu/nvgpu/tu104/sec2_tu104.c @@ -28,7 +28,7 @@ #include #include #include -#include +#include #include #include diff --git a/userspace/units/mm/gmmu/pd_cache/pd_cache.c b/userspace/units/mm/gmmu/pd_cache/pd_cache.c index 32f3780b4..cab43046d 100644 --- a/userspace/units/mm/gmmu/pd_cache/pd_cache.c +++ b/userspace/units/mm/gmmu/pd_cache/pd_cache.c @@ -30,6 +30,7 @@ #include #include +#include #include #include diff --git a/userspace/units/mm/nvgpu_mem/nvgpu_mem.c b/userspace/units/mm/nvgpu_mem/nvgpu_mem.c index f3dcc4cbf..c26615aa8 100644 --- a/userspace/units/mm/nvgpu_mem/nvgpu_mem.c +++ b/userspace/units/mm/nvgpu_mem/nvgpu_mem.c @@ -30,6 +30,7 @@ #include #include #include +#include #include #include #include