From 06fd513e1e71c863637f61ca906e277711ae5d40 Mon Sep 17 00:00:00 2001 From: Philip Elcan Date: Fri, 11 Oct 2019 16:43:07 -0400 Subject: [PATCH] gpu: nvgpu: move common.unit into common.mc nvgpu.common.unit was just an enum used for passing to nvgpu.common.mc APIs. So, move the enum into mc.h, and replace the include of unit.h with mc.h where appropriate. And update the yaml arch. JIRA NVGPU-4144 Change-Id: I210ea4d3b49cd494e43add1b52f3fbcdb020a1e3 Signed-off-by: Philip Elcan Reviewed-on: https://git-master.nvidia.com/r/2216106 Reviewed-by: mobile promotions Tested-by: mobile promotions --- arch/nvgpu-common.yaml | 5 --- drivers/gpu/nvgpu/common/debugger.c | 1 - drivers/gpu/nvgpu/common/gr/gr.c | 2 +- .../nvgpu/common/perf/cyclestats_snapshot.c | 1 - drivers/gpu/nvgpu/hal/fb/fb_gv100.c | 2 +- drivers/gpu/nvgpu/hal/fifo/fifo_gk20a.c | 2 +- drivers/gpu/nvgpu/hal/fifo/fifo_gk20a_fusa.c | 1 - drivers/gpu/nvgpu/hal/fifo/fifo_gv11b_fusa.c | 2 +- .../gpu/nvgpu/hal/fifo/preempt_gv11b_fusa.c | 1 - drivers/gpu/nvgpu/hal/mc/mc_gm20b.c | 1 - drivers/gpu/nvgpu/hal/mc/mc_gm20b_fusa.c | 1 - drivers/gpu/nvgpu/hal/mc/mc_gp10b.c | 1 - drivers/gpu/nvgpu/hal/mc/mc_gp10b_fusa.c | 1 - drivers/gpu/nvgpu/hal/mc/mc_gv100.c | 1 - drivers/gpu/nvgpu/hal/perf/perf_gm20b.c | 2 +- drivers/gpu/nvgpu/hal/perf/perf_gv11b.c | 2 +- drivers/gpu/nvgpu/hal/pmu/pmu_gk20a.c | 2 +- drivers/gpu/nvgpu/hal/rc/rc_gk20a.c | 1 - drivers/gpu/nvgpu/include/nvgpu/gk20a.h | 2 +- drivers/gpu/nvgpu/include/nvgpu/mc.h | 17 +++++++- drivers/gpu/nvgpu/include/nvgpu/unit.h | 41 ------------------- drivers/gpu/nvgpu/os/linux/intr.c | 1 - 22 files changed, 24 insertions(+), 66 deletions(-) delete mode 100644 drivers/gpu/nvgpu/include/nvgpu/unit.h diff --git a/arch/nvgpu-common.yaml b/arch/nvgpu-common.yaml index 836727266..9b6104fac 100644 --- a/arch/nvgpu-common.yaml +++ b/arch/nvgpu-common.yaml @@ -194,11 +194,6 @@ sim: include/nvgpu/hw_sim_pci.h, include/nvgpu/sim.h ] -unit: - safe: yes - owner: Terje B - sources: [ include/nvgpu/unit.h ] - utils: safe: yes owner: Terje B diff --git a/drivers/gpu/nvgpu/common/debugger.c b/drivers/gpu/nvgpu/common/debugger.c index f5e5046a3..b0d468c8e 100644 --- a/drivers/gpu/nvgpu/common/debugger.c +++ b/drivers/gpu/nvgpu/common/debugger.c @@ -31,7 +31,6 @@ #include #include #include -#include #include #include #include diff --git a/drivers/gpu/nvgpu/common/gr/gr.c b/drivers/gpu/nvgpu/common/gr/gr.c index e4aa349ae..c749eef3e 100644 --- a/drivers/gpu/nvgpu/common/gr/gr.c +++ b/drivers/gpu/nvgpu/common/gr/gr.c @@ -23,7 +23,6 @@ #include #include #include -#include #include #include #include @@ -42,6 +41,7 @@ #include #include #include +#include #include "gr_priv.h" diff --git a/drivers/gpu/nvgpu/common/perf/cyclestats_snapshot.c b/drivers/gpu/nvgpu/common/perf/cyclestats_snapshot.c index 75b7c2e57..ae324bb27 100644 --- a/drivers/gpu/nvgpu/common/perf/cyclestats_snapshot.c +++ b/drivers/gpu/nvgpu/common/perf/cyclestats_snapshot.c @@ -35,7 +35,6 @@ #include #include #include -#include #include /* check client for pointed perfmon ownership */ diff --git a/drivers/gpu/nvgpu/hal/fb/fb_gv100.c b/drivers/gpu/nvgpu/hal/fb/fb_gv100.c index 50c17c7dc..e70fec417 100644 --- a/drivers/gpu/nvgpu/hal/fb/fb_gv100.c +++ b/drivers/gpu/nvgpu/hal/fb/fb_gv100.c @@ -38,8 +38,8 @@ #include #include #include -#include #include +#include #include "fb_gv100.h" diff --git a/drivers/gpu/nvgpu/hal/fifo/fifo_gk20a.c b/drivers/gpu/nvgpu/hal/fifo/fifo_gk20a.c index 10262b826..4bbafba62 100644 --- a/drivers/gpu/nvgpu/hal/fifo/fifo_gk20a.c +++ b/drivers/gpu/nvgpu/hal/fifo/fifo_gk20a.c @@ -26,8 +26,8 @@ #include #include #include -#include #include +#include #include "hal/fifo/fifo_gk20a.h" diff --git a/drivers/gpu/nvgpu/hal/fifo/fifo_gk20a_fusa.c b/drivers/gpu/nvgpu/hal/fifo/fifo_gk20a_fusa.c index 2c1fc2fbd..e24fb7743 100644 --- a/drivers/gpu/nvgpu/hal/fifo/fifo_gk20a_fusa.c +++ b/drivers/gpu/nvgpu/hal/fifo/fifo_gk20a_fusa.c @@ -26,7 +26,6 @@ #include #include #include -#include #include #include "hal/fifo/fifo_gk20a.h" diff --git a/drivers/gpu/nvgpu/hal/fifo/fifo_gv11b_fusa.c b/drivers/gpu/nvgpu/hal/fifo/fifo_gv11b_fusa.c index b35bbd287..77ca03cae 100644 --- a/drivers/gpu/nvgpu/hal/fifo/fifo_gv11b_fusa.c +++ b/drivers/gpu/nvgpu/hal/fifo/fifo_gv11b_fusa.c @@ -27,9 +27,9 @@ #include #include #include -#include #include #include +#include #include diff --git a/drivers/gpu/nvgpu/hal/fifo/preempt_gv11b_fusa.c b/drivers/gpu/nvgpu/hal/fifo/preempt_gv11b_fusa.c index e21095170..62db24058 100644 --- a/drivers/gpu/nvgpu/hal/fifo/preempt_gv11b_fusa.c +++ b/drivers/gpu/nvgpu/hal/fifo/preempt_gv11b_fusa.c @@ -31,7 +31,6 @@ #include #include #include -#include #include #include #include diff --git a/drivers/gpu/nvgpu/hal/mc/mc_gm20b.c b/drivers/gpu/nvgpu/hal/mc/mc_gm20b.c index 746a998ee..06224da01 100644 --- a/drivers/gpu/nvgpu/hal/mc/mc_gm20b.c +++ b/drivers/gpu/nvgpu/hal/mc/mc_gm20b.c @@ -24,7 +24,6 @@ #include #include -#include #include #include #include diff --git a/drivers/gpu/nvgpu/hal/mc/mc_gm20b_fusa.c b/drivers/gpu/nvgpu/hal/mc/mc_gm20b_fusa.c index fe7ee0f68..a8feecf9b 100644 --- a/drivers/gpu/nvgpu/hal/mc/mc_gm20b_fusa.c +++ b/drivers/gpu/nvgpu/hal/mc/mc_gm20b_fusa.c @@ -24,7 +24,6 @@ #include #include -#include #include #include #include diff --git a/drivers/gpu/nvgpu/hal/mc/mc_gp10b.c b/drivers/gpu/nvgpu/hal/mc/mc_gp10b.c index 40ac22eac..0f217c27d 100644 --- a/drivers/gpu/nvgpu/hal/mc/mc_gp10b.c +++ b/drivers/gpu/nvgpu/hal/mc/mc_gp10b.c @@ -32,7 +32,6 @@ #include "mc_gp10b.h" #include -#include #include diff --git a/drivers/gpu/nvgpu/hal/mc/mc_gp10b_fusa.c b/drivers/gpu/nvgpu/hal/mc/mc_gp10b_fusa.c index 3c7507b54..444df56ed 100644 --- a/drivers/gpu/nvgpu/hal/mc/mc_gp10b_fusa.c +++ b/drivers/gpu/nvgpu/hal/mc/mc_gp10b_fusa.c @@ -32,7 +32,6 @@ #include "mc_gp10b.h" #include -#include #include diff --git a/drivers/gpu/nvgpu/hal/mc/mc_gv100.c b/drivers/gpu/nvgpu/hal/mc/mc_gv100.c index 3fc9b500e..9fca5820f 100644 --- a/drivers/gpu/nvgpu/hal/mc/mc_gv100.c +++ b/drivers/gpu/nvgpu/hal/mc/mc_gv100.c @@ -26,7 +26,6 @@ #include #include #include -#include #include #include diff --git a/drivers/gpu/nvgpu/hal/perf/perf_gm20b.c b/drivers/gpu/nvgpu/hal/perf/perf_gm20b.c index 6ff7dfc39..1b93dab18 100644 --- a/drivers/gpu/nvgpu/hal/perf/perf_gm20b.c +++ b/drivers/gpu/nvgpu/hal/perf/perf_gm20b.c @@ -23,8 +23,8 @@ #include #include #include -#include #include +#include #include "perf_gm20b.h" diff --git a/drivers/gpu/nvgpu/hal/perf/perf_gv11b.c b/drivers/gpu/nvgpu/hal/perf/perf_gv11b.c index c6ef4c902..0e50e588e 100644 --- a/drivers/gpu/nvgpu/hal/perf/perf_gv11b.c +++ b/drivers/gpu/nvgpu/hal/perf/perf_gv11b.c @@ -23,8 +23,8 @@ #include #include #include -#include #include +#include #include "perf_gv11b.h" diff --git a/drivers/gpu/nvgpu/hal/pmu/pmu_gk20a.c b/drivers/gpu/nvgpu/hal/pmu/pmu_gk20a.c index 25ce93d22..57896ab58 100644 --- a/drivers/gpu/nvgpu/hal/pmu/pmu_gk20a.c +++ b/drivers/gpu/nvgpu/hal/pmu/pmu_gk20a.c @@ -24,12 +24,12 @@ #include #include #include -#include #include #include #include #include #include +#include #include diff --git a/drivers/gpu/nvgpu/hal/rc/rc_gk20a.c b/drivers/gpu/nvgpu/hal/rc/rc_gk20a.c index 913891e39..ec408c679 100644 --- a/drivers/gpu/nvgpu/hal/rc/rc_gk20a.c +++ b/drivers/gpu/nvgpu/hal/rc/rc_gk20a.c @@ -28,7 +28,6 @@ #include #include #include -#include #include #include #include diff --git a/drivers/gpu/nvgpu/include/nvgpu/gk20a.h b/drivers/gpu/nvgpu/include/nvgpu/gk20a.h index 025cdf1f4..8d3702dd1 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/gk20a.h +++ b/drivers/gpu/nvgpu/include/nvgpu/gk20a.h @@ -104,6 +104,7 @@ struct pmu_pg_stats_data; enum nvgpu_flush_op; enum gk20a_mem_rw_flag; enum nvgpu_nvlink_minion_dlcmd; +enum nvgpu_unit; #include #include @@ -129,7 +130,6 @@ enum nvgpu_nvlink_minion_dlcmd; #include #include #include -#include #include #include diff --git a/drivers/gpu/nvgpu/include/nvgpu/mc.h b/drivers/gpu/nvgpu/include/nvgpu/mc.h index 3c012f99b..5016ed45d 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/mc.h +++ b/drivers/gpu/nvgpu/include/nvgpu/mc.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2018-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"), @@ -27,6 +27,21 @@ struct gk20a; +/** + * Enumeration of all units intended to be used by any HAL that requires + * unit as parameter. + * + * Units are added to the enumeration as needed, so it is not complete. + */ +enum nvgpu_unit { + NVGPU_UNIT_FIFO, + NVGPU_UNIT_PERFMON, + NVGPU_UNIT_GRAPH, + NVGPU_UNIT_BLG, + NVGPU_UNIT_PWR, + NVGPU_UNIT_NVDEC, +}; + #define NVGPU_MC_INTR_STALLING 0U #define NVGPU_MC_INTR_NONSTALLING 1U diff --git a/drivers/gpu/nvgpu/include/nvgpu/unit.h b/drivers/gpu/nvgpu/include/nvgpu/unit.h deleted file mode 100644 index 11df652a5..000000000 --- a/drivers/gpu/nvgpu/include/nvgpu/unit.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017-2018, 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_UNIT_H -#define NVGPU_UNIT_H - -/* - * Enumeration of all units intended to be used by any HAL that requires - * unit as parameter. - * - * Units are added to the enumeration as needed, so it is not complete. - */ -enum nvgpu_unit { - NVGPU_UNIT_FIFO, - NVGPU_UNIT_PERFMON, - NVGPU_UNIT_GRAPH, - NVGPU_UNIT_BLG, - NVGPU_UNIT_PWR, - NVGPU_UNIT_NVDEC, -}; - -#endif /* NVGPU_UNIT_H */ diff --git a/drivers/gpu/nvgpu/os/linux/intr.c b/drivers/gpu/nvgpu/os/linux/intr.c index 31ea2f931..546c82cbe 100644 --- a/drivers/gpu/nvgpu/os/linux/intr.c +++ b/drivers/gpu/nvgpu/os/linux/intr.c @@ -20,7 +20,6 @@ #include #include -#include #include "os_linux.h" irqreturn_t nvgpu_intr_stall(struct gk20a *g)