summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDebarshi Dutta <ddutta@nvidia.com>2018-08-02 02:18:44 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2018-08-08 23:14:16 -0400
commitdb7bb6548b6f3c9da0f40a87ccbb9233c761c598 (patch)
treeacadaacbd24ccb3f64784afffdaad7d1cdb3a884
parenta09b9cd587d27a3ef6479a17631c3497d447e7a9 (diff)
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 <ddutta@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1790915 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
-rw-r--r--drivers/gpu/nvgpu/boardobj/boardobjgrp.h4
-rw-r--r--drivers/gpu/nvgpu/common/bus/bus_gk20a.c1
-rw-r--r--drivers/gpu/nvgpu/common/posix/clk_arb.c1
-rw-r--r--drivers/gpu/nvgpu/gk20a/gk20a.c1
-rw-r--r--drivers/gpu/nvgpu/gk20a/gk20a.h2
-rw-r--r--drivers/gpu/nvgpu/gk20a/pmu_gk20a.c1
-rw-r--r--drivers/gpu/nvgpu/gm20b/fifo_gm20b.c1
-rw-r--r--drivers/gpu/nvgpu/gp106/clk_gp106.c2
-rw-r--r--drivers/gpu/nvgpu/gp106/fifo_gp106.c2
-rw-r--r--drivers/gpu/nvgpu/gp106/hal_gp106.c1
-rw-r--r--drivers/gpu/nvgpu/gp106/pmu_gp106.c1
-rw-r--r--drivers/gpu/nvgpu/gv100/hal_gv100.c1
-rw-r--r--drivers/gpu/nvgpu/gv11b/hal_gv11b.c1
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/clk_arb.h3
-rw-r--r--drivers/gpu/nvgpu/lpwr/lpwr.c1
-rw-r--r--drivers/gpu/nvgpu/os/linux/ioctl_ctrl.c2
-rw-r--r--drivers/gpu/nvgpu/os/linux/module.c1
-rw-r--r--drivers/gpu/nvgpu/perf/perf.c1
-rw-r--r--drivers/gpu/nvgpu/vgpu/css_vgpu.c5
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 @@
1/* 1/*
2* Copyright (c) 2016-2017, NVIDIA CORPORATION. All rights reserved. 2* Copyright (c) 2016-2018, NVIDIA CORPORATION. All rights reserved.
3* 3*
4 * Permission is hereby granted, free of charge, to any person obtaining a 4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"), 5 * copy of this software and associated documentation files (the "Software"),
@@ -30,6 +30,8 @@ struct gk20a;
30#include "ctrl/ctrlboardobj.h" 30#include "ctrl/ctrlboardobj.h"
31#include "boardobj.h" 31#include "boardobj.h"
32#include "boardobjgrpmask.h" 32#include "boardobjgrpmask.h"
33#include <nvgpu/list.h>
34#include <nvgpu/pmu.h>
33 35
34/* 36/*
35* Board Object Group destructor. 37* 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 @@
24#include <nvgpu/soc.h> 24#include <nvgpu/soc.h>
25#include <nvgpu/mm.h> 25#include <nvgpu/mm.h>
26#include <nvgpu/io.h> 26#include <nvgpu/io.h>
27#include <nvgpu/bug.h>
27 28
28#include "gk20a/gk20a.h" 29#include "gk20a/gk20a.h"
29#include "bus_gk20a.h" 30#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 @@
20 * DEALINGS IN THE SOFTWARE. 20 * DEALINGS IN THE SOFTWARE.
21 */ 21 */
22 22
23#include <nvgpu/list.h>
23#include <nvgpu/clk_arb.h> 24#include <nvgpu/clk_arb.h>
24 25
25/** 26/**
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 @@
35#include <nvgpu/mm.h> 35#include <nvgpu/mm.h>
36#include <nvgpu/ctxsw_trace.h> 36#include <nvgpu/ctxsw_trace.h>
37#include <nvgpu/soc.h> 37#include <nvgpu/soc.h>
38#include <nvgpu/clk_arb.h>
38 39
39#include <trace/events/gk20a.h> 40#include <trace/events/gk20a.h>
40 41
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;
41struct nvgpu_cpu_time_correlation_sample; 41struct nvgpu_cpu_time_correlation_sample;
42struct nvgpu_mem_sgt; 42struct nvgpu_mem_sgt;
43struct nvgpu_warpstate; 43struct nvgpu_warpstate;
44struct nvgpu_clk_arb;
44#ifdef CONFIG_GK20A_CTXSW_TRACE 45#ifdef CONFIG_GK20A_CTXSW_TRACE
45struct nvgpu_ctxsw_trace_filter; 46struct nvgpu_ctxsw_trace_filter;
46#endif 47#endif
@@ -59,7 +60,6 @@ struct nvgpu_ctxsw_trace_filter;
59#include <nvgpu/atomic.h> 60#include <nvgpu/atomic.h>
60#include <nvgpu/barrier.h> 61#include <nvgpu/barrier.h>
61#include <nvgpu/rwsem.h> 62#include <nvgpu/rwsem.h>
62#include <nvgpu/clk_arb.h>
63#include <nvgpu/nvlink.h> 63#include <nvgpu/nvlink.h>
64#include <nvgpu/sim.h> 64#include <nvgpu/sim.h>
65#include <nvgpu/ecc.h> 65#include <nvgpu/ecc.h>
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 @@
32#include <nvgpu/falcon.h> 32#include <nvgpu/falcon.h>
33#include <nvgpu/mm.h> 33#include <nvgpu/mm.h>
34#include <nvgpu/io.h> 34#include <nvgpu/io.h>
35#include <nvgpu/clk_arb.h>
35 36
36#include "gk20a.h" 37#include "gk20a.h"
37#include "gr_gk20a.h" 38#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 @@
34#include <nvgpu/mm.h> 34#include <nvgpu/mm.h>
35#include <nvgpu/enabled.h> 35#include <nvgpu/enabled.h>
36#include <nvgpu/io.h> 36#include <nvgpu/io.h>
37#include <nvgpu/bug.h>
37 38
38#include <nvgpu/hw/gm20b/hw_ccsr_gm20b.h> 39#include <nvgpu/hw/gm20b/hw_ccsr_gm20b.h>
39#include <nvgpu/hw/gm20b/hw_ram_gm20b.h> 40#include <nvgpu/hw/gm20b/hw_ram_gm20b.h>
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 @@
29 29
30#include <nvgpu/kmem.h> 30#include <nvgpu/kmem.h>
31#include <nvgpu/io.h> 31#include <nvgpu/io.h>
32#include <nvgpu/list.h>
33#include <nvgpu/clk_arb.h>
32 34
33#include "gk20a/gk20a.h" 35#include "gk20a/gk20a.h"
34#include "gp106/mclk_gp106.h" 36#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 @@
28#include <nvgpu/hw/gp106/hw_ccsr_gp106.h> 28#include <nvgpu/hw/gp106/hw_ccsr_gp106.h>
29#include <nvgpu/hw/gp106/hw_fifo_gp106.h> 29#include <nvgpu/hw/gp106/hw_fifo_gp106.h>
30 30
31#include <nvgpu/bug.h>
32
31u32 gp106_fifo_get_num_fifos(struct gk20a *g) 33u32 gp106_fifo_get_num_fifos(struct gk20a *g)
32{ 34{
33 return ccsr_channel__size_1_v(); 35 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 @@
94#include <nvgpu/enabled.h> 94#include <nvgpu/enabled.h>
95#include <nvgpu/ctxsw_trace.h> 95#include <nvgpu/ctxsw_trace.h>
96#include <nvgpu/error_notifier.h> 96#include <nvgpu/error_notifier.h>
97#include <nvgpu/clk_arb.h>
97 98
98#include <nvgpu/hw/gp106/hw_proj_gp106.h> 99#include <nvgpu/hw/gp106/hw_proj_gp106.h>
99#include <nvgpu/hw/gp106/hw_fifo_gp106.h> 100#include <nvgpu/hw/gp106/hw_fifo_gp106.h>
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 @@
23#include <nvgpu/pmu.h> 23#include <nvgpu/pmu.h>
24#include <nvgpu/enabled.h> 24#include <nvgpu/enabled.h>
25#include <nvgpu/io.h> 25#include <nvgpu/io.h>
26#include <nvgpu/clk_arb.h>
26 27
27#include "gk20a/gk20a.h" 28#include "gk20a/gk20a.h"
28#include "gk20a/pmu_gk20a.h" 29#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 @@
108#include <nvgpu/enabled.h> 108#include <nvgpu/enabled.h>
109#include <nvgpu/ctxsw_trace.h> 109#include <nvgpu/ctxsw_trace.h>
110#include <nvgpu/error_notifier.h> 110#include <nvgpu/error_notifier.h>
111#include <nvgpu/clk_arb.h>
111 112
112#include <nvgpu/hw/gv100/hw_proj_gv100.h> 113#include <nvgpu/hw/gv100/hw_proj_gv100.h>
113#include <nvgpu/hw/gv100/hw_fifo_gv100.h> 114#include <nvgpu/hw/gv100/hw_fifo_gv100.h>
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 @@
91#include <nvgpu/enabled.h> 91#include <nvgpu/enabled.h>
92#include <nvgpu/ctxsw_trace.h> 92#include <nvgpu/ctxsw_trace.h>
93#include <nvgpu/error_notifier.h> 93#include <nvgpu/error_notifier.h>
94#include <nvgpu/bug.h>
94 95
95#include <nvgpu/hw/gv11b/hw_proj_gv11b.h> 96#include <nvgpu/hw/gv11b/hw_proj_gv11b.h>
96#include <nvgpu/hw/gv11b/hw_fifo_gv11b.h> 97#include <nvgpu/hw/gv11b/hw_fifo_gv11b.h>
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 @@
23#ifndef __NVGPU_CLK_ARB_H__ 23#ifndef __NVGPU_CLK_ARB_H__
24#define __NVGPU_CLK_ARB_H__ 24#define __NVGPU_CLK_ARB_H__
25 25
26struct gk20a;
27
26#include <nvgpu/types.h> 28#include <nvgpu/types.h>
27#include <nvgpu/bitops.h> 29#include <nvgpu/bitops.h>
28#include <nvgpu/lock.h> 30#include <nvgpu/lock.h>
@@ -34,7 +36,6 @@
34#include <nvgpu/barrier.h> 36#include <nvgpu/barrier.h>
35#include <nvgpu/cond.h> 37#include <nvgpu/cond.h>
36 38
37#include "gk20a/gk20a.h"
38#include "clk/clk.h" 39#include "clk/clk.h"
39#include "pstate/pstate.h" 40#include "pstate/pstate.h"
40#include "lpwr/lpwr.h" 41#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 @@
22 22
23#include <nvgpu/bios.h> 23#include <nvgpu/bios.h>
24#include <nvgpu/pmu.h> 24#include <nvgpu/pmu.h>
25#include <nvgpu/clk_arb.h>
25 26
26#include "gk20a/gk20a.h" 27#include "gk20a/gk20a.h"
27#include "gp106/bios_gp106.h" 28#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 @@
29#include <nvgpu/log.h> 29#include <nvgpu/log.h>
30#include <nvgpu/enabled.h> 30#include <nvgpu/enabled.h>
31#include <nvgpu/sizes.h> 31#include <nvgpu/sizes.h>
32#include <nvgpu/list.h>
33#include <nvgpu/clk_arb.h>
32 34
33#include "ioctl_ctrl.h" 35#include "ioctl_ctrl.h"
34#include "ioctl_dbg.h" 36#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 @@
42#include <nvgpu/ctxsw_trace.h> 42#include <nvgpu/ctxsw_trace.h>
43#include <nvgpu/vidmem.h> 43#include <nvgpu/vidmem.h>
44#include <nvgpu/sim.h> 44#include <nvgpu/sim.h>
45#include <nvgpu/clk_arb.h>
45 46
46#include "platform_gk20a.h" 47#include "platform_gk20a.h"
47#include "sysfs.h" 48#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 @@
22 22
23#include <nvgpu/bug.h> 23#include <nvgpu/bug.h>
24#include <nvgpu/pmu.h> 24#include <nvgpu/pmu.h>
25#include <nvgpu/clk_arb.h>
25 26
26#include "gk20a/gk20a.h" 27#include "gk20a/gk20a.h"
27#include "perf.h" 28#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 @@
25#include <nvgpu/vgpu/vgpu.h> 25#include <nvgpu/vgpu/vgpu.h>
26#include <nvgpu/vgpu/tegra_vgpu.h> 26#include <nvgpu/vgpu/tegra_vgpu.h>
27#include <nvgpu/dt.h> 27#include <nvgpu/dt.h>
28#include <nvgpu/bug.h>
28 29
29#include "gk20a/gk20a.h" 30#include "gk20a/gk20a.h"
30#include "gk20a/channel_gk20a.h" 31#include "gk20a/channel_gk20a.h"
@@ -43,13 +44,13 @@ static struct tegra_hv_ivm_cookie *vgpu_css_reserve_mempool(struct gk20a *g)
43 err = nvgpu_dt_read_u32_index(g, "mempool-css", 1, &mempool); 44 err = nvgpu_dt_read_u32_index(g, "mempool-css", 1, &mempool);
44 if (err) { 45 if (err) {
45 nvgpu_err(g, "dt missing mempool-css"); 46 nvgpu_err(g, "dt missing mempool-css");
46 return ERR_PTR(err); 47 return (struct tegra_hv_ivm_cookie *)ERR_PTR(err);
47 } 48 }
48 49
49 cookie = vgpu_ivm_mempool_reserve(mempool); 50 cookie = vgpu_ivm_mempool_reserve(mempool);
50 if (IS_ERR_OR_NULL(cookie)) { 51 if (IS_ERR_OR_NULL(cookie)) {
51 nvgpu_err(g, "mempool %u reserve failed", mempool); 52 nvgpu_err(g, "mempool %u reserve failed", mempool);
52 return ERR_PTR(-EINVAL); 53 return (struct tegra_hv_ivm_cookie *)ERR_PTR(-EINVAL);
53 } 54 }
54 return cookie; 55 return cookie;
55} 56}