Commit Graph

7 Commits

Author SHA1 Message Date
Johnny Liu
408c3a8bb3 devfreq: track governor usage count
Prevent governor from unexpectedly getting unloaded when it is in used.

Bug 5394611

Change-Id: I84b2ee3ce7666d4107096d958971d28700e744b4
Signed-off-by: Johnny Liu <johnliu@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3408797
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
2025-07-24 10:20:36 +00:00
Jon Hunter
cdef2b63f6 drivers: Remove 'private' directories
Drivers in the NVIDIA OOT repository are public and so remove the
directories named 'private' to avoid any confusion once these sources
are released.

Bug 5054840

Change-Id: I9156e3b08df9ce3d90dc0a2b5e72416f28fac5f5
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3351272
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Ashish Mhetre <amhetre@nvidia.com>
Reviewed-by: Brad Griffis <bgriffis@nvidia.com>
2025-07-24 10:19:19 +00:00
Johnny Liu
5b3ba584c3 devfreq: use conftest for conditional module build
Some distros might use old kernel source but with some latest upstream
kernel patches backported to their kernel source tree. To deal with this
scenario and avoid kernel compilation failure, use conftest to check the
existence of features against the kernel source tree which the OOT
modules are built upon and do the conditional build based on the test
result generated with the conftest tool.

Use NV_DEVFREQ_HAS_FREQ_TABLE to determine whether freq_table field is
there in struct devfreq data strcuture, and choose the correct path for
building the module.

Use tegra_wmark-specific devfreq_get_freq_range always to avoid kernel
version check and conftest check. Since devfreq_get_freq_range exists in
the devfreq-specific governor.h (e.g. drivers/devfreq/governor.h) file
instead of globabl linux kernel include header files
(e.g. include/linux/devfreq.h), conftest cannot be used to the existence
of devfreq_get_freq_range kernel function.

Bug 4884092

Change-Id: I5bde4c712f59f38de74c1d8d95135c9b25d621b1
Signed-off-by: Johnny Liu <johnliu@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3220896
(cherry picked from commit c580fd0d06)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3220970
Reviewed-by: Jon Hunter <jonathanh@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:07 +00:00
Johnny Liu
e3ce443fc9 devfreq: Migrate to K519 devfreq for tegra_wmark
Since K519, devfreq takes the priority of devfreq_dev_profile to save
the frequency table information and the number of frequency steps.

Therefore, change the implementation of tegra_wmark devfreq governor to
use devfreq to access the frequency table information and the nubmer of
frequency steps instead of devfreq_dev_profile.

Bug 4288411

Signed-off-by: Johnny Liu <johnliu@nvidia.com>
Change-Id: Ib0affdcc8913642167cd82d45d014c46b51a8c38
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2980425
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-09-19 03:30:17 -07:00
Johnny Liu
3db3e1ee88 devfreq: Disable watermark when switching governor
Before switching to another governor, tegra_wmark governor should
disable watermarks so that watermark interrupts won't get triggered and
occupy the CPU resource.

Bug 4180241

Signed-off-by: Johnny Liu <johnliu@nvidia.com>
Change-Id: I7aa5611445153b63e4849f4c077ef5fa9fbf4c88
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2930457
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Rajkumar Kasirajan <rkasirajan@nvidia.com>
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-07-05 14:55:56 -07:00
Johnny Liu
0da771f275 devfreq: Support suspend and resume in tegra_wmark
When devfreq_suspend_device get called, tegra_wmark will disable the
upper and lower watermark thresholds so that no DFS logic get triggered
after the suspension.

When devfreq_resume_device get called, tegra_wmark will enable back the
upper and lower watermark thresholds so that interrupt-driven DFS logic
can work properly.

Bug 4168788

Signed-off-by: Johnny Liu <johnliu@nvidia.com>
Change-Id: I98fa1487db26fdfe95f5c958dbe15bf0f49035d5
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2927019
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-06-28 02:06:25 -07:00
Johnny Liu
d06443deae devfreq: Add tegra_wmark governor
The tegra_wmark governor can be used e.g. with DRM clients, such as VIC,
NVDEC, NVENC, and NVJPG. This governor tightly collaborates with the
actmon hardware used for monitoring the active time of the underlying
DRM clients.

Bug 3788919

Signed-off-by: Johnny Liu <johnliu@nvidia.com>
Change-Id: Ie4d4c2b173615aa239436fbb1545118435629d38
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2894529
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-05-09 22:27:14 -07:00