From db7bb6548b6f3c9da0f40a87ccbb9233c761c598 Mon Sep 17 00:00:00 2001 From: Debarshi Dutta Date: Thu, 2 Aug 2018 11:48:44 +0530 Subject: gpu: nvgpu: remove clk_arb.h to gk20a.h circular dependency clk_arb.h and gk20a.h has circular dependencies to each other. This is removed by forward declaring struct gk20a in clk_arb.h and removing the header gk20a.h from clk_arb.h and similarly forward declaring struct nvgpu_clk_arb in gk20a.h and removing the header clk_arb.h from gk20a.h alongwith putting headers in every execution unit which calls clk_arb.h related methods. JIRA NVGPU-597 Change-Id: I7cedca17206c148b21d93e5d7f0d88c2f98b979a Signed-off-by: Debarshi Dutta Reviewed-on: https://git-master.nvidia.com/r/1790915 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/boardobj/boardobjgrp.h | 4 +++- drivers/gpu/nvgpu/common/bus/bus_gk20a.c | 1 + drivers/gpu/nvgpu/common/posix/clk_arb.c | 1 + drivers/gpu/nvgpu/gk20a/gk20a.c | 1 + drivers/gpu/nvgpu/gk20a/gk20a.h | 2 +- drivers/gpu/nvgpu/gk20a/pmu_gk20a.c | 1 + drivers/gpu/nvgpu/gm20b/fifo_gm20b.c | 1 + drivers/gpu/nvgpu/gp106/clk_gp106.c | 2 ++ drivers/gpu/nvgpu/gp106/fifo_gp106.c | 2 ++ drivers/gpu/nvgpu/gp106/hal_gp106.c | 1 + drivers/gpu/nvgpu/gp106/pmu_gp106.c | 1 + drivers/gpu/nvgpu/gv100/hal_gv100.c | 1 + drivers/gpu/nvgpu/gv11b/hal_gv11b.c | 1 + drivers/gpu/nvgpu/include/nvgpu/clk_arb.h | 3 ++- drivers/gpu/nvgpu/lpwr/lpwr.c | 1 + drivers/gpu/nvgpu/os/linux/ioctl_ctrl.c | 2 ++ drivers/gpu/nvgpu/os/linux/module.c | 1 + drivers/gpu/nvgpu/perf/perf.c | 1 + drivers/gpu/nvgpu/vgpu/css_vgpu.c | 5 +++-- 19 files changed, 27 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/nvgpu/boardobj/boardobjgrp.h b/drivers/gpu/nvgpu/boardobj/boardobjgrp.h index f5701293..912c2c98 100644 --- a/drivers/gpu/nvgpu/boardobj/boardobjgrp.h +++ b/drivers/gpu/nvgpu/boardobj/boardobjgrp.h @@ -1,5 +1,5 @@ /* -* Copyright (c) 2016-2017, NVIDIA CORPORATION. All rights reserved. +* Copyright (c) 2016-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"), @@ -30,6 +30,8 @@ struct gk20a; #include "ctrl/ctrlboardobj.h" #include "boardobj.h" #include "boardobjgrpmask.h" +#include +#include /* * Board Object Group destructor. diff --git a/drivers/gpu/nvgpu/common/bus/bus_gk20a.c b/drivers/gpu/nvgpu/common/bus/bus_gk20a.c index d0091cee..5a424a50 100644 --- a/drivers/gpu/nvgpu/common/bus/bus_gk20a.c +++ b/drivers/gpu/nvgpu/common/bus/bus_gk20a.c @@ -24,6 +24,7 @@ #include #include #include +#include #include "gk20a/gk20a.h" #include "bus_gk20a.h" diff --git a/drivers/gpu/nvgpu/common/posix/clk_arb.c b/drivers/gpu/nvgpu/common/posix/clk_arb.c index f41383cd..2214b37b 100644 --- a/drivers/gpu/nvgpu/common/posix/clk_arb.c +++ b/drivers/gpu/nvgpu/common/posix/clk_arb.c @@ -20,6 +20,7 @@ * DEALINGS IN THE SOFTWARE. */ +#include #include /** diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.c b/drivers/gpu/nvgpu/gk20a/gk20a.c index 6a0b5bba..7fec4da7 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gk20a.c @@ -35,6 +35,7 @@ #include #include #include +#include #include diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.h b/drivers/gpu/nvgpu/gk20a/gk20a.h index 2f940553..ffa5e318 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/gk20a.h @@ -41,6 +41,7 @@ struct nvgpu_nvhost_dev; struct nvgpu_cpu_time_correlation_sample; struct nvgpu_mem_sgt; struct nvgpu_warpstate; +struct nvgpu_clk_arb; #ifdef CONFIG_GK20A_CTXSW_TRACE struct nvgpu_ctxsw_trace_filter; #endif @@ -59,7 +60,6 @@ struct nvgpu_ctxsw_trace_filter; #include #include #include -#include #include #include #include diff --git a/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c b/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c index 8dbeed40..90d6e15b 100644 --- a/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c @@ -32,6 +32,7 @@ #include #include #include +#include #include "gk20a.h" #include "gr_gk20a.h" diff --git a/drivers/gpu/nvgpu/gm20b/fifo_gm20b.c b/drivers/gpu/nvgpu/gm20b/fifo_gm20b.c index 73db1ae9..f0635b83 100644 --- a/drivers/gpu/nvgpu/gm20b/fifo_gm20b.c +++ b/drivers/gpu/nvgpu/gm20b/fifo_gm20b.c @@ -34,6 +34,7 @@ #include #include #include +#include #include #include diff --git a/drivers/gpu/nvgpu/gp106/clk_gp106.c b/drivers/gpu/nvgpu/gp106/clk_gp106.c index b1fa7cad..27a3039c 100644 --- a/drivers/gpu/nvgpu/gp106/clk_gp106.c +++ b/drivers/gpu/nvgpu/gp106/clk_gp106.c @@ -29,6 +29,8 @@ #include #include +#include +#include #include "gk20a/gk20a.h" #include "gp106/mclk_gp106.h" diff --git a/drivers/gpu/nvgpu/gp106/fifo_gp106.c b/drivers/gpu/nvgpu/gp106/fifo_gp106.c index 9b1dd768..c1428306 100644 --- a/drivers/gpu/nvgpu/gp106/fifo_gp106.c +++ b/drivers/gpu/nvgpu/gp106/fifo_gp106.c @@ -28,6 +28,8 @@ #include #include +#include + u32 gp106_fifo_get_num_fifos(struct gk20a *g) { return ccsr_channel__size_1_v(); diff --git a/drivers/gpu/nvgpu/gp106/hal_gp106.c b/drivers/gpu/nvgpu/gp106/hal_gp106.c index 286ed3c7..2cb43327 100644 --- a/drivers/gpu/nvgpu/gp106/hal_gp106.c +++ b/drivers/gpu/nvgpu/gp106/hal_gp106.c @@ -94,6 +94,7 @@ #include #include #include +#include #include #include diff --git a/drivers/gpu/nvgpu/gp106/pmu_gp106.c b/drivers/gpu/nvgpu/gp106/pmu_gp106.c index 005523dc..45924828 100644 --- a/drivers/gpu/nvgpu/gp106/pmu_gp106.c +++ b/drivers/gpu/nvgpu/gp106/pmu_gp106.c @@ -23,6 +23,7 @@ #include #include #include +#include #include "gk20a/gk20a.h" #include "gk20a/pmu_gk20a.h" diff --git a/drivers/gpu/nvgpu/gv100/hal_gv100.c b/drivers/gpu/nvgpu/gv100/hal_gv100.c index 55984add..b42c3432 100644 --- a/drivers/gpu/nvgpu/gv100/hal_gv100.c +++ b/drivers/gpu/nvgpu/gv100/hal_gv100.c @@ -108,6 +108,7 @@ #include #include #include +#include #include #include diff --git a/drivers/gpu/nvgpu/gv11b/hal_gv11b.c b/drivers/gpu/nvgpu/gv11b/hal_gv11b.c index 5f66d741..f93f977b 100644 --- a/drivers/gpu/nvgpu/gv11b/hal_gv11b.c +++ b/drivers/gpu/nvgpu/gv11b/hal_gv11b.c @@ -91,6 +91,7 @@ #include #include #include +#include #include #include diff --git a/drivers/gpu/nvgpu/include/nvgpu/clk_arb.h b/drivers/gpu/nvgpu/include/nvgpu/clk_arb.h index 0c9bbe06..328e03b5 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/clk_arb.h +++ b/drivers/gpu/nvgpu/include/nvgpu/clk_arb.h @@ -23,6 +23,8 @@ #ifndef __NVGPU_CLK_ARB_H__ #define __NVGPU_CLK_ARB_H__ +struct gk20a; + #include #include #include @@ -34,7 +36,6 @@ #include #include -#include "gk20a/gk20a.h" #include "clk/clk.h" #include "pstate/pstate.h" #include "lpwr/lpwr.h" diff --git a/drivers/gpu/nvgpu/lpwr/lpwr.c b/drivers/gpu/nvgpu/lpwr/lpwr.c index 751965e6..3be8269a 100644 --- a/drivers/gpu/nvgpu/lpwr/lpwr.c +++ b/drivers/gpu/nvgpu/lpwr/lpwr.c @@ -22,6 +22,7 @@ #include #include +#include #include "gk20a/gk20a.h" #include "gp106/bios_gp106.h" diff --git a/drivers/gpu/nvgpu/os/linux/ioctl_ctrl.c b/drivers/gpu/nvgpu/os/linux/ioctl_ctrl.c index e87d5822..8130b7d0 100644 --- a/drivers/gpu/nvgpu/os/linux/ioctl_ctrl.c +++ b/drivers/gpu/nvgpu/os/linux/ioctl_ctrl.c @@ -29,6 +29,8 @@ #include #include #include +#include +#include #include "ioctl_ctrl.h" #include "ioctl_dbg.h" diff --git a/drivers/gpu/nvgpu/os/linux/module.c b/drivers/gpu/nvgpu/os/linux/module.c index e3667947..46a82d86 100644 --- a/drivers/gpu/nvgpu/os/linux/module.c +++ b/drivers/gpu/nvgpu/os/linux/module.c @@ -42,6 +42,7 @@ #include #include #include +#include #include "platform_gk20a.h" #include "sysfs.h" diff --git a/drivers/gpu/nvgpu/perf/perf.c b/drivers/gpu/nvgpu/perf/perf.c index 900496fd..71bbcd40 100644 --- a/drivers/gpu/nvgpu/perf/perf.c +++ b/drivers/gpu/nvgpu/perf/perf.c @@ -22,6 +22,7 @@ #include #include +#include #include "gk20a/gk20a.h" #include "perf.h" diff --git a/drivers/gpu/nvgpu/vgpu/css_vgpu.c b/drivers/gpu/nvgpu/vgpu/css_vgpu.c index 0e44b81a..40ff8f90 100644 --- a/drivers/gpu/nvgpu/vgpu/css_vgpu.c +++ b/drivers/gpu/nvgpu/vgpu/css_vgpu.c @@ -25,6 +25,7 @@ #include #include #include +#include #include "gk20a/gk20a.h" #include "gk20a/channel_gk20a.h" @@ -43,13 +44,13 @@ static struct tegra_hv_ivm_cookie *vgpu_css_reserve_mempool(struct gk20a *g) err = nvgpu_dt_read_u32_index(g, "mempool-css", 1, &mempool); if (err) { nvgpu_err(g, "dt missing mempool-css"); - return ERR_PTR(err); + return (struct tegra_hv_ivm_cookie *)ERR_PTR(err); } cookie = vgpu_ivm_mempool_reserve(mempool); if (IS_ERR_OR_NULL(cookie)) { nvgpu_err(g, "mempool %u reserve failed", mempool); - return ERR_PTR(-EINVAL); + return (struct tegra_hv_ivm_cookie *)ERR_PTR(-EINVAL); } return cookie; } -- cgit v1.2.2