Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp689310rdg; Thu, 12 Oct 2023 19:28:48 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE/T/1Zmzxz0LDWO+GWHxQjhvbTmPc/mrG15F+MdztqYvIQbjTLAHTbAziISrwK8ixAc1Ur X-Received: by 2002:a05:6871:8a4:b0:1e9:8885:b534 with SMTP id r36-20020a05687108a400b001e98885b534mr8951522oaq.9.1697164128520; Thu, 12 Oct 2023 19:28:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697164128; cv=none; d=google.com; s=arc-20160816; b=azWBRQAfAQkpKIEMTtMNP25CdERiavB3vimmqr01ST2MvKUHC0ELC26DK0ND+yF0M7 p1ueQuOOS7taEGOcjeug2F0JvXLMhWp8QNSKukZCDZ/h+a3FDXjCvwfcn5DBCBVnU489 fzl334ULSYTSXOv8FMAbqrmTnKXVjmr2P3NjViu0/DqLIWQmV6GwSUFkX3pQWFzG1bW8 lgLpbjyHyYd8n9p0cAFtGmrqY6EUg3ygXKwrJYqXFAbhzW6iQuEb1HebiFHKG08T8pkI l7hfsCZRa7SYWDmGEc1fDfxvipDXso2gcLrsGLMa71m3VpYzQjLSuvQ3ZnKpgxTlAbFr Cx1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=R9/YuC6y9eUihKpZ8jmF6NlsO7n14+K0koQ+noy1ggQ=; fh=bucnOIHy5R3/oZYY8vF8nPKqtE078mYHunOPmWRubTY=; b=yxQIEJjRqBCNz/maUjmNeMk3FrLx2Yn/3WJmB6FHb3rm1IVCqCVVxLtx2X9KxBIFvX 6EmU4CPNuRPt0PfaJ5eB1+6FpS2eBAjRvQeWliF1ZjhBQQD+Wa9X370qPI23XbiRrrOy 0HdyWp9I211Ql+O6kJMLgj0MSxv8glWglm4iS6Y14iZ6r/fSX7CHMeIsc5+g0xZ5UrNs x/HzHb/EkoEzHINxw2yT/VAOIHYmn/wHYaf2BjyBvGsF27pWFbiXJRCxZiILna4Gr4zL rLVBANOgwSWztj7wENrVr2Aw/T8/CaeFbeZFRiVsuzk3Pj+t9ULUr68weyApWYLnybID Eseg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=OmWoC3nd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id p9-20020a63fe09000000b00565eedb1cf8si3519245pgh.825.2023.10.12.19.28.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Oct 2023 19:28:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=OmWoC3nd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id BE61F802CD14; Thu, 12 Oct 2023 19:28:45 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229519AbjJMC2b (ORCPT + 99 others); Thu, 12 Oct 2023 22:28:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47842 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229461AbjJMC2a (ORCPT ); Thu, 12 Oct 2023 22:28:30 -0400 Received: from mail-wm1-x333.google.com (mail-wm1-x333.google.com [IPv6:2a00:1450:4864:20::333]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E501FB7 for ; Thu, 12 Oct 2023 19:28:28 -0700 (PDT) Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-405459d9a96so39715e9.0 for ; Thu, 12 Oct 2023 19:28:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1697164107; x=1697768907; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=R9/YuC6y9eUihKpZ8jmF6NlsO7n14+K0koQ+noy1ggQ=; b=OmWoC3nd59yaNI16Fbi2/oU1YekFIfue7+44AXYOFFyYyQIQJAKgmDAP/CcYnpixXu nIIRlrh59ifFabgPugRGFzKAVLEVZg6MVez/4U4AB+1Bw3qUBeVqdUeLK0rnjud1B7rs 4Z5EGXReX7CGbEa8dNfxTUy18ypEwuWixrMujAIZzoKM/t6zAEPgIe52yWLqaCZaHFgR Dwc3VhtdIH7vptrxSWvmlzXPkpI9KNk5CH4DnHuTVOlRSWX3cVzbj+kLrOxYsNHxHD7M Afj8YEOVRFEx/DWp4ExFO/6wumotSu6+7eiB38TLll2+i+iwhH6NmL/vbKjeBAgqXEjY VxrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697164107; x=1697768907; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=R9/YuC6y9eUihKpZ8jmF6NlsO7n14+K0koQ+noy1ggQ=; b=knLXT37wnbadqfow6xu9LKXKC5cXY+ff8LTDJJCXkWY2CcZVgmH+wkqZUuZliZU3w4 INVRhgVGtkh4lFEUe8Ki17yAkS29F1/e2lyNlS3q7ngRzywmdTxg6DzjrX1YWrBJq6UT C6bz94hffUQ2c5EP4Ufk3YEnUhnpfG9GkGwk5AaDa5f0nqmbw/veRlo+9WxIJKZUxZrM 1KSqT4C68M2CsvFHf4fjolmZAGRQeL1OUxZkc6B3mxceHYX08XqTfLQjNE5Q1C2Lg8AT BmXFreop619xsdEEiua9tvNSDTjIYBaqP/ZLjLE6g9LDhrrUOMJIlLP0JKkjywdKOWOC AMUw== X-Gm-Message-State: AOJu0Ywbkh84dWYTts3wFmB70HScwN7GUhRmTHVmjw271Le/I+iAkaCy O5+oxJV3z85wPQhJX8BuYXeUuVen8XME+x81OzZd6A== X-Received: by 2002:a05:600c:2102:b0:405:38d1:e146 with SMTP id u2-20020a05600c210200b0040538d1e146mr63274wml.4.1697164107120; Thu, 12 Oct 2023 19:28:27 -0700 (PDT) MIME-Version: 1.0 References: <20231012121004.2127918-1-yangcong5@huaqin.corp-partner.google.com> <20231012121004.2127918-3-yangcong5@huaqin.corp-partner.google.com> In-Reply-To: From: Doug Anderson Date: Thu, 12 Oct 2023 19:28:11 -0700 Message-ID: Subject: Re: [v3 2/3] drm/panel: ili9882t: Avoid blurred screen from fast sleep To: cong yang Cc: sam@ravnborg.org, neil.armstrong@linaro.org, daniel@ffwll.ch, hsinyi@google.com, linus.walleij@linaro.org, swboyd@chromium.org, airlied@gmail.com, catalin.marinas@arm.com, will@kernel.org, dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-8.4 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Thu, 12 Oct 2023 19:28:45 -0700 (PDT) Hi, On Thu, Oct 12, 2023 at 6:12=E2=80=AFPM cong yang wrote: > > Hi, > > On Thu, Oct 12, 2023 at 11:15=E2=80=AFPM Doug Anderson wrote: > > > > Hi, > > > > On Thu, Oct 12, 2023 at 5:10=E2=80=AFAM Cong Yang > > wrote: > > > > > > At present, we have found that there may be a problem of blurred > > > screen during fast sleep/resume. The direct cause of the blurred > > > screen is that the IC does not receive 0x28/0x10. Because of the > > > particularity of the IC, before the panel enters sleep hid must > > > stop scanning, as i2c_hid_core_suspend before ili9882t_disable. > > > If move the ili9882t_enter_sleep_mode function to ili9882t_unprepare, > > > touch reset will pull low before panel entersleep, which does not mee= t > > > the timing requirements.. > > > > The above makes me believe that the reset GPIO should be moved out of > > the input driver and into the panel driver. I could just imagine that > > the kernel might have some reason it wants to suspend the i2c hid > > device. If that causes the panel to suddenly start failing then that > > would be bad... I think we should fix this. > > Thanks, I will confirm with ilitek in further analysis and use "move > the ili9882t_enter_sleep_mode > function to ili9882t_unprepare". Is the test failure really because > the touch reset timing > does not match? There is also a separate reset GPIO on the panel. > Shouldn't touch reset not > affect the panel? > > If we find a better solution I will continue upstream,=E3=80=82 So is it > possible to apply this plan now? I wouldn't be too upset at applying the current code as long as you're going to continue to investigate. We can always continue to iterate on it and having something working reasonably well is better than nothing at all. However, I probably would wait at least 1 week before applying any patch from you just simply out of courtesy to give others on the mailing list time to express their comments. ...presumably we could get to the bottom of the problem in that 1 week time anyway... I'm not trying to be an obstinate pain here--I'm merely trying to make sure that whatever we land will continue to work across kernel uprevs, even if driver probe order / timing changes in the kernel. If the panel is really so tied to the touchscreen device's reset GPIO timing then it worries me. What happens, for instance, if you disable the touchscreen CONFIG in the kernel? Does the panel still work, or is that extra reset GPIO totally critical to the functioning of the panel. If it's totally critical then it probably makes sense to move to the panel driver given that the touchscreen is a panel follower anyway... > > > So in order to solve this problem, the IC > > > can handle it through the exception mechanism when it cannot receive > > > 0x28/0x10 command. Handling exceptions requires a reset 50ms delay. > > > Refer to vendor detailed analysis [1]. > > > > > > Ilitek vendor also suggested switching the page before entering sleep= to > > > avoid panel IC not receiving 0x28/0x10 command. > > > > > > Note: 0x28 is display off, 0x10 is sleep in. > > > > > > [1]: https://github.com/ILITEK-LoganLin/Document/tree/main/ILITEK_Pow= er_Sequence > > > > > > Signed-off-by: Cong Yang > > > --- > > > drivers/gpu/drm/panel/panel-ilitek-ili9882t.c | 22 +++++++++++++++++= +- > > > 1 file changed, 21 insertions(+), 1 deletion(-) > > > > > > diff --git a/drivers/gpu/drm/panel/panel-ilitek-ili9882t.c b/drivers/= gpu/drm/panel/panel-ilitek-ili9882t.c > > > index 93a40c2f1483..54ff1efb94aa 100644 > > > --- a/drivers/gpu/drm/panel/panel-ilitek-ili9882t.c > > > +++ b/drivers/gpu/drm/panel/panel-ilitek-ili9882t.c > > > @@ -463,6 +463,24 @@ static int ili9882t_init_dcs_cmd(struct ili9882t= *ili) > > > return 0; > > > } > > > > > > +static int ili9882t_switch_page(struct mipi_dsi_device *dsi, u8 page= ) > > > +{ > > > + int ret; > > > + const struct panel_init_cmd cmd =3D _INIT_SWITCH_PAGE_CMD(pag= e); > > > + > > > + ret =3D mipi_dsi_dcs_write(dsi, cmd.data[0], > > > + cmd.len <=3D 1 ? NULL : > > > + &cmd.data[1], > > > + cmd.len - 1); > > > + if (ret) { > > > + dev_err(&dsi->dev, > > > + "error switching panel controller page (%d)\n= ", ret); > > > + return ret; > > > + } > > > + > > > + return 0; > > > +} > > > + > > > static int ili9882t_enter_sleep_mode(struct ili9882t *ili) > > > { > > > struct mipi_dsi_device *dsi =3D ili->dsi; > > > @@ -484,8 +502,10 @@ static int ili9882t_enter_sleep_mode(struct ili9= 882t *ili) > > > static int ili9882t_disable(struct drm_panel *panel) > > > { > > > struct ili9882t *ili =3D to_ili9882t(panel); > > > + struct mipi_dsi_device *dsi =3D ili->dsi; > > > int ret; > > > > > > + ili9882t_switch_page(dsi, 0x00); > > > ret =3D ili9882t_enter_sleep_mode(ili); > > > if (ret < 0) { > > > dev_err(panel->dev, "failed to set panel off: %d\n", = ret); > > > @@ -546,7 +566,7 @@ static int ili9882t_prepare(struct drm_panel *pan= el) > > > gpiod_set_value(ili->enable_gpio, 1); > > > usleep_range(1000, 2000); > > > gpiod_set_value(ili->enable_gpio, 0); > > > - usleep_range(1000, 2000); > > > + usleep_range(50000, 51000); > > > > From my previous response, I think the above is better as msleep(50). > > Sorry. Will be corrected in V4. Thanks! It's not a huge deal, but it's nice to fix. -Doug