From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f47.google.com (mail-pj1-f47.google.com [209.85.216.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D609E12CD8B for ; Wed, 27 May 2026 04:17:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.47 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779855454; cv=none; b=dbYURQLFSGUBZ/jAiD08OwgO2/b0Vb/X7eaONdqO+de6lG9o8QdYIL1zrIF0Gf795UjjEhWKNwS/LllltoFFkR7ZvRONx8kKlRLEAbq+bd2I44gN5IdoheImqH2G2Mu2GqgDCxzsC/H7PwJ7sNm2TdkoYb1mM/Ib5zl6IubNqdA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779855454; c=relaxed/simple; bh=Jr2qAr9Z1yqtk2/zVqFKXz14uABkdxS7qQZ5nhzaJ6A=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=rl4aCzRdZzTfqQxVBuZPxCxGbuJNP6/6V14kqVE8az6XCjlvss51hG1PfEUyHr4zuleqhnlmHQvcv0bMfbYSVQ5LkpFT/D7ynW77kY91tnsXgivK4EpORL8OhhUghduGVftFzeaKNuAlzs+z0G+yodrkMCogZslKzhxhocLITzY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=WNG++7RH; arc=none smtp.client-ip=209.85.216.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="WNG++7RH" Received: by mail-pj1-f47.google.com with SMTP id 98e67ed59e1d1-367cbac9c37so6650713a91.2 for ; Tue, 26 May 2026 21:17:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1779855452; x=1780460252; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=rMrQsiO+F96iPcmJ1AhLPXwczUDQvqynkahxXerRItk=; b=WNG++7RHnMHX1NE3fJBG1w+cF8J/6SkS/yHgFqxi1yPVHXjSX6lO+i1pamgc/g3SNP ILHQBjkQmtSX51cb5lOVoq4lGRntjSXHTMj+U8FMODwLso2G+bMbLXVSd302BbiI4elF gmzCFUokxCqEUovcoARdOb/HXkDS+BSXC6ONW0oaRvYfU1xJOYb/zbP8/Zj5nYmbhMoU SgCEFLD8zl3zQkEIDaW01/z62cGMiipXgS9CwaTYMA1osJHTDfmP8gHjt1GMge5y4Fx+ FifybEVAWMLnYQL2n5kZfGm8bWH7LBdjiub27+6Q/c1ibHFPJuhPw6QhSjATj+7ZPrhY Fo3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779855452; x=1780460252; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=rMrQsiO+F96iPcmJ1AhLPXwczUDQvqynkahxXerRItk=; b=gMI8Cvo5dqqVGVKyrhXQL9oFA8aVrC3WkXr59NNdfUJ8oJwUlBpgopP382Ry/I3NC7 tjbq4RTzgTm1t8mnLr0taeCnbeXhBrcyv6t8blBhCFWMapHB/4C9L2stt2ogZimtwv9P Ov1zGjGTXsmBrDOvBx5WgfDmaLAid461Doids2e8wPBvtH2p95JE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d4c:b0:368:ed26:15b2 with SMTP id 98e67ed59e1d1-36a67461a35mr21338047a91.8.1779855452094; Tue, 26 May 2026 21:17:32 -0700 (PDT) Received: from ?IPV6:2601:1c0:5780:9200:8926:6fea:c968:ad19? ([2601:1c0:5780:9200:8926:6fea:c968:ad19]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-c85205855dasm12996099a12.31.2026.05.26.21.17.31 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 26 May 2026 21:17:31 -0700 (PDT) Message-ID: <24a8d461-7393-4a37-b23c-3cbf44060350@gmail.com> Date: Tue, 26 May 2026 21:17:30 -0700 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3] drm/panel: novatek-nt36672a: Inline panel init sequences To: Alexey Minnekhanov , sumit.semwal@linaro.org, neil.armstrong@linaro.org Cc: dianders@chromium.org, jesszhan0024@gmail.com, maarten.lankhorst@linux.intel.com, mripard@kernel.org, tzimmermann@suse.de, airlied@gmail.com, simona@ffwll.ch, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org References: <20260523035734.6602-1-chintanlike@gmail.com> Content-Language: en-US From: Chintan Patel In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit >> @@ -162,8 +141,8 @@ static int nt36672a_panel_prepare(struct drm_panel >> *panel) >>       dsi_ctx.accum_err = nt36672a_panel_power_on(pinfo); >>       /* send first part of init cmds */ >> -    nt36672a_send_cmds(&dsi_ctx, pinfo->desc->on_cmds_1, >> -               pinfo->desc->num_on_cmds_1); >> +    if (pinfo->desc->send_init_cmds_1) >> +        pinfo->desc->send_init_cmds_1(&dsi_ctx); >>       mipi_dsi_dcs_exit_sleep_mode_multi(&dsi_ctx); >> @@ -173,8 +152,8 @@ static int nt36672a_panel_prepare(struct drm_panel >> *panel) >>       mipi_dsi_dcs_set_display_on_multi(&dsi_ctx); >>       /* Send rest of the init cmds */ >> -    nt36672a_send_cmds(&dsi_ctx, pinfo->desc->on_cmds_2, >> -               pinfo->desc->num_on_cmds_2); >> +    if (pinfo->desc->send_init_cmds_2) >> +        pinfo->desc->send_init_cmds_2(&dsi_ctx); >>       mipi_dsi_msleep(&dsi_ctx, 120); > > Hi! > > Here, the split of panel init sequence into 2 separate functions _1 / _2 > is completely artificial and completely unnecessary. For some unknown > reason the initial version of driver had initialization procedure cut in > 2 parts on the boundary of exit_sleep_mode + set_display_on commands. > > I think the whole init sequence should be glued together into one big > send_init_cmds() callback and have all these calls: > >     mipi_dsi_dcs_exit_sleep_mode_multi(&dsi_ctx); >     /* 0x46 = 70 ms delay */ >     mipi_dsi_msleep(&dsi_ctx, 70); >     mipi_dsi_dcs_set_display_on_multi(&dsi_ctx); > > > included in the middle. This opens up a possibility for other panels > based on nt36672a to be supported in this driver, which don't have the > init sequence split this way. The location of exit_sleep_mode and > set_display_on commands there is different. And, importantly, the delay > is different too. > > I once did a very similar change to this driver [1] to add support for > more panels (ignore touchscreen changes there, look only at panel). > What is also important, that change was also tested on Xiaomi Poco F1 > (xiaomi-beryllium) phone, which is the main user of this panel. > Unfortunately I never got to send it, even though I wanted to.. > > What do you think? > > [1] https://gitlab.com/sdm845-mainline/linux/-/merge_requests/131 Hi Alexey, Thanks, that makes sense and I agree the fully panel-owned init sequence would likely be a cleaner abstraction long term, especially for supporting additional NT36672A panel variants with different sequencing requirements. For this patch, though, I was trying to keep the scope limited to the original refactor requested during earlier review: remove the command table abstraction, inline the command sequences, and preserve the existing init flow/behavior as closely as possible. Since moving exit_sleep_mode, delays, and set_display_on into the panel callback changes the sequencing model itself, I was thinking it may be better handled as a follow-up cleanup/refactor patch to avoid mixing behavioral restructuring into this series. If that sounds reasonable, I'd prefer to keep this patch focused and address the sequencing abstraction separately afterward. Regards, Chintan