[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <16537c3f-824a-4268-a51e-5efc88a671bf@linaro.org>
Date: Mon, 4 Aug 2025 17:15:41 +0200
From: neil.armstrong@...aro.org
To: Heiko Stuebner <heiko@...ech.de>
Cc: quic_jesszhan@...cinc.com, maarten.lankhorst@...ux.intel.com,
mripard@...nel.org, tzimmermann@...e.de, robh@...nel.org,
krzk+dt@...nel.org, conor+dt@...nel.org, hjc@...k-chips.com,
andy.yan@...k-chips.com, andyshrk@....com, nicolas.frattaroli@...labora.com,
dri-devel@...ts.freedesktop.org, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linux-rockchip@...ts.infradead.org
Subject: Re: [PATCH 02/13] drm/panel: ilitek-ili9881c: move display_on/_off
dcs calls to (un-)prepare
On 07/07/2025 18:48, Heiko Stuebner wrote:
> At least for panel-bridges, the atomic_enable call is defined as being
> called right after the preceding element in the display pipe is enabled.
>
> It is also stated that "The bridge can assume that the display pipe (i.e.
> clocks and timing signals) feeding it is running when this callback is
> called"
>
> This means the DSI controller driving this display would have already
> switched over to video-mode from command mode and thus dcs functions
> should not be called anymore at this point.
>
> This caused a non-working display for me, when trying to enable
> the rk3576 dsi controller using a display using this controller.
>
> Therefore move the display_on/off calls the more appropriate
> prepare/unprepare callbacks.
>
> Signed-off-by: Heiko Stuebner <heiko@...ech.de>
> ---
> drivers/gpu/drm/panel/panel-ilitek-ili9881c.c | 27 +++++--------------
> 1 file changed, 7 insertions(+), 20 deletions(-)
>
> diff --git a/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c b/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c
> index d7a17dca2a9c..a20b52181ea0 100644
> --- a/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c
> +++ b/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c
> @@ -1315,35 +1315,24 @@ static int ili9881c_prepare(struct drm_panel *panel)
> if (ret)
> goto disable_power;
>
> - return 0;
> -
> -disable_power:
> - regulator_disable(ctx->power);
> - return ret;
> -}
> -
> -static int ili9881c_enable(struct drm_panel *panel)
> -{
> - struct ili9881c *ctx = panel_to_ili9881c(panel);
> -
> msleep(120);
>
> - mipi_dsi_dcs_set_display_on(ctx->dsi);
> + ret = mipi_dsi_dcs_set_display_on(ctx->dsi);
> + if (ret)
> + goto disable_power;
>
> return 0;
> -}
>
> -static int ili9881c_disable(struct drm_panel *panel)
> -{
> - struct ili9881c *ctx = panel_to_ili9881c(panel);
> -
> - return mipi_dsi_dcs_set_display_off(ctx->dsi);
> +disable_power:
> + regulator_disable(ctx->power);
> + return ret;
> }
>
> static int ili9881c_unprepare(struct drm_panel *panel)
> {
> struct ili9881c *ctx = panel_to_ili9881c(panel);
>
> + mipi_dsi_dcs_set_display_off(ctx->dsi);
> mipi_dsi_dcs_enter_sleep_mode(ctx->dsi);
> regulator_disable(ctx->power);
> gpiod_set_value_cansleep(ctx->reset, 1);
> @@ -1499,8 +1488,6 @@ static enum drm_panel_orientation ili9881c_get_orientation(struct drm_panel *pan
> static const struct drm_panel_funcs ili9881c_funcs = {
> .prepare = ili9881c_prepare,
> .unprepare = ili9881c_unprepare,
> - .enable = ili9881c_enable,
> - .disable = ili9881c_disable,
> .get_modes = ili9881c_get_modes,
> .get_orientation = ili9881c_get_orientation,
> };
Reviewed-by: Neil Armstrong <neil.armstrong@...aro.org>
Powered by blists - more mailing lists