gpu: nvgpu: enable DEVFREQ for Sidecar

Enable DEVFREQ for OOT module unconditionally as the podgov governor
module.

linux/pm_qos is only used for downstream supported modifications
which is currently determined by CONFIG_GK20A_PM_QOS.

struct devfreq_dev_status doesn't have any field 'busy' in the upstream
driver hence enable it only for when downstream driver is in use
activated by CONFIG_GK20A_PM_QOS.

governor.h is only needed for android platforms which depend on 4.9
version of the kernel in downstream builds. Hence, added an compile
time flag to remove it for kernels versions greater than 4.9.

Jira LS-418

Signed-off-by: Debarshi Dutta <ddutta@nvidia.com>
Change-Id: Id242bd28e66ed187208f0d7975ee0bc508730a88
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2705766
(cherry picked from commit e81d0e8ff8)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2734112
Reviewed-by: Jonathan Hunter <jonathanh@nvidia.com>
Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
GVS: Gerrit_Virtual_Submit
This commit is contained in:
Debarshi Dutta
2022-05-02 09:00:43 +05:30
committed by Amulya Yarlagadda
parent 0cecc5c5ab
commit 8cdf3a087f
2 changed files with 8 additions and 2 deletions

View File

@@ -202,7 +202,7 @@ endif
# Set config for OOT module build # Set config for OOT module build
ifeq ($(CONFIG_TEGRA_OOT_MODULE),m) ifeq ($(CONFIG_TEGRA_OOT_MODULE),m)
CONFIG_GK20A_DEVFREQ := n CONFIG_GK20A_DEVFREQ := y
CONFIG_GK20A_PM_QOS := n CONFIG_GK20A_PM_QOS := n
endif endif

View File

@@ -1,7 +1,7 @@
/* /*
* gk20a clock scaling profile * gk20a clock scaling profile
* *
* Copyright (c) 2013-2021, NVIDIA Corporation. All rights reserved. * Copyright (c) 2013-2022, NVIDIA Corporation. All rights reserved.
* *
* This program is free software; you can redistribute it and/or modify it * This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License, * under the terms and conditions of the GNU General Public License,
@@ -21,10 +21,14 @@
#include <linux/devfreq_cooling.h> #include <linux/devfreq_cooling.h>
#endif #endif
#include <linux/export.h> #include <linux/export.h>
#ifdef CONFIG_GK20A_PM_QOS
#include <linux/pm_qos.h> #include <linux/pm_qos.h>
#endif
#include <linux/version.h> #include <linux/version.h>
#if LINUX_VERSION_CODE <= KERNEL_VERSION(4, 14, 0)
#include <governor.h> #include <governor.h>
#endif
#include <nvgpu/kmem.h> #include <nvgpu/kmem.h>
#include <nvgpu/log.h> #include <nvgpu/log.h>
@@ -403,7 +407,9 @@ void gk20a_scale_init(struct device *dev)
return; return;
profile->dev = dev; profile->dev = dev;
#ifdef CONFIG_GK20A_PM_QOS
profile->dev_stat.busy = false; profile->dev_stat.busy = false;
#endif
/* Create frequency table */ /* Create frequency table */
err = gk20a_scale_make_freq_table(profile); err = gk20a_scale_make_freq_table(profile);