From d6c7740ea2ddd9d5087d938e9ee3b3bc2c9b6d0a Mon Sep 17 00:00:00 2001 From: Aaron Tian Date: Wed, 18 Sep 2019 17:13:19 +0800 Subject: video: tegra: host: update T186 VIC actmon driver Modify T186/T210 VIC actmon driver and wmark_active governor to address the following issues: 1. To let VIC actmon reports accurate VIC active cycle counts, set static WEIGHT_COUNT in both VIC actmon and VIC IP block. It ensures VIC actmon can capture all activity signal toggle event from VIC. The value of WEIGHT_COUNT are equal to: 4 * (max VIC freq / VIC_actmon freq) = 4 * (1024 / 19.2) ~= 213 2. Since VIC actmon reports active "VIC clock cycle" instead of "VIC actmon clock cycle", "relative loading translation" should consider current VIC clock freq. E.g., - sample_period = 80 us, VIC freq = 115.2 Mhz - 9216 cycles represents 100% loading (115.2 * 80) 3. Update upper/lower wmark settings after VIC clock scaled completed, to ensure wmark settings are equil to 0 ~ 100% loading of current freq. - Register 'get_dev_status' instance in devfreq_dev_profile, to let wmark active governor can query current device freq. - Register devfreq transition notifier in wmark_active governor. It will query current device freq. and update corresponding wmark value after VIC freq. changed. Bug 200501949 Change-Id: Ic159eb93fddc37d55b0c9649a3afcb50ed82cac2 Signed-off-by: Aaron Tian Reviewed-on: https://git-master.nvidia.com/r/2200520 GVS: Gerrit_Virtual_Submit Reviewed-by: Arto Merilainen Reviewed-by: Mikko Perttunen Reviewed-by: mobile promotions Tested-by: mobile promotions --- include/linux/nvhost.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'include') diff --git a/include/linux/nvhost.h b/include/linux/nvhost.h index d6170f7dc..68b967888 100644 --- a/include/linux/nvhost.h +++ b/include/linux/nvhost.h @@ -108,6 +108,11 @@ struct nvhost_gating_register { u32 disable; }; +struct nvhost_actmon_register { + u32 addr; + u32 val; +}; + struct nvhost_clock { char *name; unsigned long default_rate; @@ -244,6 +249,9 @@ struct nvhost_device_data { bool linear_emc; /* Offset to actmon registers */ u32 actmon_regs; + /* WEIGHT_COUNT of actmon */ + u32 actmon_weight_count; + struct nvhost_actmon_register *actmon_setting_regs; /* Devfreq governor name */ const char *devfreq_governor; unsigned long freqs[NVHOST_MODULE_MAX_FREQS]; -- cgit v1.2.2