[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAAOTY_-SKcX+4U5hKOgRaip-vk+ofEWe_g4VNUxFjN7LCprq1w@mail.gmail.com>
Date: Sat, 24 Apr 2021 00:36:55 +0800
From: Chun-Kuang Hu <chunkuang.hu@...nel.org>
To: Jitao Shi <jitao.shi@...iatek.com>
Cc: Rob Herring <robh+dt@...nel.org>,
Mark Rutland <mark.rutland@....com>,
Matthias Brugger <matthias.bgg@...il.com>,
Daniel Vetter <daniel@...ll.ch>,
David Airlie <airlied@...ux.ie>,
DRI Development <dri-devel@...ts.freedesktop.org>,
linux-kernel <linux-kernel@...r.kernel.org>,
DTML <devicetree@...r.kernel.org>,
srv_heupstream <srv_heupstream@...iatek.com>,
huijuan.xie@...iatek.com, stonea168@....com,
Cawa Cheng <cawa.cheng@...iatek.com>,
Rex-BC Chen <rex-bc.chen@...iatek.com>,
"moderated list:ARM/Mediatek SoC support"
<linux-mediatek@...ts.infradead.org>, yingjoe.chen@...iatek.com,
eddie.huang@...iatek.com,
Linux ARM <linux-arm-kernel@...ts.infradead.org>
Subject: Re: [PATCH 3/4] drm/mediatek: fine tune the dsi panel's power sequence
Hi, Jitao:
Jitao Shi <jitao.shi@...iatek.com> 於 2021年4月20日 週二 下午9:26寫道:
>
> Add the drm_panel_prepare_power and drm_panel_unprepare_power control.
> Turn on panel power(drm_panel_prepare_power) and control before dsi
> enable. And then dsi enable, send dcs cmd in drm_panel_prepare, last
> turn on backlight.
Please describe WHY do you need this patch? Fix any bug?
>
> Signed-off-by: Jitao Shi <jitao.shi@...iatek.com>
> ---
> drivers/gpu/drm/mediatek/mtk_dsi.c | 12 ++++++++++--
> 1 file changed, 10 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/mediatek/mtk_dsi.c b/drivers/gpu/drm/mediatek/mtk_dsi.c
> index a1ff152ef468..455fe582c6b5 100644
> --- a/drivers/gpu/drm/mediatek/mtk_dsi.c
> +++ b/drivers/gpu/drm/mediatek/mtk_dsi.c
> @@ -615,10 +615,13 @@ static int mtk_dsi_poweron(struct mtk_dsi *dsi)
> dsi->data_rate = DIV_ROUND_UP_ULL(dsi->vm.pixelclock * bit_per_pixel,
> dsi->lanes);
>
> + if (panel_bridge_prepare_power(dsi->next_bridge))
ret = panel_bridge_prepare_power(dsi->next_bridge);
if (ret)
> + DRM_INFO("can't prepare power the panel\n");
I think you should goto err_refcount;
> +
> ret = clk_set_rate(dsi->hs_clk, dsi->data_rate);
> if (ret < 0) {
> dev_err(dev, "Failed to set data rate: %d\n", ret);
> - goto err_refcount;
> + goto err_prepare_power;
> }
>
> phy_power_on(dsi->phy);
> @@ -661,7 +664,9 @@ static int mtk_dsi_poweron(struct mtk_dsi *dsi)
> clk_disable_unprepare(dsi->engine_clk);
> err_phy_power_off:
> phy_power_off(dsi->phy);
> -err_refcount:
> +err_prepare_power:
> + if (panel_bridge_unprepare_power(dsi->next_bridge))
ret = panel_bridge_unprepare_power(dsi->next_bridge);
> + DRM_INFO("Can't unprepare power the panel\n");
> dsi->refcount--;
> return ret;
> }
> @@ -694,6 +699,9 @@ static void mtk_dsi_poweroff(struct mtk_dsi *dsi)
> clk_disable_unprepare(dsi->digital_clk);
>
> phy_power_off(dsi->phy);
> +
> + if (panel_bridge_unprepare_power(dsi->next_bridge))
ret = panel_bridge_unprepare_power(dsi->next_bridge);
> + DRM_INFO("Can't unprepare power the panel\n");
> }
>
> static void mtk_output_dsi_enable(struct mtk_dsi *dsi)
> --
> 2.25.1
> _______________________________________________
> dri-devel mailing list
> dri-devel@...ts.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
Powered by blists - more mailing lists