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>
This commit is contained in:
Terje Bergstrom
2017-10-30 13:29:14 -07:00
committed by mobile promotions
parent e1120727e7
commit 952606b3b9
3 changed files with 19 additions and 7 deletions

View File

@@ -249,12 +249,24 @@ free_ref:
int nvgpu_ioctl_tsg_dev_open(struct inode *inode, struct file *filp)
{
struct nvgpu_os_linux *l;
struct gk20a *g;
int ret;
gk20a_dbg_fn("");
l = container_of(inode->i_cdev,
struct nvgpu_os_linux, tsg.cdev);
gk20a_dbg_fn("");
g = &l->g;
ret = gk20a_busy(g);
if (ret) {
nvgpu_err(g, "failed to power on, %d", ret);
return ret;
}
ret = nvgpu_ioctl_tsg_open(&l->g, filp);
gk20a_idle(g);
gk20a_dbg_fn("done");
return ret;
}

View File

@@ -237,6 +237,12 @@ int gk20a_pm_finalize_poweron(struct device *dev)
if (platform->has_cde)
gk20a_init_cde_support(l);
err = gk20a_sched_ctrl_init(g);
if (err) {
nvgpu_err(g, "failed to init sched control");
return err;
}
done:
if (err)
g->power_on = false;

View File

@@ -300,12 +300,6 @@ int gk20a_finalize_poweron(struct gk20a *g)
nvgpu_warn(g, "could not initialize ctxsw tracing");
#endif
err = gk20a_sched_ctrl_init(g);
if (err) {
nvgpu_err(g, "failed to init sched control");
goto done;
}
/* Restore the debug setting */
g->ops.fb.set_debug_mode(g, g->mmu_debug_ctrl);