summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gv11b/regops_gv11b.c
diff options
context:
space:
mode:
authorSunny He <suhe@nvidia.com>2017-07-28 21:37:49 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2017-08-02 17:43:28 -0400
commitf87007829f176baa5d3e784c71f3bceb082a29eb (patch)
treef26f38e371bea4eff8abcf7a47b7bd0abd9d8a44 /drivers/gpu/nvgpu/gv11b/regops_gv11b.c
parentea381959d973f013a2a2b2ae6fe694f1f569683c (diff)
gpu: nvgpu: gv11b: Reorg regops HAL initialization
Reorganize HAL initialization to remove inheritance and construct the gpu_ops struct at compile time. This patch only covers the regops 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: Ibf9f64ca445691e252b72c2b8fc59edb84e226ce Signed-off-by: Sunny He <suhe@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1530136 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Alex Waterman <alexw@nvidia.com> Tested-by: Alex Waterman <alexw@nvidia.com> Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gv11b/regops_gv11b.c')
-rw-r--r--drivers/gpu/nvgpu/gv11b/regops_gv11b.c63
1 files changed, 13 insertions, 50 deletions
diff --git a/drivers/gpu/nvgpu/gv11b/regops_gv11b.c b/drivers/gpu/nvgpu/gv11b/regops_gv11b.c
index 75923b6a..5e98f9f1 100644
--- a/drivers/gpu/nvgpu/gv11b/regops_gv11b.c
+++ b/drivers/gpu/nvgpu/gv11b/regops_gv11b.c
@@ -1327,105 +1327,68 @@ static const struct regop_offset_range gv11b_qctl_whitelist_ranges[] = {
1327static const u32 gv11b_qctl_whitelist_ranges_count = 1327static const u32 gv11b_qctl_whitelist_ranges_count =
1328 ARRAY_SIZE(gv11b_qctl_whitelist_ranges); 1328 ARRAY_SIZE(gv11b_qctl_whitelist_ranges);
1329 1329
1330static const struct regop_offset_range *gv11b_get_global_whitelist_ranges(void) 1330const struct regop_offset_range *gv11b_get_global_whitelist_ranges(void)
1331{ 1331{
1332 return gv11b_global_whitelist_ranges; 1332 return gv11b_global_whitelist_ranges;
1333} 1333}
1334 1334
1335static int gv11b_get_global_whitelist_ranges_count(void) 1335int gv11b_get_global_whitelist_ranges_count(void)
1336{ 1336{
1337 return gv11b_global_whitelist_ranges_count; 1337 return gv11b_global_whitelist_ranges_count;
1338} 1338}
1339 1339
1340static const struct regop_offset_range *gv11b_get_context_whitelist_ranges(void) 1340const struct regop_offset_range *gv11b_get_context_whitelist_ranges(void)
1341{ 1341{
1342 return gv11b_global_whitelist_ranges; 1342 return gv11b_global_whitelist_ranges;
1343} 1343}
1344 1344
1345static int gv11b_get_context_whitelist_ranges_count(void) 1345int gv11b_get_context_whitelist_ranges_count(void)
1346{ 1346{
1347 return gv11b_global_whitelist_ranges_count; 1347 return gv11b_global_whitelist_ranges_count;
1348} 1348}
1349 1349
1350static const u32 *gv11b_get_runcontrol_whitelist(void) 1350const u32 *gv11b_get_runcontrol_whitelist(void)
1351{ 1351{
1352 return gv11b_runcontrol_whitelist; 1352 return gv11b_runcontrol_whitelist;
1353} 1353}
1354 1354
1355static int gv11b_get_runcontrol_whitelist_count(void) 1355int gv11b_get_runcontrol_whitelist_count(void)
1356{ 1356{
1357 return gv11b_runcontrol_whitelist_count; 1357 return gv11b_runcontrol_whitelist_count;
1358} 1358}
1359 1359
1360static const 1360const struct regop_offset_range *gv11b_get_runcontrol_whitelist_ranges(void)
1361struct regop_offset_range *gv11b_get_runcontrol_whitelist_ranges(void)
1362{ 1361{
1363 return gv11b_runcontrol_whitelist_ranges; 1362 return gv11b_runcontrol_whitelist_ranges;
1364} 1363}
1365 1364
1366static int gv11b_get_runcontrol_whitelist_ranges_count(void) 1365int gv11b_get_runcontrol_whitelist_ranges_count(void)
1367{ 1366{
1368 return gv11b_runcontrol_whitelist_ranges_count; 1367 return gv11b_runcontrol_whitelist_ranges_count;
1369} 1368}
1370 1369
1371static const u32 *gv11b_get_qctl_whitelist(void) 1370const u32 *gv11b_get_qctl_whitelist(void)
1372{ 1371{
1373 return gv11b_qctl_whitelist; 1372 return gv11b_qctl_whitelist;
1374} 1373}
1375 1374
1376static int gv11b_get_qctl_whitelist_count(void) 1375int gv11b_get_qctl_whitelist_count(void)
1377{ 1376{
1378 return gv11b_qctl_whitelist_count; 1377 return gv11b_qctl_whitelist_count;
1379} 1378}
1380 1379
1381static const struct regop_offset_range *gv11b_get_qctl_whitelist_ranges(void) 1380const struct regop_offset_range *gv11b_get_qctl_whitelist_ranges(void)
1382{ 1381{
1383 return gv11b_qctl_whitelist_ranges; 1382 return gv11b_qctl_whitelist_ranges;
1384} 1383}
1385 1384
1386static int gv11b_get_qctl_whitelist_ranges_count(void) 1385int gv11b_get_qctl_whitelist_ranges_count(void)
1387{ 1386{
1388 return gv11b_qctl_whitelist_ranges_count; 1387 return gv11b_qctl_whitelist_ranges_count;
1389} 1388}
1390 1389
1391static int gv11b_apply_smpc_war(struct dbg_session_gk20a *dbg_s) 1390int gv11b_apply_smpc_war(struct dbg_session_gk20a *dbg_s)
1392{ 1391{
1393 /* Not needed on gv11b */ 1392 /* Not needed on gv11b */
1394 return 0; 1393 return 0;
1395} 1394}
1396
1397void gv11b_init_regops(struct gpu_ops *gops)
1398{
1399 gops->regops.get_global_whitelist_ranges =
1400 gv11b_get_global_whitelist_ranges;
1401 gops->regops.get_global_whitelist_ranges_count =
1402 gv11b_get_global_whitelist_ranges_count;
1403
1404 gops->regops.get_context_whitelist_ranges =
1405 gv11b_get_context_whitelist_ranges;
1406 gops->regops.get_context_whitelist_ranges_count =
1407 gv11b_get_context_whitelist_ranges_count;
1408
1409 gops->regops.get_runcontrol_whitelist =
1410 gv11b_get_runcontrol_whitelist;
1411 gops->regops.get_runcontrol_whitelist_count =
1412 gv11b_get_runcontrol_whitelist_count;
1413
1414 gops->regops.get_runcontrol_whitelist_ranges =
1415 gv11b_get_runcontrol_whitelist_ranges;
1416 gops->regops.get_runcontrol_whitelist_ranges_count =
1417 gv11b_get_runcontrol_whitelist_ranges_count;
1418
1419 gops->regops.get_qctl_whitelist =
1420 gv11b_get_qctl_whitelist;
1421 gops->regops.get_qctl_whitelist_count =
1422 gv11b_get_qctl_whitelist_count;
1423
1424 gops->regops.get_qctl_whitelist_ranges =
1425 gv11b_get_qctl_whitelist_ranges;
1426 gops->regops.get_qctl_whitelist_ranges_count =
1427 gv11b_get_qctl_whitelist_ranges_count;
1428
1429 gops->regops.apply_smpc_war =
1430 gv11b_apply_smpc_war;
1431}