diff options
author | Deepak Nibade <dnibade@nvidia.com> | 2016-12-14 04:31:51 -0500 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-01-06 12:13:59 -0500 |
commit | 5d4ba0a6d8cf3d45c948b620e691a80921ad61a5 (patch) | |
tree | 778fd921d0b7a84f1a7ec6e5adb04d58f100a39b /drivers/gpu/nvgpu/gp10b | |
parent | b5c6aebe7a090a8888d7cd6607d58c061757cb78 (diff) |
gpu: nvgpu: round clock locally
In gp10b_round_clk_rate(), we currently call
clk_round_rate() to round the clock rate for us
But since the frequency table is prepared
using the frequency values supported in h/w,
we can round the rate locally using the table
Bug 1827281
Change-Id: I85d034326539590352badceb4164aa5d89ee8842
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: http://git-master/r/1280630
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gp10b')
-rw-r--r-- | drivers/gpu/nvgpu/gp10b/platform_gp10b_tegra.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/gpu/nvgpu/gp10b/platform_gp10b_tegra.c b/drivers/gpu/nvgpu/gp10b/platform_gp10b_tegra.c index 5e5c7703..9fabe1f5 100644 --- a/drivers/gpu/nvgpu/gp10b/platform_gp10b_tegra.c +++ b/drivers/gpu/nvgpu/gp10b/platform_gp10b_tegra.c | |||
@@ -328,9 +328,17 @@ static unsigned long gp10b_get_clk_rate(struct device *dev) | |||
328 | 328 | ||
329 | static long gp10b_round_clk_rate(struct device *dev, unsigned long rate) | 329 | static long gp10b_round_clk_rate(struct device *dev, unsigned long rate) |
330 | { | 330 | { |
331 | struct gk20a_platform *platform = gk20a_get_platform(dev); | 331 | struct gk20a *g = get_gk20a(dev); |
332 | struct gk20a_scale_profile *profile = g->scale_profile; | ||
333 | unsigned long *freq_table = profile->devfreq_profile.freq_table; | ||
334 | int max_states = profile->devfreq_profile.max_state; | ||
335 | int i; | ||
336 | |||
337 | for (i = 0; i < max_states; ++i) | ||
338 | if (freq_table[i] > rate) | ||
339 | return freq_table[i]; | ||
332 | 340 | ||
333 | return clk_round_rate(platform->clk[0], rate); | 341 | return freq_table[max_states - 1]; |
334 | } | 342 | } |
335 | 343 | ||
336 | static int gp10b_set_clk_rate(struct device *dev, unsigned long rate) | 344 | static int gp10b_set_clk_rate(struct device *dev, unsigned long rate) |