diff options
author | sreenivasulu velpula <svelpula@nvidia.com> | 2016-05-11 10:12:04 -0400 |
---|---|---|
committer | Terje Bergstrom <tbergstrom@nvidia.com> | 2016-06-07 15:05:55 -0400 |
commit | abbc813fe38a3cc4e7b45ec6e36074fe9608a2e5 (patch) | |
tree | 9220ec9ee9e6af0eaa5d3c53a445c0da2bae499a /drivers | |
parent | 5272552ab1b9c3b06a3935115f1200f24f466f46 (diff) |
gpu: nvgpu: add call back for get_cur_freq
When thermal throttling triggers gpcclk clock
changes, devfreq driver need to have call back
for get_cur_freq to get current gpu frequency.
With out this change, "17000000.gp10b/cur_freq"
interface won't show the current gpcclk frequency,
when thermal throttling triggers gpcclk frequency
changes.
Bug 1740309
Change-Id: I2484728094883abc285b2a3808bb2cef26a4ea96
Signed-off-by: sreenivasulu velpula <svelpula@nvidia.com>
Reviewed-on: http://git-master/r/1145912
(cherry picked from commit 0a6ef7b121d1b8aeba42cefa6e8b090b1ccd15e7)
Signed-off-by: Seshendra Gadagottu <sgadagottu@nvidia.com>
Reviewed-on: http://git-master/r/1147652
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gk20a_scale.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a_scale.c b/drivers/gpu/nvgpu/gk20a/gk20a_scale.c index e5c93db5..6d60d899 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a_scale.c +++ b/drivers/gpu/nvgpu/gk20a/gk20a_scale.c | |||
@@ -252,6 +252,20 @@ static int gk20a_scale_get_dev_status(struct device *dev, | |||
252 | } | 252 | } |
253 | 253 | ||
254 | /* | 254 | /* |
255 | * get_cur_freq(struct device *dev, unsigned long *freq) | ||
256 | * | ||
257 | * This function gets the current GPU clock rate. | ||
258 | */ | ||
259 | |||
260 | static int get_cur_freq(struct device *dev, unsigned long *freq) | ||
261 | { | ||
262 | struct gk20a_platform *platform = dev_get_drvdata(dev); | ||
263 | *freq = platform->clk_get_rate(dev); | ||
264 | return 0; | ||
265 | } | ||
266 | |||
267 | |||
268 | /* | ||
255 | * gk20a_scale_init(dev) | 269 | * gk20a_scale_init(dev) |
256 | */ | 270 | */ |
257 | 271 | ||
@@ -287,6 +301,7 @@ void gk20a_scale_init(struct device *dev) | |||
287 | profile->devfreq_profile.target = gk20a_scale_target; | 301 | profile->devfreq_profile.target = gk20a_scale_target; |
288 | profile->devfreq_profile.get_dev_status = | 302 | profile->devfreq_profile.get_dev_status = |
289 | gk20a_scale_get_dev_status; | 303 | gk20a_scale_get_dev_status; |
304 | profile->devfreq_profile.get_cur_freq = get_cur_freq; | ||
290 | 305 | ||
291 | devfreq = devfreq_add_device(dev, | 306 | devfreq = devfreq_add_device(dev, |
292 | &profile->devfreq_profile, | 307 | &profile->devfreq_profile, |