[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAA8EJprgJvOGCU_PvAHCNoMvSam8QV4x9N2ZEm+oer5d7B-cPA@mail.gmail.com>
Date: Tue, 8 Mar 2022 20:09:35 +0300
From: Dmitry Baryshkov <dmitry.baryshkov@...aro.org>
To: Vinod Polimera <quic_vpolimer@...cinc.com>
Cc: dri-devel@...ts.freedesktop.org, linux-arm-msm@...r.kernel.org,
freedreno@...ts.freedesktop.org, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org, robdclark@...il.com,
dianders@...omium.org, swboyd@...omium.org,
quic_kalyant@...cinc.com
Subject: Re: [PATCH v5 5/5] drm/msm/disp/dpu1: set mdp clk to the maximum
frequency in opp table during probe
On Tue, 8 Mar 2022 at 19:55, Vinod Polimera <quic_vpolimer@...cinc.com> wrote:
>
> use max clock during probe/bind sequence from the opp table.
> The clock will be scaled down when framework sends an update.
>
> Signed-off-by: Vinod Polimera <quic_vpolimer@...cinc.com>
> ---
> drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
> index d550f90..d9922b9 100644
> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
> @@ -1221,6 +1221,7 @@ static int dpu_bind(struct device *dev, struct device *master, void *data)
> struct dpu_kms *dpu_kms;
> struct dss_module_power *mp;
> int ret = 0;
> + unsigned long max_freq = ULONG_MAX;
>
> dpu_kms = devm_kzalloc(&pdev->dev, sizeof(*dpu_kms), GFP_KERNEL);
> if (!dpu_kms)
> @@ -1243,6 +1244,8 @@ static int dpu_bind(struct device *dev, struct device *master, void *data)
> return ret;
> }
>
> + dev_pm_opp_find_freq_floor(dev, &max_freq);
You leak a reference to the opp here. The function returns a value,
which should be dev_pm_opp_put().
Moreover judging from the dev_pm_opp_set_rate() code I think you don't
have to find an exact frequency, as it will call
clk_round_rate()/_find_freq_ceil() anyway.
Could you please check that it works?
> + dev_pm_opp_set_rate(dev, max_freq);
> platform_set_drvdata(pdev, dpu_kms);
>
> ret = msm_kms_init(&dpu_kms->base, &kms_funcs);
> --
> 2.7.4
>
--
With best wishes
Dmitry
Powered by blists - more mailing lists