[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <75c4a105-b925-4d6a-8c42-38f3ab32a7ca@linaro.org>
Date: Wed, 25 Oct 2023 11:16:25 +0200
From: Konrad Dybcio <konrad.dybcio@...aro.org>
To: Bryan O'Donoghue <bryan.odonoghue@...aro.org>,
hverkuil-cisco@...all.nl, laurent.pinchart@...asonboard.com,
rfoss@...nel.org, todor.too@...il.com, agross@...nel.org,
andersson@...nel.org, mchehab@...nel.org
Cc: linux-media@...r.kernel.org, linux-arm-msm@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/4] media: qcom: camss: Convert to per-VFE pointer for
power-domain linkages
On 10/25/23 00:42, Bryan O'Donoghue wrote:
> Right now we use the top-level camss structure to provide pointers via
> VFE id index back to genpd linkages.
>
> In effect this hard-codes VFE indexes to power-domain indexes in the
> dtsi and mandates a very particular ordering of power domains in the
> dtsi, which bears no relationship to a real hardware dependency.
>
> As a first step to rationalising the VFE power-domain code and breaking
> the magic indexing in dtsi use per-VFE pointers to genpd linkages.
>
> The top-level index in msm_vfe_subdev_init is still used to attain the
> initial so no functional or logical change arises from this change.
>
> Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@...aro.org>
> ---
[...]
> @@ -653,11 +653,11 @@ static int vfe_pm_domain_on(struct vfe_device *vfe)
> if (id >= camss->res->vfe_num)
> return 0;
>
> - camss->genpd_link[id] = device_link_add(camss->dev, camss->genpd[id],
> - DL_FLAG_STATELESS |
> - DL_FLAG_PM_RUNTIME |
> - DL_FLAG_RPM_ACTIVE);
Good opportunity to inilne vfe->id and get rid of a local var!
> - if (!camss->genpd_link[id])
> + vfe->genpd_link = device_link_add(camss->dev, vfe->genpd,
> + DL_FLAG_STATELESS |
> + DL_FLAG_PM_RUNTIME |
> + DL_FLAG_RPM_ACTIVE);
> + if (!vfe->genpd_link)
> return -EINVAL;
>
[...]
> /*
> @@ -1128,10 +1124,10 @@ static int vfe_pm_domain_on(struct vfe_device *vfe)
> struct camss *camss = vfe->camss;
> enum vfe_line_id id = vfe->id;
>
> - camss->genpd_link[id] = device_link_add(camss->dev, camss->genpd[id], DL_FLAG_STATELESS |
> - DL_FLAG_PM_RUNTIME | DL_FLAG_RPM_ACTIVE);
> + vfe->genpd_link = device_link_add(camss->dev, vfe->genpd, DL_FLAG_STATELESS |
> + DL_FLAG_PM_RUNTIME | DL_FLAG_RPM_ACTIVE);
>
> - if (!camss->genpd_link[id]) {
> + if (!vfe->genpd_link) {
> dev_err(vfe->camss->dev, "Failed to add VFE#%d to power domain\n", id);
> return -EINVAL;
And here
[...]
> @@ -1113,10 +1111,10 @@ static int vfe_pm_domain_on(struct vfe_device *vfe)
> struct camss *camss = vfe->camss;
> enum vfe_line_id id = vfe->id;
>
> - camss->genpd_link[id] = device_link_add(camss->dev, camss->genpd[id], DL_FLAG_STATELESS |
> - DL_FLAG_PM_RUNTIME | DL_FLAG_RPM_ACTIVE);
> + vfe->genpd_link = device_link_add(camss->dev, vfe->genpd, DL_FLAG_STATELESS |
> + DL_FLAG_PM_RUNTIME | DL_FLAG_RPM_ACTIVE);
>
> - if (!camss->genpd_link[id]) {
> + if (!vfe->genpd_link) {
> dev_err(vfe->camss->dev, "Failed to add VFE#%d to power domain\n", id);
> return -EINVAL;
And here
[...]
>
> /*
> @@ -478,11 +478,11 @@ static int vfe_pm_domain_on(struct vfe_device *vfe)
> if (id >= camss->res->vfe_num)
> return 0;
>
> - camss->genpd_link[id] = device_link_add(camss->dev, camss->genpd[id],
> - DL_FLAG_STATELESS |
> - DL_FLAG_PM_RUNTIME |
> - DL_FLAG_RPM_ACTIVE);
> - if (!camss->genpd_link[id])
> + vfe->genpd_link = device_link_add(camss->dev, vfe->genpd,
> + DL_FLAG_STATELESS |
> + DL_FLAG_PM_RUNTIME |
> + DL_FLAG_RPM_ACTIVE);
And here
Konrad
Powered by blists - more mailing lists