lkml.org 
[lkml]   [2023]   [Aug]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v2 6/6] venus: pm_helpers: Use dev_pm_genpd_set_hwmode to switch GDSC mode
From
On 16.08.2023 16:57, Abel Vesa wrote:
> From: Jagadeesh Kona <quic_jkona@quicinc.com>
>
> This change demonstrates the use of dev_pm_genpd_set_hwmode API from
> video driver to switch the video mvs0 gdsc to SW/HW modes at runtime
> based on requirement.
>
> This change adds a new boolean array member vcodec_pmdomains_hwctrl in
> venus_resources structure to indicate if GDSC's have HW control support
> or not. This data is used in vcodec_control_v4() to check if GDSC has
> support to switch to HW control mode and then call dev_pm_genpd_set_hwmode
> to switch the GDSC mode.
>
> Signed-off-by: Jagadeesh Kona <quic_jkona@quicinc.com>
> Signed-off-by: Abel Vesa <abel.vesa@linaro.org>
> ---
[...]

> static int vcodec_control_v4(struct venus_core *core, u32 coreid, bool enable)
> {
> - void __iomem *ctrl, *stat;
> - u32 val;
> - int ret;
> -
> - if (IS_V6(core)) {
> - ctrl = core->wrapper_base + WRAPPER_CORE_POWER_CONTROL_V6;
> - stat = core->wrapper_base + WRAPPER_CORE_POWER_STATUS_V6;
> - } else if (coreid == VIDC_CORE_ID_1) {
> - ctrl = core->wrapper_base + WRAPPER_VCODEC0_MMCC_POWER_CONTROL;
> - stat = core->wrapper_base + WRAPPER_VCODEC0_MMCC_POWER_STATUS;
> - } else {
> - ctrl = core->wrapper_base + WRAPPER_VCODEC1_MMCC_POWER_CONTROL;
> - stat = core->wrapper_base + WRAPPER_VCODEC1_MMCC_POWER_STATUS;
> - }
> -
> - if (enable) {
> - writel(0, ctrl);
> -
> - ret = readl_poll_timeout(stat, val, val & BIT(1), 1, 100);
> - if (ret)
> - return ret;
> - } else {
> - writel(1, ctrl);
This removal cries for better explanation.

Has the venus hw been setting some registers that alter the GDSC's state?
Or the hardware's expectations of the GDSC state?

Konrad

\
 
 \ /
  Last update: 2023-08-16 20:00    [W:0.100 / U:0.268 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site