diff options
author | Terje Bergstrom <tbergstrom@nvidia.com> | 2018-04-18 15:59:00 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2018-06-15 20:47:31 -0400 |
commit | 2a2c16af5f9f1ccfc93a13e820d5381e5c881e92 (patch) | |
tree | 2e5d7b042270a649978e5bb540857012c85fb5b5 /drivers/gpu/nvgpu/os/linux/os_linux.h | |
parent | 98d996f4ffb0137d119b5849cae46d7b7e5693e1 (diff) |
gpu: nvgpu: Move Linux files away from common
Move all Linux source code files to drivers/gpu/nvgpu/os/linux from
drivers/gpu/nvgpu/common/linux. This changes the meaning of common
to be OS independent.
JIRA NVGPU-598
JIRA NVGPU-601
Change-Id: Ib7f2a43d3688bb0d0b7dcc48469a6783fd988ce9
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1747714
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/os/linux/os_linux.h')
-rw-r--r-- | drivers/gpu/nvgpu/os/linux/os_linux.h | 166 |
1 files changed, 166 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/os/linux/os_linux.h b/drivers/gpu/nvgpu/os/linux/os_linux.h new file mode 100644 index 00000000..4dcce322 --- /dev/null +++ b/drivers/gpu/nvgpu/os/linux/os_linux.h | |||
@@ -0,0 +1,166 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2017-2018, NVIDIA CORPORATION. All rights reserved. | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify it | ||
5 | * under the terms and conditions of the GNU General Public License, | ||
6 | * version 2, as published by the Free Software Foundation. | ||
7 | * | ||
8 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
9 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
10 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
11 | * more details. | ||
12 | * | ||
13 | * You should have received a copy of the GNU General Public License | ||
14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
15 | */ | ||
16 | |||
17 | #ifndef NVGPU_OS_LINUX_H | ||
18 | #define NVGPU_OS_LINUX_H | ||
19 | |||
20 | #include <linux/cdev.h> | ||
21 | #include <linux/iommu.h> | ||
22 | #include <linux/hashtable.h> | ||
23 | |||
24 | #include "gk20a/gk20a.h" | ||
25 | #include "cde.h" | ||
26 | #include "sched.h" | ||
27 | |||
28 | struct nvgpu_os_linux_ops { | ||
29 | struct { | ||
30 | void (*get_program_numbers)(struct gk20a *g, | ||
31 | u32 block_height_log2, | ||
32 | u32 shader_parameter, | ||
33 | int *hprog, int *vprog); | ||
34 | bool (*need_scatter_buffer)(struct gk20a *g); | ||
35 | int (*populate_scatter_buffer)(struct gk20a *g, | ||
36 | struct sg_table *sgt, | ||
37 | size_t surface_size, | ||
38 | void *scatter_buffer_ptr, | ||
39 | size_t scatter_buffer_size); | ||
40 | } cde; | ||
41 | }; | ||
42 | |||
43 | struct nvgpu_os_linux { | ||
44 | struct gk20a g; | ||
45 | struct device *dev; | ||
46 | |||
47 | struct { | ||
48 | struct cdev cdev; | ||
49 | struct device *node; | ||
50 | } channel; | ||
51 | |||
52 | struct { | ||
53 | struct cdev cdev; | ||
54 | struct device *node; | ||
55 | } ctrl; | ||
56 | |||
57 | struct { | ||
58 | struct cdev cdev; | ||
59 | struct device *node; | ||
60 | } as_dev; | ||
61 | |||
62 | struct { | ||
63 | struct cdev cdev; | ||
64 | struct device *node; | ||
65 | } dbg; | ||
66 | |||
67 | struct { | ||
68 | struct cdev cdev; | ||
69 | struct device *node; | ||
70 | } prof; | ||
71 | |||
72 | struct { | ||
73 | struct cdev cdev; | ||
74 | struct device *node; | ||
75 | } tsg; | ||
76 | |||
77 | struct { | ||
78 | struct cdev cdev; | ||
79 | struct device *node; | ||
80 | } ctxsw; | ||
81 | |||
82 | struct { | ||
83 | struct cdev cdev; | ||
84 | struct device *node; | ||
85 | } sched; | ||
86 | |||
87 | dev_t cdev_region; | ||
88 | |||
89 | struct devfreq *devfreq; | ||
90 | |||
91 | struct device_dma_parameters dma_parms; | ||
92 | |||
93 | atomic_t hw_irq_stall_count; | ||
94 | atomic_t hw_irq_nonstall_count; | ||
95 | |||
96 | struct nvgpu_cond sw_irq_stall_last_handled_wq; | ||
97 | atomic_t sw_irq_stall_last_handled; | ||
98 | |||
99 | atomic_t nonstall_ops; | ||
100 | |||
101 | struct nvgpu_cond sw_irq_nonstall_last_handled_wq; | ||
102 | atomic_t sw_irq_nonstall_last_handled; | ||
103 | |||
104 | struct work_struct nonstall_fn_work; | ||
105 | struct workqueue_struct *nonstall_work_queue; | ||
106 | |||
107 | struct resource *reg_mem; | ||
108 | void __iomem *regs; | ||
109 | void __iomem *regs_saved; | ||
110 | |||
111 | struct resource *bar1_mem; | ||
112 | void __iomem *bar1; | ||
113 | void __iomem *bar1_saved; | ||
114 | |||
115 | void __iomem *usermode_regs; | ||
116 | void __iomem *usermode_regs_saved; | ||
117 | |||
118 | struct nvgpu_os_linux_ops ops; | ||
119 | |||
120 | #ifdef CONFIG_DEBUG_FS | ||
121 | struct dentry *debugfs; | ||
122 | struct dentry *debugfs_alias; | ||
123 | |||
124 | struct dentry *debugfs_ltc_enabled; | ||
125 | struct dentry *debugfs_timeouts_enabled; | ||
126 | struct dentry *debugfs_gr_idle_timeout_default; | ||
127 | struct dentry *debugfs_disable_bigpage; | ||
128 | struct dentry *debugfs_gr_default_attrib_cb_size; | ||
129 | |||
130 | struct dentry *debugfs_timeslice_low_priority_us; | ||
131 | struct dentry *debugfs_timeslice_medium_priority_us; | ||
132 | struct dentry *debugfs_timeslice_high_priority_us; | ||
133 | struct dentry *debugfs_runlist_interleave; | ||
134 | struct dentry *debugfs_allocators; | ||
135 | struct dentry *debugfs_xve; | ||
136 | struct dentry *debugfs_kmem; | ||
137 | struct dentry *debugfs_hal; | ||
138 | |||
139 | struct dentry *debugfs_force_preemption_cilp; | ||
140 | struct dentry *debugfs_force_preemption_gfxp; | ||
141 | struct dentry *debugfs_dump_ctxsw_stats; | ||
142 | #endif | ||
143 | DECLARE_HASHTABLE(ecc_sysfs_stats_htable, 5); | ||
144 | |||
145 | struct gk20a_cde_app cde_app; | ||
146 | |||
147 | struct rw_semaphore busy_lock; | ||
148 | |||
149 | struct gk20a_sched_ctrl sched_ctrl; | ||
150 | |||
151 | bool init_done; | ||
152 | }; | ||
153 | |||
154 | static inline struct nvgpu_os_linux *nvgpu_os_linux_from_gk20a(struct gk20a *g) | ||
155 | { | ||
156 | return container_of(g, struct nvgpu_os_linux, g); | ||
157 | } | ||
158 | |||
159 | static inline struct device *dev_from_gk20a(struct gk20a *g) | ||
160 | { | ||
161 | return nvgpu_os_linux_from_gk20a(g)->dev; | ||
162 | } | ||
163 | |||
164 | #define INTERFACE_NAME "nvhost%s-gpu" | ||
165 | |||
166 | #endif | ||