summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/common/power_features/cg/cg.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/nvgpu/common/power_features/cg/cg.c')
-rw-r--r--drivers/gpu/nvgpu/common/power_features/cg/cg.c30
1 files changed, 29 insertions, 1 deletions
diff --git a/drivers/gpu/nvgpu/common/power_features/cg/cg.c b/drivers/gpu/nvgpu/common/power_features/cg/cg.c
index 39796bc8..a966c4c6 100644
--- a/drivers/gpu/nvgpu/common/power_features/cg/cg.c
+++ b/drivers/gpu/nvgpu/common/power_features/cg/cg.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. 2 * Copyright (c) 2019-2020, NVIDIA CORPORATION. All rights reserved.
3 * 3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a 4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"), 5 * copy of this software and associated documentation files (the "Software"),
@@ -84,6 +84,34 @@ void nvgpu_cg_elcg_disable_no_wait(struct gk20a *g)
84 nvgpu_mutex_release(&g->cg_pg_lock); 84 nvgpu_mutex_release(&g->cg_pg_lock);
85} 85}
86 86
87void nvgpu_cg_blcg_disable_no_wait(struct gk20a *g) {
88 nvgpu_log_fn(g, " ");
89
90 if (!nvgpu_is_enabled(g, NVGPU_GPU_CAN_BLCG)) {
91 return;
92 }
93
94 nvgpu_mutex_acquire(&g->cg_pg_lock);
95 if (g->blcg_enabled) {
96 nvgpu_cg_set_mode(g, BLCG_MODE, BLCG_RUN);
97 }
98 nvgpu_mutex_release(&g->cg_pg_lock);
99}
100
101void nvgpu_cg_blcg_enable_no_wait(struct gk20a *g) {
102 nvgpu_log_fn(g, " ");
103
104 if (!nvgpu_is_enabled(g, NVGPU_GPU_CAN_BLCG)) {
105 return;
106 }
107
108 nvgpu_mutex_acquire(&g->cg_pg_lock);
109 if (g->blcg_enabled) {
110 nvgpu_cg_set_mode(g, BLCG_MODE, BLCG_AUTO);
111 }
112 nvgpu_mutex_release(&g->cg_pg_lock);
113}
114
87void nvgpu_cg_elcg_enable(struct gk20a *g) 115void nvgpu_cg_elcg_enable(struct gk20a *g)
88{ 116{
89 nvgpu_log_fn(g, " "); 117 nvgpu_log_fn(g, " ");