Commit Graph

60 Commits

Author SHA1 Message Date
Arto Merilainen
6135535c12 devfreq: Add Active Watermark governor
This patch adds a new watermark governor that actively alters the
watermark values based on the current frequency and target load.

The governor takes target load as a given property (80% by default)
and every time when the governor re-estimation is triggered, the
governor checks the current load and calculates the next frequency
that would push the device as close this target load as possible.

At this point also the watermark values are updated so that next
time the interrupt should come when the load change is significant
enough to cause frequency change to either next or previous
frequency.

Change-Id: I860a0bc984d55628a0e560652a93306616b080cf
Signed-off-by: Arto Merilainen <amerilainen@nvidia.com>
Reviewed-on: http://git-master/r/598801
Reviewed-on: http://git-master/r/1160008
(cherry picked from linux-4.9 commit e55ba2a709574ce4f01ca2f8211393c795b75dad)
[talho: removed Kconfig and Makefile changes from the patch]
Signed-off-by: Timo Alho <talho@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1770140
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-04 05:18:03 +00:00
Arto Merilainen
526edececa devfreq: Add debugfs interface to simple watermark
This patch adds support to tune low and high watermark values in
debugfs.

Change-Id: I82056a5c1baa29df9e0389fda7d2bc2cc1771978
Signed-off-by: Arto Merilainen <amerilainen@nvidia.com>
Reviewed-on: http://git-master/r/1160007
(cherry picked from linux-4.9 commit 69b139a5024dbe04daf9d22ac2a6493251846f12)
Reviewed-on: https://git-master.nvidia.com/r/1770139
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Timo Alho <talho@nvidia.com>
Tested-by: Timo Alho <talho@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-04 05:18:03 +00:00
Arto Merilainen
dcc3e906a0 devfreq: Rename watermark governor
This patch renames watermark governor from "watermark" to
"wmark_simple". This allows having more complex watermark
based scaling algorithms available.

Change-Id: If6a5653300f964173e6581bf256f7bf65041beb9
Signed-off-by: Arto Merilainen <amerilainen@nvidia.com>
Reviewed-on: http://git-master/r/598799
Signed-off-by: Shridhar Rasal <srasal@nvidia.com>
Reviewed-on: http://git-master/r/1160006
(cherry picked from linux-4.9 commit a47423f57343b9609341065350e399ada5d767d0)
[talho: removed Kconfig and Makefile changes from patch]
Signed-off-by: Timo Alho <talho@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1770138
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-04 05:18:03 +00:00
Ishan Mittal
7471ea5dc2 devfreq: governor_pod_scaling: Fix build errors
MODULE_LICENCE was not declared
exit function didnt have an explicit return

linux/module.h wasn't included because of which
module_exit was throwing errors.
Added the statement to do the same.

Bug 200199306

Change-Id: Ib9e3a6f832b75095b9465dbe236a1f1c3606563f
Signed-off-by: Ishan Mittal <imittal@nvidia.com>
(cherry picked from linux-4.9 commit be9e41d39b8f9b6bbd716ea7a26ea7fdec54bad7)
Reviewed-on: https://git-master.nvidia.com/r/1770137
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Timo Alho <talho@nvidia.com>
Tested-by: Timo Alho <talho@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-04 05:18:03 +00:00
Deepak Nibade
b69d69ec4d devfreq: compare previous_freq only if podgov disabled
In update_devfreq(), we currently get target frequency,
compare it with previous_freq, and set it only if
new freq is different one

But get_target_freq() (nvhost_pod_estimate_freq())
already takes care of such cases in normal conditions
Hence, remove the check with previous_freq in
update_devfreq()

For case when we disable podgov governor, we might still end
up setting max freq all the time
Hence, add a check on previous_freq, and if previous_freq
is already max, do not set it

Bug 200175874
Bug 200161377

Change-Id: I287d37c07ee6214ed48612482211ce0f45088ca4
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: http://git-master/r/1111437
Reviewed-on: http://git-master/r/1113417
(cherry picked from linux-4.9 commit 9c424ce31bedac5db0c2d93e083f20ea89ed1836)
Reviewed-on: https://git-master.nvidia.com/r/1770136
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Timo Alho <talho@nvidia.com>
Tested-by: Timo Alho <talho@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-04 05:18:03 +00:00
Deepak Nibade
fbde18a19c devfreq: get dev status after checking if scaling is enabled
In nvhost_pod_estimate_freq(), we currently have below
sequence
- profile->get_dev_status()
- check if (!podgov->enable)
- check if (podgov->p_user)

But in case we have podgov disabled, we unnecessarily
call profile->get_dev_status()

Hence, do all such checks before calling get_dev_status()

Bug 200161377

Change-Id: I6128803c21bea6c5efefd517ea1c69e4f1b1597e
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: http://git-master/r/929508
Reviewed-on: http://git-master/r/933703
(cherry picked from linux-4.9 commit b8d1d439d206887c3cf4ff50119647b02efdae0e)
Reviewed-on: https://git-master.nvidia.com/r/1770135
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Timo Alho <talho@nvidia.com>
Tested-by: Timo Alho <talho@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-04 05:18:03 +00:00
Seshendra Gadagottu
efcf59c618 devfreq: tegra: add support for t18x
Extend devfreq support for t18x

Change-Id: I379110f9a1fb0b002b7224374f49a127929a635d
Signed-off-by: Seshendra Gadagottu <sgadagottu@nvidia.com>
Reviewed-on: http://git-master/r/816897
Reviewed-on: http://git-master/r/828639
(cherry picked from linux-4.9 commit 4a43088268a3fe87b6208a77e806b4891226f9ff)
Reviewed-on: https://git-master.nvidia.com/r/1770134
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
Tested-by: Bitan Biswas <bbiswas@nvidia.com>
Reviewed-by: Timo Alho <talho@nvidia.com>
Tested-by: Timo Alho <talho@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-04 05:18:03 +00:00
Sam Payne
23ee901b27 video: tegra: host: move pod_scaling.c
move pod_scaling.c from nvhost to devfreq

bug 1645757

Change-Id: I0e905bf7e14aa264c4235ddfa94536acd5e4c008
Signed-off-by: Sam Payne <spayne@nvidia.com>
Reviewed-on: http://git-master/r/743942
Reviewed-on: http://git-master/r/756665
(cherry picked from linux-4.9 commit 80a8f5a341351c3973aee12fe1615785bcf8d6ee)
Reviewed-on: https://git-master.nvidia.com/r/1770133
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Timo Alho <talho@nvidia.com>
Tested-by: Timo Alho <talho@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-04 05:18:03 +00:00
Laxman Dewangan
cfaad5bd1c devfreq: remove Makefile to prepare for driver integration
The devfreq drivers are available in kernel/nvidia and it
is required to integrate in kernel/nvidia-oot.

Remove Makefile so avoid makefile conflict.

Bug 4038415

Change-Id: If0e81b66271d65c5a6d613d61be0e95d1af503e1
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
2023-04-04 05:15:37 +00:00
Laxman Dewangan
b2a93e8e3b devfreq: Build governor pod scaling as OOT module
Make pod scaling governor as the OOT module.

Bug 3674466

Change-Id: Id99a72f508889d0b9c416ba908f8a2de62c594d1
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2726249
Reviewed-by: Krishna Yarlagadda <kyarlagadda@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-06-08 21:46:31 -07:00