summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/gk20a_scale.c
diff options
context:
space:
mode:
authorSachit Kadle <skadle@nvidia.com>2016-11-03 23:31:59 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2016-11-17 00:35:22 -0500
commit5494e846c78dd0da74635905ead3abe45502375f (patch)
treeeb680d5dceca18e74a0b84dd83832427d13ae4e8 /drivers/gpu/nvgpu/gk20a/gk20a_scale.c
parentb5c31a23ca94f21c701680acba10528254523244 (diff)
gpu: nvgpu: set clk_rate on frequency change
Currently, in gk20a_scale_target, we set clock frequency even if it is equivalent to the rate previously requested by the governor. This change adds a check to bypass this in case new_frequency == prev_frequency. These clocking operations result in multiple BPMP calls, and add significant overhead to submit time. So, we avoid these operations when possible. Bug 1795076 Change-Id: I0f180564e54581f0f4add4626c647e0b9a1bbe43 Signed-off-by: Sachit Kadle <skadle@nvidia.com> Signed-off-by: Deepak Nibade <dnibade@nvidia.com> Reviewed-on: http://git-master/r/1247913 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Aaron Huang <aaronh@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/gk20a_scale.c')
-rw-r--r--drivers/gpu/nvgpu/gk20a/gk20a_scale.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a_scale.c b/drivers/gpu/nvgpu/gk20a/gk20a_scale.c
index d2229a6a..e3b21c5a 100644
--- a/drivers/gpu/nvgpu/gk20a/gk20a_scale.c
+++ b/drivers/gpu/nvgpu/gk20a/gk20a_scale.c
@@ -181,6 +181,10 @@ static int gk20a_scale_target(struct device *dev, unsigned long *freq,
181 if (local_freq > max_freq) 181 if (local_freq > max_freq)
182 local_freq = max_freq; 182 local_freq = max_freq;
183 183
184 /* Check for duplicate request */
185 if (local_freq == g->devfreq->previous_freq)
186 return 0;
187
184 /* set the final frequency */ 188 /* set the final frequency */
185 rounded_rate = platform->clk_round_rate(dev, local_freq); 189 rounded_rate = platform->clk_round_rate(dev, local_freq);
186 190