diff options
author | Terje Bergstrom <tbergstrom@nvidia.com> | 2017-10-30 16:29:14 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-11-02 12:26:00 -0400 |
commit | 952606b3b98f2994009288d6f628d4a8e70556bb (patch) | |
tree | 0e174497c0078f127e112cf61e75b3167956e5dd /drivers | |
parent | e1120727e7c854d093a21752c426c8597b16825d (diff) |
gpu: nvgpu: Initialize Linux sched in Linux code
Initialize Linux scheduling extensions from Linux code. This removes
a dependency between common and Linux code.
JIRA NVGPU-259
Change-Id: Ibd882f82479eaac05ecc8cf743dd4a89bd7386f2
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1588663
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/nvgpu/common/linux/ioctl_tsg.c | 14 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/common/linux/module.c | 6 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gk20a.c | 6 |
3 files changed, 19 insertions, 7 deletions
diff --git a/drivers/gpu/nvgpu/common/linux/ioctl_tsg.c b/drivers/gpu/nvgpu/common/linux/ioctl_tsg.c index f4972f11..7eea636e 100644 --- a/drivers/gpu/nvgpu/common/linux/ioctl_tsg.c +++ b/drivers/gpu/nvgpu/common/linux/ioctl_tsg.c | |||
@@ -249,12 +249,24 @@ free_ref: | |||
249 | int nvgpu_ioctl_tsg_dev_open(struct inode *inode, struct file *filp) | 249 | int nvgpu_ioctl_tsg_dev_open(struct inode *inode, struct file *filp) |
250 | { | 250 | { |
251 | struct nvgpu_os_linux *l; | 251 | struct nvgpu_os_linux *l; |
252 | struct gk20a *g; | ||
252 | int ret; | 253 | int ret; |
253 | 254 | ||
255 | gk20a_dbg_fn(""); | ||
256 | |||
254 | l = container_of(inode->i_cdev, | 257 | l = container_of(inode->i_cdev, |
255 | struct nvgpu_os_linux, tsg.cdev); | 258 | struct nvgpu_os_linux, tsg.cdev); |
256 | gk20a_dbg_fn(""); | 259 | g = &l->g; |
260 | |||
261 | ret = gk20a_busy(g); | ||
262 | if (ret) { | ||
263 | nvgpu_err(g, "failed to power on, %d", ret); | ||
264 | return ret; | ||
265 | } | ||
266 | |||
257 | ret = nvgpu_ioctl_tsg_open(&l->g, filp); | 267 | ret = nvgpu_ioctl_tsg_open(&l->g, filp); |
268 | |||
269 | gk20a_idle(g); | ||
258 | gk20a_dbg_fn("done"); | 270 | gk20a_dbg_fn("done"); |
259 | return ret; | 271 | return ret; |
260 | } | 272 | } |
diff --git a/drivers/gpu/nvgpu/common/linux/module.c b/drivers/gpu/nvgpu/common/linux/module.c index b06f86ab..7706d826 100644 --- a/drivers/gpu/nvgpu/common/linux/module.c +++ b/drivers/gpu/nvgpu/common/linux/module.c | |||
@@ -237,6 +237,12 @@ int gk20a_pm_finalize_poweron(struct device *dev) | |||
237 | if (platform->has_cde) | 237 | if (platform->has_cde) |
238 | gk20a_init_cde_support(l); | 238 | gk20a_init_cde_support(l); |
239 | 239 | ||
240 | err = gk20a_sched_ctrl_init(g); | ||
241 | if (err) { | ||
242 | nvgpu_err(g, "failed to init sched control"); | ||
243 | return err; | ||
244 | } | ||
245 | |||
240 | done: | 246 | done: |
241 | if (err) | 247 | if (err) |
242 | g->power_on = false; | 248 | g->power_on = false; |
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.c b/drivers/gpu/nvgpu/gk20a/gk20a.c index f2bb6dcf..a282110a 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gk20a.c | |||
@@ -300,12 +300,6 @@ int gk20a_finalize_poweron(struct gk20a *g) | |||
300 | nvgpu_warn(g, "could not initialize ctxsw tracing"); | 300 | nvgpu_warn(g, "could not initialize ctxsw tracing"); |
301 | #endif | 301 | #endif |
302 | 302 | ||
303 | err = gk20a_sched_ctrl_init(g); | ||
304 | if (err) { | ||
305 | nvgpu_err(g, "failed to init sched control"); | ||
306 | goto done; | ||
307 | } | ||
308 | |||
309 | /* Restore the debug setting */ | 303 | /* Restore the debug setting */ |
310 | g->ops.fb.set_debug_mode(g, g->mmu_debug_ctrl); | 304 | g->ops.fb.set_debug_mode(g, g->mmu_debug_ctrl); |
311 | 305 | ||