From: Neil Armstrong <neil.armstrong@linaro.org>
To: Qianhui Xu <xiaqinghuan@mail.ustc.edu.cn>,
Jessica Zhang <jesszhan0024@gmail.com>,
dri-devel@lists.freedesktop.org
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
Maxime Ripard <mripard@kernel.org>,
Thomas Zimmermann <tzimmermann@suse.de>,
David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH v3 2/4] drm/panel: novatek-nt36536: finish setup before attaching DSI devices
Date: Thu, 3 Dec 2026 11:18:48 +0100 [thread overview]
Message-ID: <f3aebc5a-9834-4097-b87e-dc7cd16b0321@linaro.org> (raw)
In-Reply-To: <20261202090911.3987891-3-xiaqinghuan@mail.ustc.edu.cn>
On 12/2/26 10:09, Qianhui Xu wrote:
> Attaching a DSI device can bind the DRM bridge and immediately prepare
> the panel. Two things must be ready by then: the backlight device, which
> prepare() enables, and the MIPI DSI format/mode flags of every DSI
> device of a dual-DSI panel. Resolve the backlight before
> drm_panel_add()/attach, and configure all DSI devices in a separate loop
> before attaching any of them.
>
> Fixes: 75a5dbd1f4f7 ("drm/panel: Add Novatek NT36536 panel driver")
> Cc: <stable@vger.kernel.org>
> Signed-off-by: Qianhui Xu <xiaqinghuan@mail.ustc.edu.cn>
> ---
> drivers/gpu/drm/panel/panel-novatek-nt36536.c | 26 +++++++++++--------
> 1 file changed, 15 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/gpu/drm/panel/panel-novatek-nt36536.c b/drivers/gpu/drm/panel/panel-novatek-nt36536.c
> index 003e8561dc45b..7aa26796e2a90 100644
> --- a/drivers/gpu/drm/panel/panel-novatek-nt36536.c
> +++ b/drivers/gpu/drm/panel/panel-novatek-nt36536.c
> @@ -439,6 +439,18 @@ static int novatek_probe(struct mipi_dsi_device *dsi)
> ctx->dsi[0] = dsi;
> mipi_dsi_set_drvdata(dsi, ctx);
>
> + /* Resolve suppliers before attachment can bind DRM and prepare the panel. */
> + if (desc->has_dcs_backlight) {
> + ctx->backlight = novatek_create_backlight(ctx);
> + if (IS_ERR(ctx->backlight))
> + return dev_err_probe(dev, PTR_ERR(ctx->backlight),
> + "Failed to create backlight\n");
> + } else {
> + ret = drm_panel_of_backlight(&ctx->panel);
> + if (ret)
> + return dev_err_probe(dev, ret, "Failed to get backlight\n");
> + }
> +
> ctx->panel.prepare_prev_first = true;
>
> ret = devm_drm_panel_add(dev, &ctx->panel);
> @@ -450,23 +462,15 @@ static int novatek_probe(struct mipi_dsi_device *dsi)
> ctx->dsi[i]->format = desc->format;
> ctx->dsi[i]->mode_flags = desc->mode_flags;
> ctx->dsi[i]->dsc = &ctx->dsc;
> + }
> +
> + for (i = 0; i < num_dsi; i++) {
> ret = devm_mipi_dsi_attach(dev, ctx->dsi[i]);
> if (ret < 0)
> return dev_err_probe(dev, ret,
> "Failed to attach to DSI host\n");
> }
>
> - if (desc->has_dcs_backlight) {
> - ctx->backlight = novatek_create_backlight(ctx);
> - if (IS_ERR(ctx->backlight))
> - return dev_err_probe(dev, PTR_ERR(ctx->backlight),
> - "Failed to create backlight\n");
> - } else {
> - ret = drm_panel_of_backlight(&ctx->panel);
> - if (ret)
> - return dev_err_probe(dev, ret, "Failed to get backlight\n");
> - }
> -
> return 0;
> }
>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Thanks,
Neil
next prev parent reply other threads:[~2026-12-03 10:18 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-02 9:09 [PATCH v3 0/4] drm/panel: novatek-nt36536: add 40/24 Hz modes, fix lifecycle Qianhui Xu
2026-12-02 9:09 ` [PATCH v3 1/4] drm/panel: novatek-nt36536: add 40Hz and 24Hz modes for CSOT PP8807HB1-1 Qianhui Xu
2026-12-02 9:09 ` [PATCH v3 2/4] drm/panel: novatek-nt36536: finish setup before attaching DSI devices Qianhui Xu
2026-12-03 10:18 ` Neil Armstrong [this message]
2026-12-02 9:09 ` [PATCH v3 3/4] drm/panel: novatek-nt36536: power off on any prepare failure Qianhui Xu
2026-12-03 10:19 ` Neil Armstrong
2026-12-02 9:09 ` [PATCH v3 4/4] drm/panel: novatek-nt36536: reject enable when prepare failed Qianhui Xu
2026-12-03 10:20 ` Neil Armstrong
2026-12-03 14:37 ` Qianhui Xu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=f3aebc5a-9834-4097-b87e-dc7cd16b0321@linaro.org \
--to=neil.armstrong@linaro.org \
--cc=airlied@gmail.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=jesszhan0024@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=simona@ffwll.ch \
--cc=stable@vger.kernel.org \
--cc=tzimmermann@suse.de \
--cc=xiaqinghuan@mail.ustc.edu.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®