summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorAparna Das <aparnad@nvidia.com>2018-02-13 10:52:52 -0500
committermobile promotions <svcmobile_promotions@nvidia.com>2018-03-06 17:51:54 -0500
commit395c5538136049dcbc52ab218c3b5f764e7d0199 (patch)
tree9194138fff98e3c11b25a99e13f5511dcfb4f492 /drivers
parent70bf8275efab7e155e9b3f9853a4cf7f38228c43 (diff)
gpu: nvgpu: move chip detect in os specific probe code
This allows moving HAL overrides for vserver out of common chip specific HAL files into os specific probe code. Jira VQRM-3070 Change-Id: Icc61aacc03ac7db7a0ea1f6a2dd2b76185c74757 Signed-off-by: Aparna Das <aparnad@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1656752 Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Richard Zhao <rizhao@nvidia.com> Tested-by: Richard Zhao <rizhao@nvidia.com> Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com> 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/module.c4
-rw-r--r--drivers/gpu/nvgpu/gk20a/gk20a.c6
-rw-r--r--drivers/gpu/nvgpu/gk20a/gk20a.h1
3 files changed, 6 insertions, 5 deletions
diff --git a/drivers/gpu/nvgpu/common/linux/module.c b/drivers/gpu/nvgpu/common/linux/module.c
index b103fcea..59691c64 100644
--- a/drivers/gpu/nvgpu/common/linux/module.c
+++ b/drivers/gpu/nvgpu/common/linux/module.c
@@ -246,6 +246,10 @@ int gk20a_pm_finalize_poweron(struct device *dev)
246 INIT_WORK(&l->nonstall_fn_work, nvgpu_intr_nonstall_cb); 246 INIT_WORK(&l->nonstall_fn_work, nvgpu_intr_nonstall_cb);
247 } 247 }
248 248
249 err = gk20a_detect_chip(g);
250 if (err)
251 return err;
252
249 err = gk20a_finalize_poweron(g); 253 err = gk20a_finalize_poweron(g);
250 set_user_nice(current, nice_value); 254 set_user_nice(current, nice_value);
251 if (err) 255 if (err)
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.c b/drivers/gpu/nvgpu/gk20a/gk20a.c
index c2daf27e..0206c915 100644
--- a/drivers/gpu/nvgpu/gk20a/gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/gk20a.c
@@ -68,7 +68,7 @@ void __gk20a_warn_on_no_regs(void)
68 WARN_ONCE(1, "Attempted access to GPU regs after unmapping!"); 68 WARN_ONCE(1, "Attempted access to GPU regs after unmapping!");
69} 69}
70 70
71static int gk20a_detect_chip(struct gk20a *g) 71int gk20a_detect_chip(struct gk20a *g)
72{ 72{
73 struct nvgpu_gpu_params *p = &g->params; 73 struct nvgpu_gpu_params *p = &g->params;
74 74
@@ -131,10 +131,6 @@ int gk20a_finalize_poweron(struct gk20a *g)
131 131
132 g->power_on = true; 132 g->power_on = true;
133 133
134 err = gk20a_detect_chip(g);
135 if (err)
136 goto done;
137
138 /* 134 /*
139 * Before probing the GPU make sure the GPU's state is cleared. This is 135 * Before probing the GPU make sure the GPU's state is cleared. This is
140 * relevant for rebind operations. 136 * relevant for rebind operations.
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.h b/drivers/gpu/nvgpu/gk20a/gk20a.h
index 5de2b439..2786340e 100644
--- a/drivers/gpu/nvgpu/gk20a/gk20a.h
+++ b/drivers/gpu/nvgpu/gk20a/gk20a.h
@@ -1549,4 +1549,5 @@ static inline bool gk20a_platform_has_syncpoints(struct gk20a *g)
1549#endif 1549#endif
1550} 1550}
1551 1551
1552int gk20a_detect_chip(struct gk20a *g);
1552#endif /* GK20A_H */ 1553#endif /* GK20A_H */