summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTerje Bergstrom <tbergstrom@nvidia.com>2017-07-02 15:30:20 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2017-07-07 16:44:55 -0400
commitcba424539d39ea184157f80b64938cfa31bc3924 (patch)
treea426a9256295a609bec499fc78244387b9a25ab5
parentdfd42c2b2800a9d4c0d99a1694e7040346418aaf (diff)
gpu: nvgpu: Move dev field from gk20a to nvgpu_os_linux
Move field "struct device *dev" from struct gk20a to struct nvgpu_os_linux. The field is valid only for Linux. JIRA NVGPU-38 Change-Id: I09286aa3a9c5a2406e5a27c1fbf21b2c515b4dd4 Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-on: https://git-master/r/1514162 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
-rw-r--r--drivers/gpu/nvgpu/clk/clk_arb.c1
-rw-r--r--drivers/gpu/nvgpu/common/linux/clk.c2
-rw-r--r--drivers/gpu/nvgpu/common/linux/debug.c1
-rw-r--r--drivers/gpu/nvgpu/common/linux/debug_allocator.c1
-rw-r--r--drivers/gpu/nvgpu/common/linux/debug_cde.c1
-rw-r--r--drivers/gpu/nvgpu/common/linux/debug_ce.c1
-rw-r--r--drivers/gpu/nvgpu/common/linux/debug_clk.c1
-rw-r--r--drivers/gpu/nvgpu/common/linux/debug_fifo.c1
-rw-r--r--drivers/gpu/nvgpu/common/linux/debug_gr.c1
-rw-r--r--drivers/gpu/nvgpu/common/linux/debug_mm.c1
-rw-r--r--drivers/gpu/nvgpu/common/linux/debug_pmu.c1
-rw-r--r--drivers/gpu/nvgpu/common/linux/debug_sched.c1
-rw-r--r--drivers/gpu/nvgpu/common/linux/dma.c1
-rw-r--r--drivers/gpu/nvgpu/common/linux/firmware.c1
-rw-r--r--drivers/gpu/nvgpu/common/linux/log.c1
-rw-r--r--drivers/gpu/nvgpu/common/linux/module.c2
-rw-r--r--drivers/gpu/nvgpu/common/linux/nvhost.c2
-rw-r--r--drivers/gpu/nvgpu/common/linux/os_linux.h6
-rw-r--r--drivers/gpu/nvgpu/common/linux/pci.c3
-rw-r--r--drivers/gpu/nvgpu/common/linux/platform_gk20a_tegra.c1
-rw-r--r--drivers/gpu/nvgpu/common/linux/vm.c1
-rw-r--r--drivers/gpu/nvgpu/gk20a/cde_gk20a.c2
-rw-r--r--drivers/gpu/nvgpu/gk20a/fecs_trace_gk20a.c1
-rw-r--r--drivers/gpu/nvgpu/gk20a/gk20a.h1
-rw-r--r--drivers/gpu/nvgpu/gk20a/gr_gk20a.c2
-rw-r--r--drivers/gpu/nvgpu/gk20a/mm_gk20a.c1
-rw-r--r--drivers/gpu/nvgpu/gk20a/platform_gk20a.h4
-rw-r--r--drivers/gpu/nvgpu/gm206/bios_gm206.c1
-rw-r--r--drivers/gpu/nvgpu/gm20b/gr_gm20b.c2
-rw-r--r--drivers/gpu/nvgpu/gp106/clk_gp106.c1
-rw-r--r--drivers/gpu/nvgpu/gp106/mclk_gp106.c1
-rw-r--r--drivers/gpu/nvgpu/gp106/therm_gp106.c1
-rw-r--r--drivers/gpu/nvgpu/gp10b/gr_gp10b.c2
-rw-r--r--drivers/gpu/nvgpu/gp10b/mm_gp10b.c2
-rw-r--r--drivers/gpu/nvgpu/pmgr/pmgr.c1
-rw-r--r--drivers/gpu/nvgpu/pmgr/pmgrpmu.c1
-rw-r--r--drivers/gpu/nvgpu/pmgr/pwrpolicy.c1
-rw-r--r--drivers/gpu/nvgpu/vgpu/vgpu.c2
-rw-r--r--drivers/gpu/nvgpu/vgpu/vgpu.h1
39 files changed, 44 insertions, 14 deletions
diff --git a/drivers/gpu/nvgpu/clk/clk_arb.c b/drivers/gpu/nvgpu/clk/clk_arb.c
index 05180a38..2cb7a42a 100644
--- a/drivers/gpu/nvgpu/clk/clk_arb.c
+++ b/drivers/gpu/nvgpu/clk/clk_arb.c
@@ -33,6 +33,7 @@
33 33
34#ifdef CONFIG_DEBUG_FS 34#ifdef CONFIG_DEBUG_FS
35#include "gk20a/platform_gk20a.h" 35#include "gk20a/platform_gk20a.h"
36#include "common/linux/os_linux.h"
36#endif 37#endif
37 38
38#define MAX_F_POINTS 256 39#define MAX_F_POINTS 256
diff --git a/drivers/gpu/nvgpu/common/linux/clk.c b/drivers/gpu/nvgpu/common/linux/clk.c
index f24445b3..892b892a 100644
--- a/drivers/gpu/nvgpu/common/linux/clk.c
+++ b/drivers/gpu/nvgpu/common/linux/clk.c
@@ -22,6 +22,8 @@
22#include <soc/tegra/tegra-dvfs.h> 22#include <soc/tegra/tegra-dvfs.h>
23 23
24#include "clk.h" 24#include "clk.h"
25#include "os_linux.h"
26
25#include "gk20a/gk20a.h" 27#include "gk20a/gk20a.h"
26#include "gk20a/platform_gk20a.h" 28#include "gk20a/platform_gk20a.h"
27 29
diff --git a/drivers/gpu/nvgpu/common/linux/debug.c b/drivers/gpu/nvgpu/common/linux/debug.c
index 9fd09efe..f24c6ae7 100644
--- a/drivers/gpu/nvgpu/common/linux/debug.c
+++ b/drivers/gpu/nvgpu/common/linux/debug.c
@@ -21,6 +21,7 @@
21#include "debug_kmem.h" 21#include "debug_kmem.h"
22#include "debug_pmu.h" 22#include "debug_pmu.h"
23#include "debug_sched.h" 23#include "debug_sched.h"
24#include "os_linux.h"
24 25
25#include "gk20a/gk20a.h" 26#include "gk20a/gk20a.h"
26#include "gk20a/platform_gk20a.h" 27#include "gk20a/platform_gk20a.h"
diff --git a/drivers/gpu/nvgpu/common/linux/debug_allocator.c b/drivers/gpu/nvgpu/common/linux/debug_allocator.c
index 9102b989..dfc1dc41 100644
--- a/drivers/gpu/nvgpu/common/linux/debug_allocator.c
+++ b/drivers/gpu/nvgpu/common/linux/debug_allocator.c
@@ -14,6 +14,7 @@
14 14
15#include "debug_allocator.h" 15#include "debug_allocator.h"
16#include "gk20a/platform_gk20a.h" 16#include "gk20a/platform_gk20a.h"
17#include "os_linux.h"
17 18
18#include <linux/debugfs.h> 19#include <linux/debugfs.h>
19#include <linux/seq_file.h> 20#include <linux/seq_file.h>
diff --git a/drivers/gpu/nvgpu/common/linux/debug_cde.c b/drivers/gpu/nvgpu/common/linux/debug_cde.c
index d3aab3cd..8fcc6e84 100644
--- a/drivers/gpu/nvgpu/common/linux/debug_cde.c
+++ b/drivers/gpu/nvgpu/common/linux/debug_cde.c
@@ -14,6 +14,7 @@
14 14
15#include "debug_cde.h" 15#include "debug_cde.h"
16#include "gk20a/platform_gk20a.h" 16#include "gk20a/platform_gk20a.h"
17#include "os_linux.h"
17 18
18#include <linux/debugfs.h> 19#include <linux/debugfs.h>
19 20
diff --git a/drivers/gpu/nvgpu/common/linux/debug_ce.c b/drivers/gpu/nvgpu/common/linux/debug_ce.c
index 95f0d2ad..1c2d4170 100644
--- a/drivers/gpu/nvgpu/common/linux/debug_ce.c
+++ b/drivers/gpu/nvgpu/common/linux/debug_ce.c
@@ -14,6 +14,7 @@
14 14
15#include "debug_ce.h" 15#include "debug_ce.h"
16#include "gk20a/platform_gk20a.h" 16#include "gk20a/platform_gk20a.h"
17#include "os_linux.h"
17 18
18#include <linux/debugfs.h> 19#include <linux/debugfs.h>
19 20
diff --git a/drivers/gpu/nvgpu/common/linux/debug_clk.c b/drivers/gpu/nvgpu/common/linux/debug_clk.c
index 5bbe4127..8ffba3c8 100644
--- a/drivers/gpu/nvgpu/common/linux/debug_clk.c
+++ b/drivers/gpu/nvgpu/common/linux/debug_clk.c
@@ -18,6 +18,7 @@
18 18
19#include "gk20a/platform_gk20a.h" 19#include "gk20a/platform_gk20a.h"
20#include "gm20b/clk_gm20b.h" 20#include "gm20b/clk_gm20b.h"
21#include "os_linux.h"
21 22
22static int rate_get(void *data, u64 *val) 23static int rate_get(void *data, u64 *val)
23{ 24{
diff --git a/drivers/gpu/nvgpu/common/linux/debug_fifo.c b/drivers/gpu/nvgpu/common/linux/debug_fifo.c
index 1fba1868..1245c093 100644
--- a/drivers/gpu/nvgpu/common/linux/debug_fifo.c
+++ b/drivers/gpu/nvgpu/common/linux/debug_fifo.c
@@ -14,6 +14,7 @@
14 14
15#include "debug_fifo.h" 15#include "debug_fifo.h"
16#include "gk20a/platform_gk20a.h" 16#include "gk20a/platform_gk20a.h"
17#include "os_linux.h"
17 18
18#include <linux/debugfs.h> 19#include <linux/debugfs.h>
19#include <linux/seq_file.h> 20#include <linux/seq_file.h>
diff --git a/drivers/gpu/nvgpu/common/linux/debug_gr.c b/drivers/gpu/nvgpu/common/linux/debug_gr.c
index 1045fe0b..732c2a7e 100644
--- a/drivers/gpu/nvgpu/common/linux/debug_gr.c
+++ b/drivers/gpu/nvgpu/common/linux/debug_gr.c
@@ -14,6 +14,7 @@
14 14
15#include "debug_gr.h" 15#include "debug_gr.h"
16#include "gk20a/platform_gk20a.h" 16#include "gk20a/platform_gk20a.h"
17#include "os_linux.h"
17 18
18#include <linux/debugfs.h> 19#include <linux/debugfs.h>
19 20
diff --git a/drivers/gpu/nvgpu/common/linux/debug_mm.c b/drivers/gpu/nvgpu/common/linux/debug_mm.c
index dcb83112..bed8d10b 100644
--- a/drivers/gpu/nvgpu/common/linux/debug_mm.c
+++ b/drivers/gpu/nvgpu/common/linux/debug_mm.c
@@ -14,6 +14,7 @@
14 14
15#include "debug_mm.h" 15#include "debug_mm.h"
16#include "gk20a/platform_gk20a.h" 16#include "gk20a/platform_gk20a.h"
17#include "os_linux.h"
17 18
18#include <linux/debugfs.h> 19#include <linux/debugfs.h>
19 20
diff --git a/drivers/gpu/nvgpu/common/linux/debug_pmu.c b/drivers/gpu/nvgpu/common/linux/debug_pmu.c
index 8c3607b5..1c0b2520 100644
--- a/drivers/gpu/nvgpu/common/linux/debug_pmu.c
+++ b/drivers/gpu/nvgpu/common/linux/debug_pmu.c
@@ -15,6 +15,7 @@
15#include <nvgpu/enabled.h> 15#include <nvgpu/enabled.h>
16#include "debug_pmu.h" 16#include "debug_pmu.h"
17#include "gk20a/platform_gk20a.h" 17#include "gk20a/platform_gk20a.h"
18#include "os_linux.h"
18 19
19#include <linux/debugfs.h> 20#include <linux/debugfs.h>
20#include <linux/seq_file.h> 21#include <linux/seq_file.h>
diff --git a/drivers/gpu/nvgpu/common/linux/debug_sched.c b/drivers/gpu/nvgpu/common/linux/debug_sched.c
index 73fb890f..c0dcf8d9 100644
--- a/drivers/gpu/nvgpu/common/linux/debug_sched.c
+++ b/drivers/gpu/nvgpu/common/linux/debug_sched.c
@@ -14,6 +14,7 @@
14 14
15#include "debug_sched.h" 15#include "debug_sched.h"
16#include "gk20a/platform_gk20a.h" 16#include "gk20a/platform_gk20a.h"
17#include "os_linux.h"
17 18
18#include <linux/debugfs.h> 19#include <linux/debugfs.h>
19#include <linux/seq_file.h> 20#include <linux/seq_file.h>
diff --git a/drivers/gpu/nvgpu/common/linux/dma.c b/drivers/gpu/nvgpu/common/linux/dma.c
index 5fee878a..6473aed9 100644
--- a/drivers/gpu/nvgpu/common/linux/dma.c
+++ b/drivers/gpu/nvgpu/common/linux/dma.c
@@ -27,6 +27,7 @@
27 27
28#include "gk20a/gk20a.h" 28#include "gk20a/gk20a.h"
29#include "gk20a/platform_gk20a.h" 29#include "gk20a/platform_gk20a.h"
30#include "os_linux.h"
30 31
31#if defined(CONFIG_GK20A_VIDMEM) 32#if defined(CONFIG_GK20A_VIDMEM)
32static u64 __nvgpu_dma_alloc(struct nvgpu_allocator *allocator, dma_addr_t at, 33static u64 __nvgpu_dma_alloc(struct nvgpu_allocator *allocator, dma_addr_t at,
diff --git a/drivers/gpu/nvgpu/common/linux/firmware.c b/drivers/gpu/nvgpu/common/linux/firmware.c
index 549e83ae..b49bc4a3 100644
--- a/drivers/gpu/nvgpu/common/linux/firmware.c
+++ b/drivers/gpu/nvgpu/common/linux/firmware.c
@@ -22,6 +22,7 @@
22 22
23#include "gk20a/gk20a.h" 23#include "gk20a/gk20a.h"
24#include "gk20a/platform_gk20a.h" 24#include "gk20a/platform_gk20a.h"
25#include "os_linux.h"
25 26
26static const struct firmware *do_request_firmware(struct device *dev, 27static const struct firmware *do_request_firmware(struct device *dev,
27 const char *prefix, const char *fw_name, int flags) 28 const char *prefix, const char *fw_name, int flags)
diff --git a/drivers/gpu/nvgpu/common/linux/log.c b/drivers/gpu/nvgpu/common/linux/log.c
index 9883acfc..e2cebee8 100644
--- a/drivers/gpu/nvgpu/common/linux/log.c
+++ b/drivers/gpu/nvgpu/common/linux/log.c
@@ -21,6 +21,7 @@
21 21
22#include "gk20a/gk20a.h" 22#include "gk20a/gk20a.h"
23#include "gk20a/platform_gk20a.h" 23#include "gk20a/platform_gk20a.h"
24#include "os_linux.h"
24 25
25/* 26/*
26 * Define a length for log buffers. This is the buffer that the 'fmt, ...' part 27 * Define a length for log buffers. This is the buffer that the 'fmt, ...' part
diff --git a/drivers/gpu/nvgpu/common/linux/module.c b/drivers/gpu/nvgpu/common/linux/module.c
index 0b5dfec8..2f6dd4c7 100644
--- a/drivers/gpu/nvgpu/common/linux/module.c
+++ b/drivers/gpu/nvgpu/common/linux/module.c
@@ -865,7 +865,7 @@ static int gk20a_probe(struct platform_device *dev)
865 865
866 gk20a = &l->g; 866 gk20a = &l->g;
867 set_gk20a(dev, gk20a); 867 set_gk20a(dev, gk20a);
868 gk20a->dev = &dev->dev; 868 l->dev = &dev->dev;
869 gk20a->log_mask = NVGPU_DEFAULT_DBG_MASK; 869 gk20a->log_mask = NVGPU_DEFAULT_DBG_MASK;
870 870
871 nvgpu_kmem_init(gk20a); 871 nvgpu_kmem_init(gk20a);
diff --git a/drivers/gpu/nvgpu/common/linux/nvhost.c b/drivers/gpu/nvgpu/common/linux/nvhost.c
index 8e337529..611351ae 100644
--- a/drivers/gpu/nvgpu/common/linux/nvhost.c
+++ b/drivers/gpu/nvgpu/common/linux/nvhost.c
@@ -23,7 +23,7 @@
23#include "nvhost_priv.h" 23#include "nvhost_priv.h"
24 24
25#include "gk20a/gk20a.h" 25#include "gk20a/gk20a.h"
26#include "gk20a/platform_gk20a.h" 26#include "os_linux.h"
27 27
28int nvgpu_get_nvhost_dev(struct gk20a *g) 28int nvgpu_get_nvhost_dev(struct gk20a *g)
29{ 29{
diff --git a/drivers/gpu/nvgpu/common/linux/os_linux.h b/drivers/gpu/nvgpu/common/linux/os_linux.h
index e39d3c4d..cf012acc 100644
--- a/drivers/gpu/nvgpu/common/linux/os_linux.h
+++ b/drivers/gpu/nvgpu/common/linux/os_linux.h
@@ -22,6 +22,7 @@
22 22
23struct nvgpu_os_linux { 23struct nvgpu_os_linux {
24 struct gk20a g; 24 struct gk20a g;
25 struct device *dev;
25 26
26 struct { 27 struct {
27 struct cdev cdev; 28 struct cdev cdev;
@@ -75,6 +76,11 @@ static inline struct nvgpu_os_linux *nvgpu_os_linux_from_gk20a(struct gk20a *g)
75 return container_of(g, struct nvgpu_os_linux, g); 76 return container_of(g, struct nvgpu_os_linux, g);
76} 77}
77 78
79static inline struct device *dev_from_gk20a(struct gk20a *g)
80{
81 return nvgpu_os_linux_from_gk20a(g)->dev;
82}
83
78#define INTERFACE_NAME "nvhost%s-gpu" 84#define INTERFACE_NAME "nvhost%s-gpu"
79 85
80#endif 86#endif
diff --git a/drivers/gpu/nvgpu/common/linux/pci.c b/drivers/gpu/nvgpu/common/linux/pci.c
index 15435934..3a452d18 100644
--- a/drivers/gpu/nvgpu/common/linux/pci.c
+++ b/drivers/gpu/nvgpu/common/linux/pci.c
@@ -29,6 +29,7 @@
29#include "module.h" 29#include "module.h"
30#include "intr.h" 30#include "intr.h"
31#include "sysfs.h" 31#include "sysfs.h"
32#include "os_linux.h"
32 33
33#include "pci.h" 34#include "pci.h"
34 35
@@ -367,7 +368,7 @@ static int nvgpu_pci_probe(struct pci_dev *pdev,
367 } 368 }
368 369
369 platform->g = g; 370 platform->g = g;
370 g->dev = &pdev->dev; 371 l->dev = &pdev->dev;
371 372
372 err = pci_enable_device(pdev); 373 err = pci_enable_device(pdev);
373 if (err) 374 if (err)
diff --git a/drivers/gpu/nvgpu/common/linux/platform_gk20a_tegra.c b/drivers/gpu/nvgpu/common/linux/platform_gk20a_tegra.c
index 000e9eee..a28f1094 100644
--- a/drivers/gpu/nvgpu/common/linux/platform_gk20a_tegra.c
+++ b/drivers/gpu/nvgpu/common/linux/platform_gk20a_tegra.c
@@ -52,6 +52,7 @@
52#include "gm20b/clk_gm20b.h" 52#include "gm20b/clk_gm20b.h"
53 53
54#include "clk.h" 54#include "clk.h"
55#include "os_linux.h"
55 56
56#include "../../../arch/arm/mach-tegra/iomap.h" 57#include "../../../arch/arm/mach-tegra/iomap.h"
57 58
diff --git a/drivers/gpu/nvgpu/common/linux/vm.c b/drivers/gpu/nvgpu/common/linux/vm.c
index cbacbdc0..d47d6bb1 100644
--- a/drivers/gpu/nvgpu/common/linux/vm.c
+++ b/drivers/gpu/nvgpu/common/linux/vm.c
@@ -29,6 +29,7 @@
29#include "gk20a/platform_gk20a.h" 29#include "gk20a/platform_gk20a.h"
30 30
31#include "vm_priv.h" 31#include "vm_priv.h"
32#include "os_linux.h"
32 33
33static struct nvgpu_mapped_buf *__nvgpu_vm_find_mapped_buf_reverse( 34static struct nvgpu_mapped_buf *__nvgpu_vm_find_mapped_buf_reverse(
34 struct vm_gk20a *vm, struct dma_buf *dmabuf, u32 kind) 35 struct vm_gk20a *vm, struct dma_buf *dmabuf, u32 kind)
diff --git a/drivers/gpu/nvgpu/gk20a/cde_gk20a.c b/drivers/gpu/nvgpu/gk20a/cde_gk20a.c
index 0413ae6a..506207f2 100644
--- a/drivers/gpu/nvgpu/gk20a/cde_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/cde_gk20a.c
@@ -37,7 +37,7 @@
37#include "cde_gk20a.h" 37#include "cde_gk20a.h"
38#include "fence_gk20a.h" 38#include "fence_gk20a.h"
39#include "gr_gk20a.h" 39#include "gr_gk20a.h"
40#include "platform_gk20a.h" 40#include "common/linux/os_linux.h"
41 41
42#include <nvgpu/hw/gk20a/hw_ccsr_gk20a.h> 42#include <nvgpu/hw/gk20a/hw_ccsr_gk20a.h>
43#include <nvgpu/hw/gk20a/hw_pbdma_gk20a.h> 43#include <nvgpu/hw/gk20a/hw_pbdma_gk20a.h>
diff --git a/drivers/gpu/nvgpu/gk20a/fecs_trace_gk20a.c b/drivers/gpu/nvgpu/gk20a/fecs_trace_gk20a.c
index aca9df75..0b26f657 100644
--- a/drivers/gpu/nvgpu/gk20a/fecs_trace_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/fecs_trace_gk20a.c
@@ -28,6 +28,7 @@
28#include "gk20a.h" 28#include "gk20a.h"
29#include "gr_gk20a.h" 29#include "gr_gk20a.h"
30#include "platform_gk20a.h" 30#include "platform_gk20a.h"
31#include "common/linux/os_linux.h"
31 32
32#include <nvgpu/log.h> 33#include <nvgpu/log.h>
33 34
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.h b/drivers/gpu/nvgpu/gk20a/gk20a.h
index dd5f0d17..90d3338a 100644
--- a/drivers/gpu/nvgpu/gk20a/gk20a.h
+++ b/drivers/gpu/nvgpu/gk20a/gk20a.h
@@ -1019,7 +1019,6 @@ struct nvgpu_bios {
1019}; 1019};
1020 1020
1021struct gk20a { 1021struct gk20a {
1022 struct device *dev;
1023 struct nvgpu_nvhost_dev *nvhost_dev; 1022 struct nvgpu_nvhost_dev *nvhost_dev;
1024 1023
1025 /* 1024 /*
diff --git a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c
index 4dfb6ee8..d853c4f0 100644
--- a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c
@@ -39,7 +39,7 @@
39#include "regops_gk20a.h" 39#include "regops_gk20a.h"
40#include "dbg_gpu_gk20a.h" 40#include "dbg_gpu_gk20a.h"
41#include "ctxsw_trace_gk20a.h" 41#include "ctxsw_trace_gk20a.h"
42#include "platform_gk20a.h" 42#include "common/linux/os_linux.h"
43 43
44#include <nvgpu/hw/gk20a/hw_ccsr_gk20a.h> 44#include <nvgpu/hw/gk20a/hw_ccsr_gk20a.h>
45#include <nvgpu/hw/gk20a/hw_ctxsw_prog_gk20a.h> 45#include <nvgpu/hw/gk20a/hw_ctxsw_prog_gk20a.h>
diff --git a/drivers/gpu/nvgpu/gk20a/mm_gk20a.c b/drivers/gpu/nvgpu/gk20a/mm_gk20a.c
index 759e6a2b..d984d1f9 100644
--- a/drivers/gpu/nvgpu/gk20a/mm_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/mm_gk20a.c
@@ -49,6 +49,7 @@
49#include "fence_gk20a.h" 49#include "fence_gk20a.h"
50#include "kind_gk20a.h" 50#include "kind_gk20a.h"
51#include "bus_gk20a.h" 51#include "bus_gk20a.h"
52#include "common/linux/os_linux.h"
52 53
53#include <nvgpu/hw/gk20a/hw_gmmu_gk20a.h> 54#include <nvgpu/hw/gk20a/hw_gmmu_gk20a.h>
54#include <nvgpu/hw/gk20a/hw_ram_gk20a.h> 55#include <nvgpu/hw/gk20a/hw_ram_gk20a.h>
diff --git a/drivers/gpu/nvgpu/gk20a/platform_gk20a.h b/drivers/gpu/nvgpu/gk20a/platform_gk20a.h
index 81402ad0..17c3f9a4 100644
--- a/drivers/gpu/nvgpu/gk20a/platform_gk20a.h
+++ b/drivers/gpu/nvgpu/gk20a/platform_gk20a.h
@@ -259,10 +259,6 @@ static inline struct gk20a *get_gk20a(struct device *dev)
259{ 259{
260 return gk20a_get_platform(dev)->g; 260 return gk20a_get_platform(dev)->g;
261} 261}
262static inline struct device *dev_from_gk20a(struct gk20a *g)
263{
264 return g->dev;
265}
266static inline struct gk20a *gk20a_from_dev(struct device *dev) 262static inline struct gk20a *gk20a_from_dev(struct device *dev)
267{ 263{
268 if (!dev) 264 if (!dev)
diff --git a/drivers/gpu/nvgpu/gm206/bios_gm206.c b/drivers/gpu/nvgpu/gm206/bios_gm206.c
index 9407bf3a..476affa0 100644
--- a/drivers/gpu/nvgpu/gm206/bios_gm206.c
+++ b/drivers/gpu/nvgpu/gm206/bios_gm206.c
@@ -25,6 +25,7 @@
25#include "gm20b/fifo_gm20b.h" 25#include "gm20b/fifo_gm20b.h"
26#include "bios_gm206.h" 26#include "bios_gm206.h"
27#include "gp106/mclk_gp106.h" 27#include "gp106/mclk_gp106.h"
28#include "common/linux/os_linux.h"
28 29
29#include <nvgpu/hw/gm206/hw_pwr_gm206.h> 30#include <nvgpu/hw/gm206/hw_pwr_gm206.h>
30#include <nvgpu/hw/gm206/hw_mc_gm206.h> 31#include <nvgpu/hw/gm206/hw_mc_gm206.h>
diff --git a/drivers/gpu/nvgpu/gm20b/gr_gm20b.c b/drivers/gpu/nvgpu/gm20b/gr_gm20b.c
index 90046232..1ff295c2 100644
--- a/drivers/gpu/nvgpu/gm20b/gr_gm20b.c
+++ b/drivers/gpu/nvgpu/gm20b/gr_gm20b.c
@@ -23,7 +23,7 @@
23 23
24#include "gk20a/gk20a.h" 24#include "gk20a/gk20a.h"
25#include "gk20a/gr_gk20a.h" 25#include "gk20a/gr_gk20a.h"
26#include "gk20a/platform_gk20a.h" 26#include "common/linux/os_linux.h"
27 27
28#include "gr_gm20b.h" 28#include "gr_gm20b.h"
29#include "pmu_gm20b.h" 29#include "pmu_gm20b.h"
diff --git a/drivers/gpu/nvgpu/gp106/clk_gp106.c b/drivers/gpu/nvgpu/gp106/clk_gp106.c
index 332ad413..e9aec7ac 100644
--- a/drivers/gpu/nvgpu/gp106/clk_gp106.c
+++ b/drivers/gpu/nvgpu/gp106/clk_gp106.c
@@ -26,6 +26,7 @@
26#ifdef CONFIG_DEBUG_FS 26#ifdef CONFIG_DEBUG_FS
27#include "gk20a/platform_gk20a.h" 27#include "gk20a/platform_gk20a.h"
28#endif 28#endif
29#include "common/linux/os_linux.h"
29 30
30#include "clk_gp106.h" 31#include "clk_gp106.h"
31#include "clk/clk_arb.h" 32#include "clk/clk_arb.h"
diff --git a/drivers/gpu/nvgpu/gp106/mclk_gp106.c b/drivers/gpu/nvgpu/gp106/mclk_gp106.c
index 283847a9..47ba4ea9 100644
--- a/drivers/gpu/nvgpu/gp106/mclk_gp106.c
+++ b/drivers/gpu/nvgpu/gp106/mclk_gp106.c
@@ -19,6 +19,7 @@
19#include "gk20a/gk20a.h" 19#include "gk20a/gk20a.h"
20#ifdef CONFIG_DEBUG_FS 20#ifdef CONFIG_DEBUG_FS
21#include "gk20a/platform_gk20a.h" 21#include "gk20a/platform_gk20a.h"
22#include "common/linux/os_linux.h"
22#endif 23#endif
23#include "gp106/mclk_gp106.h" 24#include "gp106/mclk_gp106.h"
24 25
diff --git a/drivers/gpu/nvgpu/gp106/therm_gp106.c b/drivers/gpu/nvgpu/gp106/therm_gp106.c
index 1781a17f..dacebe93 100644
--- a/drivers/gpu/nvgpu/gp106/therm_gp106.c
+++ b/drivers/gpu/nvgpu/gp106/therm_gp106.c
@@ -17,6 +17,7 @@
17#ifdef CONFIG_DEBUG_FS 17#ifdef CONFIG_DEBUG_FS
18#include <linux/debugfs.h> 18#include <linux/debugfs.h>
19#include "gk20a/platform_gk20a.h" 19#include "gk20a/platform_gk20a.h"
20#include "common/linux/os_linux.h"
20#endif 21#endif
21 22
22#include <nvgpu/hw/gp106/hw_therm_gp106.h> 23#include <nvgpu/hw/gp106/hw_therm_gp106.h>
diff --git a/drivers/gpu/nvgpu/gp10b/gr_gp10b.c b/drivers/gpu/nvgpu/gp10b/gr_gp10b.c
index 4ff306e0..d9d045bd 100644
--- a/drivers/gpu/nvgpu/gp10b/gr_gp10b.c
+++ b/drivers/gpu/nvgpu/gp10b/gr_gp10b.c
@@ -28,7 +28,7 @@
28#include "gk20a/gr_gk20a.h" 28#include "gk20a/gr_gk20a.h"
29#include "gk20a/dbg_gpu_gk20a.h" 29#include "gk20a/dbg_gpu_gk20a.h"
30#include "gk20a/regops_gk20a.h" 30#include "gk20a/regops_gk20a.h"
31#include "gk20a/platform_gk20a.h" 31#include "common/linux/os_linux.h"
32 32
33#include "gm20b/gr_gm20b.h" 33#include "gm20b/gr_gm20b.h"
34#include "gp10b/gr_gp10b.h" 34#include "gp10b/gr_gp10b.h"
diff --git a/drivers/gpu/nvgpu/gp10b/mm_gp10b.c b/drivers/gpu/nvgpu/gp10b/mm_gp10b.c
index 612d59f7..1ac778e0 100644
--- a/drivers/gpu/nvgpu/gp10b/mm_gp10b.c
+++ b/drivers/gpu/nvgpu/gp10b/mm_gp10b.c
@@ -17,10 +17,10 @@
17#include <nvgpu/gmmu.h> 17#include <nvgpu/gmmu.h>
18 18
19#include "gk20a/gk20a.h" 19#include "gk20a/gk20a.h"
20#include "gk20a/platform_gk20a.h"
21#include "gm20b/mm_gm20b.h" 20#include "gm20b/mm_gm20b.h"
22#include "mm_gp10b.h" 21#include "mm_gp10b.h"
23#include "rpfb_gp10b.h" 22#include "rpfb_gp10b.h"
23#include "common/linux/os_linux.h"
24 24
25#include <nvgpu/hw/gp10b/hw_fb_gp10b.h> 25#include <nvgpu/hw/gp10b/hw_fb_gp10b.h>
26#include <nvgpu/hw/gp10b/hw_ram_gp10b.h> 26#include <nvgpu/hw/gp10b/hw_ram_gp10b.h>
diff --git a/drivers/gpu/nvgpu/pmgr/pmgr.c b/drivers/gpu/nvgpu/pmgr/pmgr.c
index 1b004832..b1c9ef79 100644
--- a/drivers/gpu/nvgpu/pmgr/pmgr.c
+++ b/drivers/gpu/nvgpu/pmgr/pmgr.c
@@ -18,6 +18,7 @@
18#ifdef CONFIG_DEBUG_FS 18#ifdef CONFIG_DEBUG_FS
19#include <linux/debugfs.h> 19#include <linux/debugfs.h>
20#include "gk20a/platform_gk20a.h" 20#include "gk20a/platform_gk20a.h"
21#include "common/linux/os_linux.h"
21#endif 22#endif
22 23
23int pmgr_pwr_devices_get_power(struct gk20a *g, u32 *val) 24int pmgr_pwr_devices_get_power(struct gk20a *g, u32 *val)
diff --git a/drivers/gpu/nvgpu/pmgr/pmgrpmu.c b/drivers/gpu/nvgpu/pmgr/pmgrpmu.c
index 803b1bc0..eda296df 100644
--- a/drivers/gpu/nvgpu/pmgr/pmgrpmu.c
+++ b/drivers/gpu/nvgpu/pmgr/pmgrpmu.c
@@ -18,6 +18,7 @@
18#include "gk20a/gk20a.h" 18#include "gk20a/gk20a.h"
19#include "gk20a/platform_gk20a.h" 19#include "gk20a/platform_gk20a.h"
20#include "gm206/bios_gm206.h" 20#include "gm206/bios_gm206.h"
21#include "common/linux/os_linux.h"
21 22
22#include "boardobj/boardobjgrp.h" 23#include "boardobj/boardobjgrp.h"
23#include "boardobj/boardobjgrp_e32.h" 24#include "boardobj/boardobjgrp_e32.h"
diff --git a/drivers/gpu/nvgpu/pmgr/pwrpolicy.c b/drivers/gpu/nvgpu/pmgr/pwrpolicy.c
index 3c3c7a96..970d9953 100644
--- a/drivers/gpu/nvgpu/pmgr/pwrpolicy.c
+++ b/drivers/gpu/nvgpu/pmgr/pwrpolicy.c
@@ -20,6 +20,7 @@
20#include "boardobj/boardobjgrp.h" 20#include "boardobj/boardobjgrp.h"
21#include "boardobj/boardobjgrp_e32.h" 21#include "boardobj/boardobjgrp_e32.h"
22#include "gm206/bios_gm206.h" 22#include "gm206/bios_gm206.h"
23#include "common/linux/os_linux.h"
23 24
24#define _pwr_policy_limitarboutputget_helper(p_limit_arb) (p_limit_arb)->output 25#define _pwr_policy_limitarboutputget_helper(p_limit_arb) (p_limit_arb)->output
25#define _pwr_policy_limitdeltaapply(limit, delta) ((u32)max(((s32)limit) + (delta), 0)) 26#define _pwr_policy_limitdeltaapply(limit, delta) ((u32)max(((s32)limit) + (delta), 0))
diff --git a/drivers/gpu/nvgpu/vgpu/vgpu.c b/drivers/gpu/nvgpu/vgpu/vgpu.c
index bd52dc0a..c8929e93 100644
--- a/drivers/gpu/nvgpu/vgpu/vgpu.c
+++ b/drivers/gpu/nvgpu/vgpu/vgpu.c
@@ -677,7 +677,7 @@ int vgpu_probe(struct platform_device *pdev)
677 return err; 677 return err;
678 } 678 }
679 679
680 gk20a->dev = dev; 680 l->dev = dev;
681 if (tegra_platform_is_linsim() || tegra_platform_is_vdk()) 681 if (tegra_platform_is_linsim() || tegra_platform_is_vdk())
682 __nvgpu_set_enabled(gk20a, NVGPU_IS_FMODEL, true); 682 __nvgpu_set_enabled(gk20a, NVGPU_IS_FMODEL, true);
683 683
diff --git a/drivers/gpu/nvgpu/vgpu/vgpu.h b/drivers/gpu/nvgpu/vgpu/vgpu.h
index 92b82ac4..cee81bb1 100644
--- a/drivers/gpu/nvgpu/vgpu/vgpu.h
+++ b/drivers/gpu/nvgpu/vgpu/vgpu.h
@@ -20,6 +20,7 @@
20#include <linux/tegra_vgpu.h> 20#include <linux/tegra_vgpu.h>
21#include "gk20a/gk20a.h" 21#include "gk20a/gk20a.h"
22#include "gk20a/platform_gk20a.h" 22#include "gk20a/platform_gk20a.h"
23#include "common/linux/os_linux.h"
23 24
24#include <nvgpu/thread.h> 25#include <nvgpu/thread.h>
25 26