mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-22 17:25:35 +03:00
drm/tegra: Wrap register init code in function
Put the actmon-related register initialization code in the function for readability. Bug 4183393 Signed-off-by: Johnny Liu <johnliu@nvidia.com> Change-Id: Id68d128ae330105da0d3f76270fe38d57c12c740 Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2931793 Tested-by: mobile promotions <svcmobile_promotions@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
3264c9dfca
commit
ff572997a3
@@ -521,22 +521,9 @@ cleanup:
|
|||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
static __maybe_unused int nvdec_runtime_resume(struct device *dev)
|
static void nvdec_actmon_reg_init(struct nvdec *nvdec)
|
||||||
{
|
{
|
||||||
struct nvdec *nvdec = dev_get_drvdata(dev);
|
|
||||||
int err;
|
|
||||||
|
|
||||||
err = clk_bulk_prepare_enable(nvdec->num_clks, nvdec->clks);
|
|
||||||
if (err < 0)
|
|
||||||
return err;
|
|
||||||
|
|
||||||
usleep_range(10, 20);
|
|
||||||
|
|
||||||
if (nvdec->config->has_riscv) {
|
if (nvdec->config->has_riscv) {
|
||||||
err = nvdec_boot_riscv(nvdec);
|
|
||||||
if (err < 0)
|
|
||||||
goto disable;
|
|
||||||
|
|
||||||
nvdec_writel(nvdec,
|
nvdec_writel(nvdec,
|
||||||
NVDEC_FW_MTHD_ADDR_ACTMON_ACTIVE_MASK,
|
NVDEC_FW_MTHD_ADDR_ACTMON_ACTIVE_MASK,
|
||||||
NVDEC_FALCON_UCLASS_METHOD_OFFSET);
|
NVDEC_FALCON_UCLASS_METHOD_OFFSET);
|
||||||
@@ -553,14 +540,6 @@ static __maybe_unused int nvdec_runtime_resume(struct device *dev)
|
|||||||
NVDEC_TFBIF_ACTMON_ACTIVE_BORPS_ACTIVE,
|
NVDEC_TFBIF_ACTMON_ACTIVE_BORPS_ACTIVE,
|
||||||
NVDEC_FALCON_UCLASS_METHOD_DATA);
|
NVDEC_FALCON_UCLASS_METHOD_DATA);
|
||||||
} else {
|
} else {
|
||||||
err = nvdec_load_falcon_firmware(nvdec);
|
|
||||||
if (err < 0)
|
|
||||||
goto disable;
|
|
||||||
|
|
||||||
err = nvdec_boot_falcon(nvdec);
|
|
||||||
if (err < 0)
|
|
||||||
goto disable;
|
|
||||||
|
|
||||||
nvdec_writel(nvdec,
|
nvdec_writel(nvdec,
|
||||||
NVDEC_TFBIF_ACTMON_ACTIVE_MASK_DELAYED |
|
NVDEC_TFBIF_ACTMON_ACTIVE_MASK_DELAYED |
|
||||||
NVDEC_TFBIF_ACTMON_ACTIVE_MASK_STALLED |
|
NVDEC_TFBIF_ACTMON_ACTIVE_MASK_STALLED |
|
||||||
@@ -571,6 +550,34 @@ static __maybe_unused int nvdec_runtime_resume(struct device *dev)
|
|||||||
NVDEC_TFBIF_ACTMON_ACTIVE_BORPS_ACTIVE,
|
NVDEC_TFBIF_ACTMON_ACTIVE_BORPS_ACTIVE,
|
||||||
NVDEC_TFBIF_ACTMON_ACTIVE_BORPS);
|
NVDEC_TFBIF_ACTMON_ACTIVE_BORPS);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static __maybe_unused int nvdec_runtime_resume(struct device *dev)
|
||||||
|
{
|
||||||
|
struct nvdec *nvdec = dev_get_drvdata(dev);
|
||||||
|
int err;
|
||||||
|
|
||||||
|
err = clk_bulk_prepare_enable(nvdec->num_clks, nvdec->clks);
|
||||||
|
if (err < 0)
|
||||||
|
return err;
|
||||||
|
|
||||||
|
usleep_range(10, 20);
|
||||||
|
|
||||||
|
if (nvdec->config->has_riscv) {
|
||||||
|
err = nvdec_boot_riscv(nvdec);
|
||||||
|
if (err < 0)
|
||||||
|
goto disable;
|
||||||
|
} else {
|
||||||
|
err = nvdec_load_falcon_firmware(nvdec);
|
||||||
|
if (err < 0)
|
||||||
|
goto disable;
|
||||||
|
|
||||||
|
err = nvdec_boot_falcon(nvdec);
|
||||||
|
if (err < 0)
|
||||||
|
goto disable;
|
||||||
|
}
|
||||||
|
|
||||||
|
nvdec_actmon_reg_init(nvdec);
|
||||||
|
|
||||||
host1x_actmon_enable(&nvdec->client.base);
|
host1x_actmon_enable(&nvdec->client.base);
|
||||||
|
|
||||||
|
|||||||
@@ -435,6 +435,18 @@ cleanup:
|
|||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void nvenc_actmon_reg_init(struct nvenc *nvenc)
|
||||||
|
{
|
||||||
|
nvenc_writel(nvenc,
|
||||||
|
NVENC_TFBIF_ACTMON_ACTIVE_MASK_DELAYED |
|
||||||
|
NVENC_TFBIF_ACTMON_ACTIVE_MASK_STALLED |
|
||||||
|
NVENC_TFBIF_ACTMON_ACTIVE_MASK_STARVED,
|
||||||
|
NVENC_TFBIF_ACTMON_ACTIVE_MASK);
|
||||||
|
|
||||||
|
nvenc_writel(nvenc,
|
||||||
|
NVENC_TFBIF_ACTMON_ACTIVE_BORPS_ACTIVE,
|
||||||
|
NVENC_TFBIF_ACTMON_ACTIVE_BORPS);
|
||||||
|
}
|
||||||
|
|
||||||
static __maybe_unused int nvenc_runtime_resume(struct device *dev)
|
static __maybe_unused int nvenc_runtime_resume(struct device *dev)
|
||||||
{
|
{
|
||||||
@@ -455,15 +467,7 @@ static __maybe_unused int nvenc_runtime_resume(struct device *dev)
|
|||||||
if (err < 0)
|
if (err < 0)
|
||||||
goto disable;
|
goto disable;
|
||||||
|
|
||||||
nvenc_writel(nvenc,
|
nvenc_actmon_reg_init(nvenc);
|
||||||
NVENC_TFBIF_ACTMON_ACTIVE_MASK_DELAYED |
|
|
||||||
NVENC_TFBIF_ACTMON_ACTIVE_MASK_STALLED |
|
|
||||||
NVENC_TFBIF_ACTMON_ACTIVE_MASK_STARVED,
|
|
||||||
NVENC_TFBIF_ACTMON_ACTIVE_MASK);
|
|
||||||
|
|
||||||
nvenc_writel(nvenc,
|
|
||||||
NVENC_TFBIF_ACTMON_ACTIVE_BORPS_ACTIVE,
|
|
||||||
NVENC_TFBIF_ACTMON_ACTIVE_BORPS);
|
|
||||||
|
|
||||||
host1x_actmon_enable(&nvenc->client.base);
|
host1x_actmon_enable(&nvenc->client.base);
|
||||||
|
|
||||||
|
|||||||
@@ -434,6 +434,18 @@ cleanup:
|
|||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void nvjpg_actmon_reg_init(struct nvjpg *nvjpg)
|
||||||
|
{
|
||||||
|
nvjpg_writel(nvjpg,
|
||||||
|
NVJPG_TFBIF_ACTMON_ACTIVE_MASK_STARVED |
|
||||||
|
NVJPG_TFBIF_ACTMON_ACTIVE_MASK_STALLED |
|
||||||
|
NVJPG_TFBIF_ACTMON_ACTIVE_MASK_DELAYED,
|
||||||
|
NVJPG_TFBIF_ACTMON_ACTIVE_MASK);
|
||||||
|
|
||||||
|
nvjpg_writel(nvjpg,
|
||||||
|
NVJPG_TFBIF_ACTMON_ACTIVE_BORPS_ACTIVE,
|
||||||
|
NVJPG_TFBIF_ACTMON_ACTIVE_BORPS);
|
||||||
|
}
|
||||||
|
|
||||||
static __maybe_unused int nvjpg_runtime_resume(struct device *dev)
|
static __maybe_unused int nvjpg_runtime_resume(struct device *dev)
|
||||||
{
|
{
|
||||||
@@ -454,15 +466,7 @@ static __maybe_unused int nvjpg_runtime_resume(struct device *dev)
|
|||||||
if (err < 0)
|
if (err < 0)
|
||||||
goto disable;
|
goto disable;
|
||||||
|
|
||||||
nvjpg_writel(nvjpg,
|
nvjpg_actmon_reg_init(nvjpg);
|
||||||
NVJPG_TFBIF_ACTMON_ACTIVE_MASK_STARVED |
|
|
||||||
NVJPG_TFBIF_ACTMON_ACTIVE_MASK_STALLED |
|
|
||||||
NVJPG_TFBIF_ACTMON_ACTIVE_MASK_DELAYED,
|
|
||||||
NVJPG_TFBIF_ACTMON_ACTIVE_MASK);
|
|
||||||
|
|
||||||
nvjpg_writel(nvjpg,
|
|
||||||
NVJPG_TFBIF_ACTMON_ACTIVE_BORPS_ACTIVE,
|
|
||||||
NVJPG_TFBIF_ACTMON_ACTIVE_BORPS);
|
|
||||||
|
|
||||||
host1x_actmon_enable(&nvjpg->client.base);
|
host1x_actmon_enable(&nvjpg->client.base);
|
||||||
|
|
||||||
|
|||||||
@@ -486,6 +486,19 @@ cleanup:
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static void vic_actmon_reg_init(struct vic *vic)
|
||||||
|
{
|
||||||
|
vic_writel(vic,
|
||||||
|
VIC_TFBIF_ACTMON_ACTIVE_MASK_STARVED |
|
||||||
|
VIC_TFBIF_ACTMON_ACTIVE_MASK_STALLED |
|
||||||
|
VIC_TFBIF_ACTMON_ACTIVE_MASK_DELAYED,
|
||||||
|
NV_PVIC_TFBIF_ACTMON_ACTIVE_MASK);
|
||||||
|
|
||||||
|
vic_writel(vic,
|
||||||
|
VIC_TFBIF_ACTMON_ACTIVE_BORPS_ACTIVE,
|
||||||
|
NV_PVIC_TFBIF_ACTMON_ACTIVE_BORPS);
|
||||||
|
}
|
||||||
|
|
||||||
static int __maybe_unused vic_runtime_resume(struct device *dev)
|
static int __maybe_unused vic_runtime_resume(struct device *dev)
|
||||||
{
|
{
|
||||||
struct vic *vic = dev_get_drvdata(dev);
|
struct vic *vic = dev_get_drvdata(dev);
|
||||||
@@ -511,15 +524,7 @@ static int __maybe_unused vic_runtime_resume(struct device *dev)
|
|||||||
if (err < 0)
|
if (err < 0)
|
||||||
goto assert;
|
goto assert;
|
||||||
|
|
||||||
vic_writel(vic,
|
vic_actmon_reg_init(vic);
|
||||||
VIC_TFBIF_ACTMON_ACTIVE_MASK_STARVED |
|
|
||||||
VIC_TFBIF_ACTMON_ACTIVE_MASK_STALLED |
|
|
||||||
VIC_TFBIF_ACTMON_ACTIVE_MASK_DELAYED,
|
|
||||||
NV_PVIC_TFBIF_ACTMON_ACTIVE_MASK);
|
|
||||||
|
|
||||||
vic_writel(vic,
|
|
||||||
VIC_TFBIF_ACTMON_ACTIVE_BORPS_ACTIVE,
|
|
||||||
NV_PVIC_TFBIF_ACTMON_ACTIVE_BORPS);
|
|
||||||
|
|
||||||
host1x_actmon_enable(&vic->client.base);
|
host1x_actmon_enable(&vic->client.base);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user