summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gv11b/pmu_gv11b.c
diff options
context:
space:
mode:
authorSunny He <suhe@nvidia.com>2017-08-01 20:12:03 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2017-08-21 16:06:07 -0400
commitcce0a55d2106865be14b3b39c083a0f55881f2a5 (patch)
treedadeb0bfae70b105a749d4a3378485ceaf2b0f8d /drivers/gpu/nvgpu/gv11b/pmu_gv11b.c
parent6ff92bfb6e1ed68e29cef279f3275ac75ceaa4db (diff)
gpu: nvgpu: gv11b: Reorg pmu HAL init
Reorganize HAL initialization to remove inheritance and construct the gpu_ops struct at compile time. This patch only covers the pmu sub-module of the gpu_ops struct. Perform HAL function assignments in hal_gxxxx.c through the population of a chip-specific copy of gpu_ops. Jira NVGPU-74 Change-Id: I3f8a763a7bebf201c2242eecde7ff998aad07d0a Signed-off-by: Sunny He <suhe@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1530983 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com> Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gv11b/pmu_gv11b.c')
-rw-r--r--drivers/gpu/nvgpu/gv11b/pmu_gv11b.c32
1 files changed, 4 insertions, 28 deletions
diff --git a/drivers/gpu/nvgpu/gv11b/pmu_gv11b.c b/drivers/gpu/nvgpu/gv11b/pmu_gv11b.c
index 35719dff..2b89fbcc 100644
--- a/drivers/gpu/nvgpu/gv11b/pmu_gv11b.c
+++ b/drivers/gpu/nvgpu/gv11b/pmu_gv11b.c
@@ -36,12 +36,12 @@
36 36
37#define ALIGN_4KB 12 37#define ALIGN_4KB 12
38 38
39static bool gv11b_is_pmu_supported(struct gk20a *g) 39bool gv11b_is_pmu_supported(struct gk20a *g)
40{ 40{
41 return true; 41 return true;
42} 42}
43 43
44static int gv11b_pmu_bootstrap(struct nvgpu_pmu *pmu) 44int gv11b_pmu_bootstrap(struct nvgpu_pmu *pmu)
45{ 45{
46 struct gk20a *g = gk20a_from_pmu(pmu); 46 struct gk20a *g = gk20a_from_pmu(pmu);
47 struct mm_gk20a *mm = &g->mm; 47 struct mm_gk20a *mm = &g->mm;
@@ -178,7 +178,7 @@ static void pmu_handle_pg_param_msg(struct gk20a *g, struct pmu_msg *msg,
178 msg->msg.pg.msg_type); 178 msg->msg.pg.msg_type);
179} 179}
180 180
181static int gv11b_pg_gr_init(struct gk20a *g, u32 pg_engine_id) 181int gv11b_pg_gr_init(struct gk20a *g, u32 pg_engine_id)
182{ 182{
183 struct nvgpu_pmu *pmu = &g->pmu; 183 struct nvgpu_pmu *pmu = &g->pmu;
184 struct pmu_cmd cmd; 184 struct pmu_cmd cmd;
@@ -206,7 +206,7 @@ static int gv11b_pg_gr_init(struct gk20a *g, u32 pg_engine_id)
206 return 0; 206 return 0;
207} 207}
208 208
209static int gv11b_pg_set_subfeature_mask(struct gk20a *g, u32 pg_engine_id) 209int gv11b_pg_set_subfeature_mask(struct gk20a *g, u32 pg_engine_id)
210{ 210{
211 struct nvgpu_pmu *pmu = &g->pmu; 211 struct nvgpu_pmu *pmu = &g->pmu;
212 struct pmu_cmd cmd; 212 struct pmu_cmd cmd;
@@ -234,27 +234,3 @@ static int gv11b_pg_set_subfeature_mask(struct gk20a *g, u32 pg_engine_id)
234 234
235 return 0; 235 return 0;
236} 236}
237
238void gv11b_init_pmu_ops(struct gk20a *g)
239{
240 struct gpu_ops *gops = &g->ops;
241
242 gp10b_init_pmu_ops(g);
243 gops->pmu.pmu_nsbootstrap = gv11b_pmu_bootstrap;
244 gops->pmu.is_pmu_supported = gv11b_is_pmu_supported;
245 gops->pmu.reset_engine = gp106_pmu_engine_reset;
246 gops->pmu.is_engine_in_reset = gp106_pmu_is_engine_in_reset;
247 gops->pmu.pmu_get_queue_head = pwr_pmu_queue_head_r;
248 gops->pmu.pmu_get_queue_head_size = pwr_pmu_queue_head__size_1_v;
249 gops->pmu.pmu_get_queue_tail = pwr_pmu_queue_tail_r;
250 gops->pmu.pmu_get_queue_tail_size = pwr_pmu_queue_tail__size_1_v;
251 gops->pmu.pmu_queue_head = gk20a_pmu_queue_head;
252 gops->pmu.pmu_queue_tail = gk20a_pmu_queue_tail;
253 gops->pmu.pmu_mutex_acquire = gk20a_pmu_mutex_acquire;
254 gops->pmu.pmu_mutex_release = gk20a_pmu_mutex_release;
255 gops->pmu.pmu_msgq_tail = gk20a_pmu_msgq_tail;
256 gops->pmu.pmu_mutex_size = pwr_pmu_mutex__size_1_v;
257 gops->pmu.pmu_elpg_statistics = gp106_pmu_elpg_statistics;
258 gops->pmu.pmu_pg_init_param = gv11b_pg_gr_init;
259 gops->pmu.pmu_pg_set_sub_feature_mask = gv11b_pg_set_subfeature_mask;
260}