diff options
author | Peter Daifuku <pdaifuku@nvidia.com> | 2017-10-06 19:27:14 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-10-13 18:20:18 -0400 |
commit | 57fb527a7e33384341fc18f1f918d5a8225057f5 (patch) | |
tree | 23bb49f879ac495834237c99564f0589d637f07e /drivers/gpu/nvgpu/vgpu/fecs_trace_vgpu.c | |
parent | 3d343c9eeaa3415851d1c71b8815eb7dc2677b5a (diff) |
gpu: nvgpu: vgpu: flatten out vgpu hal
Instead of calling the native HAL init function then adding
multiple layers of modification for VGPU, flatten out the sequence
so that all entry points are set statically and visible in a
single file.
JIRA ESRM-30
Change-Id: Ie424abb48bce5038874851d399baac5e4bb7d27c
Signed-off-by: Peter Daifuku <pdaifuku@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1574616
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/vgpu/fecs_trace_vgpu.c')
-rw-r--r-- | drivers/gpu/nvgpu/vgpu/fecs_trace_vgpu.c | 41 |
1 files changed, 11 insertions, 30 deletions
diff --git a/drivers/gpu/nvgpu/vgpu/fecs_trace_vgpu.c b/drivers/gpu/nvgpu/vgpu/fecs_trace_vgpu.c index 84de9d0b..762cc10a 100644 --- a/drivers/gpu/nvgpu/vgpu/fecs_trace_vgpu.c +++ b/drivers/gpu/nvgpu/vgpu/fecs_trace_vgpu.c | |||
@@ -41,7 +41,7 @@ struct vgpu_fecs_trace { | |||
41 | void *buf; | 41 | void *buf; |
42 | }; | 42 | }; |
43 | 43 | ||
44 | static int vgpu_fecs_trace_init(struct gk20a *g) | 44 | int vgpu_fecs_trace_init(struct gk20a *g) |
45 | { | 45 | { |
46 | struct device *dev = dev_from_gk20a(g); | 46 | struct device *dev = dev_from_gk20a(g); |
47 | struct device_node *np = dev->of_node; | 47 | struct device_node *np = dev->of_node; |
@@ -102,7 +102,7 @@ fail: | |||
102 | return err; | 102 | return err; |
103 | } | 103 | } |
104 | 104 | ||
105 | static int vgpu_fecs_trace_deinit(struct gk20a *g) | 105 | int vgpu_fecs_trace_deinit(struct gk20a *g) |
106 | { | 106 | { |
107 | struct vgpu_fecs_trace *vcst = (struct vgpu_fecs_trace *)g->fecs_trace; | 107 | struct vgpu_fecs_trace *vcst = (struct vgpu_fecs_trace *)g->fecs_trace; |
108 | 108 | ||
@@ -112,7 +112,7 @@ static int vgpu_fecs_trace_deinit(struct gk20a *g) | |||
112 | return 0; | 112 | return 0; |
113 | } | 113 | } |
114 | 114 | ||
115 | static int vgpu_fecs_trace_enable(struct gk20a *g) | 115 | int vgpu_fecs_trace_enable(struct gk20a *g) |
116 | { | 116 | { |
117 | struct vgpu_fecs_trace *vcst = (struct vgpu_fecs_trace *)g->fecs_trace; | 117 | struct vgpu_fecs_trace *vcst = (struct vgpu_fecs_trace *)g->fecs_trace; |
118 | struct tegra_vgpu_cmd_msg msg = { | 118 | struct tegra_vgpu_cmd_msg msg = { |
@@ -128,7 +128,7 @@ static int vgpu_fecs_trace_enable(struct gk20a *g) | |||
128 | return err; | 128 | return err; |
129 | } | 129 | } |
130 | 130 | ||
131 | static int vgpu_fecs_trace_disable(struct gk20a *g) | 131 | int vgpu_fecs_trace_disable(struct gk20a *g) |
132 | { | 132 | { |
133 | struct vgpu_fecs_trace *vcst = (struct vgpu_fecs_trace *)g->fecs_trace; | 133 | struct vgpu_fecs_trace *vcst = (struct vgpu_fecs_trace *)g->fecs_trace; |
134 | struct tegra_vgpu_cmd_msg msg = { | 134 | struct tegra_vgpu_cmd_msg msg = { |
@@ -144,14 +144,14 @@ static int vgpu_fecs_trace_disable(struct gk20a *g) | |||
144 | return err; | 144 | return err; |
145 | } | 145 | } |
146 | 146 | ||
147 | static bool vpgpu_fecs_trace_is_enabled(struct gk20a *g) | 147 | bool vgpu_fecs_trace_is_enabled(struct gk20a *g) |
148 | { | 148 | { |
149 | struct vgpu_fecs_trace *vcst = (struct vgpu_fecs_trace *)g->fecs_trace; | 149 | struct vgpu_fecs_trace *vcst = (struct vgpu_fecs_trace *)g->fecs_trace; |
150 | 150 | ||
151 | return (vcst && vcst->enabled); | 151 | return (vcst && vcst->enabled); |
152 | } | 152 | } |
153 | 153 | ||
154 | static int vgpu_fecs_trace_poll(struct gk20a *g) | 154 | int vgpu_fecs_trace_poll(struct gk20a *g) |
155 | { | 155 | { |
156 | struct tegra_vgpu_cmd_msg msg = { | 156 | struct tegra_vgpu_cmd_msg msg = { |
157 | .cmd = TEGRA_VGPU_CMD_FECS_TRACE_POLL, | 157 | .cmd = TEGRA_VGPU_CMD_FECS_TRACE_POLL, |
@@ -165,7 +165,7 @@ static int vgpu_fecs_trace_poll(struct gk20a *g) | |||
165 | return err; | 165 | return err; |
166 | } | 166 | } |
167 | 167 | ||
168 | static int vgpu_alloc_user_buffer(struct gk20a *g, void **buf, size_t *size) | 168 | int vgpu_alloc_user_buffer(struct gk20a *g, void **buf, size_t *size) |
169 | { | 169 | { |
170 | struct vgpu_fecs_trace *vcst = (struct vgpu_fecs_trace *)g->fecs_trace; | 170 | struct vgpu_fecs_trace *vcst = (struct vgpu_fecs_trace *)g->fecs_trace; |
171 | 171 | ||
@@ -174,12 +174,12 @@ static int vgpu_alloc_user_buffer(struct gk20a *g, void **buf, size_t *size) | |||
174 | return 0; | 174 | return 0; |
175 | } | 175 | } |
176 | 176 | ||
177 | static int vgpu_free_user_buffer(struct gk20a *g) | 177 | int vgpu_free_user_buffer(struct gk20a *g) |
178 | { | 178 | { |
179 | return 0; | 179 | return 0; |
180 | } | 180 | } |
181 | 181 | ||
182 | static int vgpu_mmap_user_buffer(struct gk20a *g, struct vm_area_struct *vma) | 182 | int vgpu_mmap_user_buffer(struct gk20a *g, struct vm_area_struct *vma) |
183 | { | 183 | { |
184 | struct vgpu_fecs_trace *vcst = (struct vgpu_fecs_trace *)g->fecs_trace; | 184 | struct vgpu_fecs_trace *vcst = (struct vgpu_fecs_trace *)g->fecs_trace; |
185 | unsigned long size = vcst->cookie->size; | 185 | unsigned long size = vcst->cookie->size; |
@@ -194,7 +194,7 @@ static int vgpu_mmap_user_buffer(struct gk20a *g, struct vm_area_struct *vma) | |||
194 | vma->vm_page_prot); | 194 | vma->vm_page_prot); |
195 | } | 195 | } |
196 | 196 | ||
197 | static int vgpu_fecs_trace_max_entries(struct gk20a *g, | 197 | int vgpu_fecs_trace_max_entries(struct gk20a *g, |
198 | struct nvgpu_ctxsw_trace_filter *filter) | 198 | struct nvgpu_ctxsw_trace_filter *filter) |
199 | { | 199 | { |
200 | struct vgpu_fecs_trace *vcst = (struct vgpu_fecs_trace *)g->fecs_trace; | 200 | struct vgpu_fecs_trace *vcst = (struct vgpu_fecs_trace *)g->fecs_trace; |
@@ -206,7 +206,7 @@ static int vgpu_fecs_trace_max_entries(struct gk20a *g, | |||
206 | #error "FECS trace filter size mismatch!" | 206 | #error "FECS trace filter size mismatch!" |
207 | #endif | 207 | #endif |
208 | 208 | ||
209 | static int vgpu_fecs_trace_set_filter(struct gk20a *g, | 209 | int vgpu_fecs_trace_set_filter(struct gk20a *g, |
210 | struct nvgpu_ctxsw_trace_filter *filter) | 210 | struct nvgpu_ctxsw_trace_filter *filter) |
211 | { | 211 | { |
212 | struct tegra_vgpu_cmd_msg msg = { | 212 | struct tegra_vgpu_cmd_msg msg = { |
@@ -223,25 +223,6 @@ static int vgpu_fecs_trace_set_filter(struct gk20a *g, | |||
223 | return err; | 223 | return err; |
224 | } | 224 | } |
225 | 225 | ||
226 | void vgpu_init_fecs_trace_ops(struct gpu_ops *ops) | ||
227 | { | ||
228 | ops->fecs_trace.init = vgpu_fecs_trace_init; | ||
229 | ops->fecs_trace.deinit = vgpu_fecs_trace_deinit; | ||
230 | ops->fecs_trace.enable = vgpu_fecs_trace_enable; | ||
231 | ops->fecs_trace.disable = vgpu_fecs_trace_disable; | ||
232 | ops->fecs_trace.is_enabled = vpgpu_fecs_trace_is_enabled; | ||
233 | ops->fecs_trace.reset = NULL; | ||
234 | ops->fecs_trace.flush = NULL; | ||
235 | ops->fecs_trace.poll = vgpu_fecs_trace_poll; | ||
236 | ops->fecs_trace.bind_channel = NULL; | ||
237 | ops->fecs_trace.unbind_channel = NULL; | ||
238 | ops->fecs_trace.max_entries = vgpu_fecs_trace_max_entries; | ||
239 | ops->fecs_trace.alloc_user_buffer = vgpu_alloc_user_buffer; | ||
240 | ops->fecs_trace.free_user_buffer = vgpu_free_user_buffer; | ||
241 | ops->fecs_trace.mmap_user_buffer = vgpu_mmap_user_buffer; | ||
242 | ops->fecs_trace.set_filter = vgpu_fecs_trace_set_filter; | ||
243 | } | ||
244 | |||
245 | void vgpu_fecs_trace_data_update(struct gk20a *g) | 226 | void vgpu_fecs_trace_data_update(struct gk20a *g) |
246 | { | 227 | { |
247 | gk20a_ctxsw_trace_wake_up(g, 0); | 228 | gk20a_ctxsw_trace_wake_up(g, 0); |