[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <0fbef967-62db-4c5f-8108-2c545c53a39e@linaro.org>
Date: Sat, 18 Nov 2023 01:32:31 +0100
From: Konrad Dybcio <konrad.dybcio@...aro.org>
To: Bryan O'Donoghue <bryan.odonoghue@...aro.org>,
hverkuil-cisco@...all.nl, laurent.pinchart@...asonboard.com,
Robert Foss <rfoss@...nel.org>,
Todor Tomov <todor.too@...il.com>,
Andy Gross <agross@...nel.org>,
Bjorn Andersson <andersson@...nel.org>,
Mauro Carvalho Chehab <mchehab@...nel.org>,
matti.lehtimaki@...il.com, quic_grosikop@...cinc.com
Cc: linux-media@...r.kernel.org, linux-arm-msm@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v4 4/7] media: qcom: camss: Move VFE power-domain
specifics into vfe.c
On 3.11.2023 13:29, Bryan O'Donoghue wrote:
> Moving the location of the hooks to VFE power domains has several
> advantages.
>
> 1. Separation of concerns and functional decomposition.
> vfe.c should be responsible for and know best how manage
> power-domains for a VFE, excising from camss.c follows this
> principle.
>
> 2. Embedding a pointer to genpd in struct camss_vfe{} meas that we can
> dispense with a bunch of kmalloc array inside of camss.c.
>
> 3. Splitting up titan top gdsc from vfe/ife gdsc provides a base for
> breaking up magic indexes in dtsi.
>
> Suggested-by: Matti Lehtimäki <matti.lehtimaki@...il.com>
> Tested-by: Matti Lehtimäki <matti.lehtimaki@...il.com>
> Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@...aro.org>
> ---
[...]
> +/*
> + * msm_vfe_genpd_cleanup - Cleanup VFE genpd linkages
> + * @vfe: VFE device
You can even give this an upgrade to kerneldoc! :)
[...]
> + /* count the # of VFEs which have flagged power-domain */
[...]
Personal peeve, but this comment seems a bit excessive
> + for (vfepd_num = i = 0; i < camss->vfe_total_num; i++) {
> + if (res->vfe_res[i].has_pd)
> + vfepd_num++;
> + }
>
> - camss->genpd_link = devm_kmalloc_array(dev, camss->genpd_num,
> - sizeof(*camss->genpd_link),
> - GFP_KERNEL);
> - if (!camss->genpd_link)
> - return -ENOMEM;
> + /*
> + * If the number of power-domains is greater than the number of VFEs
> + * then the additional power-domain is for the entire CAMSS block the
> + * 'top' power-domain.
the last 3 words seem out of place
> + */
> + if (camss->genpd_num <= vfepd_num)
> + return 0;
if (!(camss->genpd_num > vfepd_num))
would probably be easier to follow given your comment above
Konrad
Powered by blists - more mailing lists