[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5772a34df56a8270b86a32143d890056b3ee33ba.camel@mediatek.com>
Date: Fri, 6 Oct 2023 08:58:09 +0000
From: CK Hu (胡俊光) <ck.hu@...iatek.com>
To: Shawn Sung (宋孝謙)
<Shawn.Sung@...iatek.com>,
"matthias.bgg@...il.com" <matthias.bgg@...il.com>,
"angelogioacchino.delregno@...labora.com"
<angelogioacchino.delregno@...labora.com>,
"robh+dt@...nel.org" <robh+dt@...nel.org>,
"krzysztof.kozlowski+dt@...aro.org"
<krzysztof.kozlowski+dt@...aro.org>
CC: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-mediatek@...ts.infradead.org"
<linux-mediatek@...ts.infradead.org>,
Singo Chang (張興國)
<Singo.Chang@...iatek.com>,
"chunkuang.hu@...nel.org" <chunkuang.hu@...nel.org>,
"devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
Jason-JH Lin (林睿祥)
<Jason-JH.Lin@...iatek.com>,
"mchehab@...nel.org" <mchehab@...nel.org>,
Nancy Lin (林欣螢) <Nancy.Lin@...iatek.com>,
"daniel@...ll.ch" <daniel@...ll.ch>,
"p.zabel@...gutronix.de" <p.zabel@...gutronix.de>,
"conor+dt@...nel.org" <conor+dt@...nel.org>,
"dri-devel@...ts.freedesktop.org" <dri-devel@...ts.freedesktop.org>,
"airlied@...il.com" <airlied@...il.com>,
"linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>
Subject: Re: [PATCH v7 16/23] drm/mediatek: Start/Stop components with
function pointers
Hi, Hsiao-chien:
On Fri, 2023-10-06 at 15:38 +0800, Hsiao Chien Sung wrote:
> By registering component related functions to the pointers,
> we can easily manage them within a for-loop and simplify the
> logic of component start/stop process.
Reviewed-by: CK Hu <ck.hu@...iatek.com>
>
> Signed-off-by: Hsiao Chien Sung <shawn.sung@...iatek.com>
> ---
> .../gpu/drm/mediatek/mtk_disp_ovl_adaptor.c | 20
> +++++++++++++++++--
> 1 file changed, 18 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/mediatek/mtk_disp_ovl_adaptor.c
> b/drivers/gpu/drm/mediatek/mtk_disp_ovl_adaptor.c
> index 84133303a6ec..812a1df9732f 100644
> --- a/drivers/gpu/drm/mediatek/mtk_disp_ovl_adaptor.c
> +++ b/drivers/gpu/drm/mediatek/mtk_disp_ovl_adaptor.c
> @@ -72,6 +72,8 @@ static const char * const
> private_comp_stem[OVL_ADAPTOR_TYPE_NUM] = {
> static const struct mtk_ddp_comp_funcs _ethdr = {
> .clk_enable = mtk_ethdr_clk_enable,
> .clk_disable = mtk_ethdr_clk_disable,
> + .start = mtk_ethdr_start,
> + .stop = mtk_ethdr_stop,
> };
>
> static const struct mtk_ddp_comp_funcs _merge = {
> @@ -189,16 +191,30 @@ void mtk_ovl_adaptor_config(struct device *dev,
> unsigned int w,
>
> void mtk_ovl_adaptor_start(struct device *dev)
> {
> + int i;
> struct mtk_disp_ovl_adaptor *ovl_adaptor =
> dev_get_drvdata(dev);
>
> - mtk_ethdr_start(ovl_adaptor-
> >ovl_adaptor_comp[OVL_ADAPTOR_ETHDR0]);
> + for (i = 0; i < OVL_ADAPTOR_ID_MAX; i++) {
> + if (!ovl_adaptor->ovl_adaptor_comp[i] ||
> + !comp_matches[i].funcs->start)
> + continue;
> +
> + comp_matches[i].funcs->start(ovl_adaptor-
> >ovl_adaptor_comp[i]);
> + }
> }
>
> void mtk_ovl_adaptor_stop(struct device *dev)
> {
> + int i;
> struct mtk_disp_ovl_adaptor *ovl_adaptor =
> dev_get_drvdata(dev);
>
> - mtk_ethdr_stop(ovl_adaptor-
> >ovl_adaptor_comp[OVL_ADAPTOR_ETHDR0]);
> + for (i = 0; i < OVL_ADAPTOR_ID_MAX; i++) {
> + if (!ovl_adaptor->ovl_adaptor_comp[i] ||
> + !comp_matches[i].funcs->stop)
> + continue;
> +
> + comp_matches[i].funcs->stop(ovl_adaptor-
> >ovl_adaptor_comp[i]);
> + }
> }
>
> int mtk_ovl_adaptor_clk_enable(struct device *dev)
Powered by blists - more mailing lists