diff options
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gk20a.h | 2 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/pmu_gk20a.c | 1 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/pmu_gk20a.h | 3 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gm206/pmu_gm206.c | 3 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gm20b/pmu_gm20b.c | 3 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gp106/pmu_gp106.c | 22 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gp10b/pmu_gp10b.c | 1 |
7 files changed, 33 insertions, 2 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.h b/drivers/gpu/nvgpu/gk20a/gk20a.h index ff8ffc4f..5e2344cf 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/gk20a.h | |||
@@ -610,6 +610,8 @@ struct gpu_ops { | |||
610 | u32 (*pmu_pg_supported_engines_list)(struct gk20a *g); | 610 | u32 (*pmu_pg_supported_engines_list)(struct gk20a *g); |
611 | u32 (*pmu_pg_engines_feature_list)(struct gk20a *g, | 611 | u32 (*pmu_pg_engines_feature_list)(struct gk20a *g, |
612 | u32 pg_engine_id); | 612 | u32 pg_engine_id); |
613 | bool (*pmu_is_lpwr_feature_supported)(struct gk20a *g, | ||
614 | u32 feature_id); | ||
613 | int (*pmu_lpwr_enable_pg)(struct gk20a *g, bool pstate_lock); | 615 | int (*pmu_lpwr_enable_pg)(struct gk20a *g, bool pstate_lock); |
614 | int (*pmu_lpwr_disable_pg)(struct gk20a *g, bool pstate_lock); | 616 | int (*pmu_lpwr_disable_pg)(struct gk20a *g, bool pstate_lock); |
615 | u32 (*pmu_pg_param_post_init)(struct gk20a *g); | 617 | u32 (*pmu_pg_param_post_init)(struct gk20a *g); |
diff --git a/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c b/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c index 1aa423a8..ef6a5943 100644 --- a/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c | |||
@@ -3302,6 +3302,7 @@ void gk20a_init_pmu_ops(struct gpu_ops *gops) | |||
3302 | gops->pmu.pmu_pg_init_param = NULL; | 3302 | gops->pmu.pmu_pg_init_param = NULL; |
3303 | gops->pmu.pmu_pg_supported_engines_list = gk20a_pmu_pg_engines_list; | 3303 | gops->pmu.pmu_pg_supported_engines_list = gk20a_pmu_pg_engines_list; |
3304 | gops->pmu.pmu_pg_engines_feature_list = gk20a_pmu_pg_feature_list; | 3304 | gops->pmu.pmu_pg_engines_feature_list = gk20a_pmu_pg_feature_list; |
3305 | gops->pmu.pmu_is_lpwr_feature_supported = NULL; | ||
3305 | gops->pmu.pmu_lpwr_enable_pg = NULL; | 3306 | gops->pmu.pmu_lpwr_enable_pg = NULL; |
3306 | gops->pmu.pmu_lpwr_disable_pg = NULL; | 3307 | gops->pmu.pmu_lpwr_disable_pg = NULL; |
3307 | gops->pmu.pmu_pg_param_post_init = NULL; | 3308 | gops->pmu.pmu_pg_param_post_init = NULL; |
diff --git a/drivers/gpu/nvgpu/gk20a/pmu_gk20a.h b/drivers/gpu/nvgpu/gk20a/pmu_gk20a.h index 0a1d2ba3..daa050af 100644 --- a/drivers/gpu/nvgpu/gk20a/pmu_gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/pmu_gk20a.h | |||
@@ -647,6 +647,9 @@ struct pmu_pg_stats { | |||
647 | #define PMU_PG_ELPG_ENGINE_ID_INVALID_ENGINE (0x00000005) | 647 | #define PMU_PG_ELPG_ENGINE_ID_INVALID_ENGINE (0x00000005) |
648 | #define PMU_PG_ELPG_ENGINE_MAX PMU_PG_ELPG_ENGINE_ID_INVALID_ENGINE | 648 | #define PMU_PG_ELPG_ENGINE_MAX PMU_PG_ELPG_ENGINE_ID_INVALID_ENGINE |
649 | 649 | ||
650 | #define PMU_PG_LPWR_FEATURE_RPPG 0x0 | ||
651 | #define PMU_PG_LPWR_FEATURE_MSCG 0x1 | ||
652 | |||
650 | /* state transition : | 653 | /* state transition : |
651 | OFF => [OFF_ON_PENDING optional] => ON_PENDING => ON => OFF | 654 | OFF => [OFF_ON_PENDING optional] => ON_PENDING => ON => OFF |
652 | ON => OFF is always synchronized */ | 655 | ON => OFF is always synchronized */ |
diff --git a/drivers/gpu/nvgpu/gm206/pmu_gm206.c b/drivers/gpu/nvgpu/gm206/pmu_gm206.c index 44ef8ae7..2b3c1b50 100644 --- a/drivers/gpu/nvgpu/gm206/pmu_gm206.c +++ b/drivers/gpu/nvgpu/gm206/pmu_gm206.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved. | 2 | * Copyright (c) 2016-2017, NVIDIA CORPORATION. All rights reserved. |
3 | * | 3 | * |
4 | * This program is free software; you can redistribute it and/or modify it | 4 | * This program is free software; you can redistribute it and/or modify it |
5 | * under the terms and conditions of the GNU General Public License, | 5 | * under the terms and conditions of the GNU General Public License, |
@@ -161,6 +161,7 @@ void gm206_init_pmu_ops(struct gpu_ops *gops) | |||
161 | gops->pmu.pmu_pg_supported_engines_list = NULL; | 161 | gops->pmu.pmu_pg_supported_engines_list = NULL; |
162 | gops->pmu.pmu_pg_engines_feature_list = NULL; | 162 | gops->pmu.pmu_pg_engines_feature_list = NULL; |
163 | gops->pmu.pmu_lpwr_enable_pg = NULL; | 163 | gops->pmu.pmu_lpwr_enable_pg = NULL; |
164 | gops->pmu.pmu_is_lpwr_feature_supported = NULL; | ||
164 | gops->pmu.pmu_lpwr_disable_pg = NULL; | 165 | gops->pmu.pmu_lpwr_disable_pg = NULL; |
165 | gops->pmu.pmu_pg_param_post_init = NULL; | 166 | gops->pmu.pmu_pg_param_post_init = NULL; |
166 | gops->pmu.send_lrf_tex_ltc_dram_overide_en_dis_cmd = NULL; | 167 | gops->pmu.send_lrf_tex_ltc_dram_overide_en_dis_cmd = NULL; |
diff --git a/drivers/gpu/nvgpu/gm20b/pmu_gm20b.c b/drivers/gpu/nvgpu/gm20b/pmu_gm20b.c index 08a7e170..2e568e83 100644 --- a/drivers/gpu/nvgpu/gm20b/pmu_gm20b.c +++ b/drivers/gpu/nvgpu/gm20b/pmu_gm20b.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * GM20B PMU | 2 | * GM20B PMU |
3 | * | 3 | * |
4 | * Copyright (c) 2015-2016, NVIDIA CORPORATION. All rights reserved. | 4 | * Copyright (c) 2015-2017, NVIDIA CORPORATION. All rights reserved. |
5 | * | 5 | * |
6 | * This program is free software; you can redistribute it and/or modify it | 6 | * This program is free software; you can redistribute it and/or modify it |
7 | * under the terms and conditions of the GNU General Public License, | 7 | * under the terms and conditions of the GNU General Public License, |
@@ -291,6 +291,7 @@ void gm20b_init_pmu_ops(struct gpu_ops *gops) | |||
291 | gops->pmu.pmu_pg_init_param = NULL; | 291 | gops->pmu.pmu_pg_init_param = NULL; |
292 | gops->pmu.pmu_pg_supported_engines_list = gk20a_pmu_pg_engines_list; | 292 | gops->pmu.pmu_pg_supported_engines_list = gk20a_pmu_pg_engines_list; |
293 | gops->pmu.pmu_pg_engines_feature_list = gk20a_pmu_pg_feature_list; | 293 | gops->pmu.pmu_pg_engines_feature_list = gk20a_pmu_pg_feature_list; |
294 | gops->pmu.pmu_is_lpwr_feature_supported = NULL; | ||
294 | gops->pmu.pmu_lpwr_enable_pg = NULL; | 295 | gops->pmu.pmu_lpwr_enable_pg = NULL; |
295 | gops->pmu.pmu_lpwr_disable_pg = NULL; | 296 | gops->pmu.pmu_lpwr_disable_pg = NULL; |
296 | gops->pmu.pmu_pg_param_post_init = NULL; | 297 | gops->pmu.pmu_pg_param_post_init = NULL; |
diff --git a/drivers/gpu/nvgpu/gp106/pmu_gp106.c b/drivers/gpu/nvgpu/gp106/pmu_gp106.c index f294b1e0..8d552a5b 100644 --- a/drivers/gpu/nvgpu/gp106/pmu_gp106.c +++ b/drivers/gpu/nvgpu/gp106/pmu_gp106.c | |||
@@ -279,6 +279,26 @@ static void gp106_pmu_elpg_statistics(struct gk20a *g, u32 pg_engine_id, | |||
279 | pg_stat_data->avg_exit_latency_us = stats.exit_latency_avg_us; | 279 | pg_stat_data->avg_exit_latency_us = stats.exit_latency_avg_us; |
280 | } | 280 | } |
281 | 281 | ||
282 | static bool gp106_pmu_is_lpwr_feature_supported(struct gk20a *g, u32 feature_id) | ||
283 | { | ||
284 | bool is_feature_supported = false; | ||
285 | |||
286 | switch (feature_id) { | ||
287 | case PMU_PG_LPWR_FEATURE_RPPG: | ||
288 | is_feature_supported = nvgpu_lpwr_is_rppg_supported(g, | ||
289 | nvgpu_clk_arb_get_current_pstate(g)); | ||
290 | break; | ||
291 | case PMU_PG_LPWR_FEATURE_MSCG: | ||
292 | is_feature_supported = nvgpu_lpwr_is_mscg_supported(g, | ||
293 | nvgpu_clk_arb_get_current_pstate(g)); | ||
294 | break; | ||
295 | default: | ||
296 | is_feature_supported = false; | ||
297 | } | ||
298 | |||
299 | return is_feature_supported; | ||
300 | } | ||
301 | |||
282 | void gp106_init_pmu_ops(struct gpu_ops *gops) | 302 | void gp106_init_pmu_ops(struct gpu_ops *gops) |
283 | { | 303 | { |
284 | gk20a_dbg_fn(""); | 304 | gk20a_dbg_fn(""); |
@@ -304,6 +324,8 @@ void gp106_init_pmu_ops(struct gpu_ops *gops) | |||
304 | gops->pmu.pmu_pg_init_param = gp106_pg_param_init; | 324 | gops->pmu.pmu_pg_init_param = gp106_pg_param_init; |
305 | gops->pmu.pmu_pg_supported_engines_list = gp106_pmu_pg_engines_list; | 325 | gops->pmu.pmu_pg_supported_engines_list = gp106_pmu_pg_engines_list; |
306 | gops->pmu.pmu_pg_engines_feature_list = gp106_pmu_pg_feature_list; | 326 | gops->pmu.pmu_pg_engines_feature_list = gp106_pmu_pg_feature_list; |
327 | gops->pmu.pmu_is_lpwr_feature_supported = | ||
328 | gp106_pmu_is_lpwr_feature_supported; | ||
307 | gops->pmu.pmu_lpwr_enable_pg = nvgpu_lpwr_enable_pg; | 329 | gops->pmu.pmu_lpwr_enable_pg = nvgpu_lpwr_enable_pg; |
308 | gops->pmu.pmu_lpwr_disable_pg = nvgpu_lpwr_disable_pg; | 330 | gops->pmu.pmu_lpwr_disable_pg = nvgpu_lpwr_disable_pg; |
309 | gops->pmu.pmu_pg_param_post_init = nvgpu_lpwr_post_init; | 331 | gops->pmu.pmu_pg_param_post_init = nvgpu_lpwr_post_init; |
diff --git a/drivers/gpu/nvgpu/gp10b/pmu_gp10b.c b/drivers/gpu/nvgpu/gp10b/pmu_gp10b.c index fc535985..cf216941 100644 --- a/drivers/gpu/nvgpu/gp10b/pmu_gp10b.c +++ b/drivers/gpu/nvgpu/gp10b/pmu_gp10b.c | |||
@@ -487,6 +487,7 @@ void gp10b_init_pmu_ops(struct gpu_ops *gops) | |||
487 | gops->pmu.pmu_pg_init_param = gp10b_pg_gr_init; | 487 | gops->pmu.pmu_pg_init_param = gp10b_pg_gr_init; |
488 | gops->pmu.pmu_pg_supported_engines_list = gk20a_pmu_pg_engines_list; | 488 | gops->pmu.pmu_pg_supported_engines_list = gk20a_pmu_pg_engines_list; |
489 | gops->pmu.pmu_pg_engines_feature_list = gk20a_pmu_pg_feature_list; | 489 | gops->pmu.pmu_pg_engines_feature_list = gk20a_pmu_pg_feature_list; |
490 | gops->pmu.pmu_is_lpwr_feature_supported = NULL; | ||
490 | gops->pmu.pmu_lpwr_enable_pg = NULL; | 491 | gops->pmu.pmu_lpwr_enable_pg = NULL; |
491 | gops->pmu.pmu_lpwr_disable_pg = NULL; | 492 | gops->pmu.pmu_lpwr_disable_pg = NULL; |
492 | gops->pmu.pmu_pg_param_post_init = NULL; | 493 | gops->pmu.pmu_pg_param_post_init = NULL; |