mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-22 17:25:35 +03:00
drm/tegra: Set nvjpg actmon count weight once
Change the implementation to set count weight values for both actmon and the engine once in runtime resume cycle to align the implementation as nvdec for kernel upstream. Bug 4251915 Signed-off-by: Johnny Liu <johnliu@nvidia.com> Change-Id: I6df0f13d1c58402cb78e4e05ff6cd6cd21ef2c4b Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2965505 Reviewed-by: svcacv <svcacv@nvidia.com> Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com> GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
d6a45460a5
commit
1dcfd26f70
@@ -73,9 +73,8 @@ static inline void nvjpg_writel(struct nvjpg *nvjpg, u32 value, unsigned int off
|
||||
|
||||
static int nvjpg_set_rate(struct nvjpg *nvjpg, unsigned long rate)
|
||||
{
|
||||
struct host1x_client *client = &nvjpg->client.base;
|
||||
unsigned long dev_rate;
|
||||
u32 weight, emc_kbps;
|
||||
u32 emc_kbps;
|
||||
int err;
|
||||
|
||||
err = clk_set_rate(nvjpg->clk, rate);
|
||||
@@ -87,11 +86,6 @@ static int nvjpg_set_rate(struct nvjpg *nvjpg, unsigned long rate)
|
||||
|
||||
dev_rate = clk_get_rate(nvjpg->clk);
|
||||
|
||||
host1x_actmon_update_client_rate(client, dev_rate, &weight);
|
||||
|
||||
if (weight)
|
||||
nvjpg_writel(nvjpg, weight, NVJPG_TFBIF_ACTMON_ACTIVE_WEIGHT);
|
||||
|
||||
if (nvjpg->icc_write) {
|
||||
emc_kbps = dev_rate * NVJPG_AXI_RW_BANDWIDTH / 1024;
|
||||
err = icc_set_bw(nvjpg->icc_write, kbps_to_icc(emc_kbps), 0);
|
||||
@@ -447,6 +441,17 @@ static void nvjpg_actmon_reg_init(struct nvjpg *nvjpg)
|
||||
NVJPG_TFBIF_ACTMON_ACTIVE_BORPS);
|
||||
}
|
||||
|
||||
static void nvjpg_count_weight_init(struct nvjpg *nvjpg, unsigned long rate)
|
||||
{
|
||||
struct host1x_client *client = &nvjpg->client.base;
|
||||
u32 weight = 0;
|
||||
|
||||
host1x_actmon_update_client_rate(client, rate, &weight);
|
||||
|
||||
if (weight)
|
||||
nvjpg_writel(nvjpg, weight, NVJPG_TFBIF_ACTMON_ACTIVE_WEIGHT);
|
||||
}
|
||||
|
||||
static __maybe_unused int nvjpg_runtime_resume(struct device *dev)
|
||||
{
|
||||
struct nvjpg *nvjpg = dev_get_drvdata(dev);
|
||||
@@ -472,6 +477,8 @@ static __maybe_unused int nvjpg_runtime_resume(struct device *dev)
|
||||
|
||||
nvjpg_actmon_reg_init(nvjpg);
|
||||
|
||||
nvjpg_count_weight_init(nvjpg, nvjpg->devfreq->resume_freq);
|
||||
|
||||
host1x_actmon_enable(&nvjpg->client.base);
|
||||
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user