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
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
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 mobile promotions
parent 001e9a2695
commit e81d0e8ff8
2 changed files with 8 additions and 2 deletions

View File

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

View File

@@ -1,7 +1,7 @@
/*
* 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
* under the terms and conditions of the GNU General Public License,
@@ -21,10 +21,14 @@
#include <linux/devfreq_cooling.h>
#endif
#include <linux/export.h>
#ifdef CONFIG_GK20A_PM_QOS
#include <linux/pm_qos.h>
#endif
#include <linux/version.h>
#if LINUX_VERSION_CODE <= KERNEL_VERSION(4, 14, 0)
#include <governor.h>
#endif
#include <nvgpu/kmem.h>
#include <nvgpu/log.h>
@@ -403,7 +407,9 @@ void gk20a_scale_init(struct device *dev)
return;
profile->dev = dev;
#ifdef CONFIG_GK20A_PM_QOS
profile->dev_stat.busy = false;
#endif
/* Create frequency table */
err = gk20a_scale_make_freq_table(profile);