Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp381394rdg; Thu, 12 Oct 2023 08:16:23 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHp2b3cf4aGyL6pXpkhHP31BYCrd1eGpFneJIxAZAV4rKPe798xEUx6Jy6Sj/mlYWaUoX7C X-Received: by 2002:a05:6358:279c:b0:147:9b6d:f7f6 with SMTP id l28-20020a056358279c00b001479b6df7f6mr19537323rwb.27.1697123782631; Thu, 12 Oct 2023 08:16:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697123782; cv=none; d=google.com; s=arc-20160816; b=NICIfks89FrMPRS1wW8x9D5iQ+f9BGTvmwhTlQJkmOmCeWCEYGhpiOJNDNz6vrtdBV 1ofN/h3Wie1x4rnuRI9btimGsVleCQqF2LgHRVqvOYBN0BnV2FMrYCTyqQRf80fZ6J7/ tOAIW3LjgRf3LrfOocx7NMfzzb33cajWkWTIv+ZSTeNRGM9BpPVstSYx9PNcKNqnO1ZZ wQYqkKynryu5rmuv1j5R78weYQv4iKYyRDFicM+cmmmUOdQ6J/4ojUMmwimKJR15J1GX nBiYXbuJFlb0tFlceZ4yxrbOeC1eQmgf6YH8kIIXLzvkehsr6ECxcXqIYByVYmv/dqxs QxRg== 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=WDm03tbPxIT0QGcdFVM1esLuIKdKzQrObVrEEj/6HeY=; fh=dr62qdri0naaBXN8udU8DAXTqV165m3QhYlhprE7QnU=; b=DI3yvj5Wc54OUeAMH/1NAbPWG62iBMSrqJZ6BOT6YrARuchZzZ2YbmHtujRotLzVHf C/dwX+wHszDgRR/DQGx4ZzjF2OUwuHpg4DFXaA1en6oNpkmNSUrt70sf2F0YgKJHtMqR cWXdOUPw2fB9rhujToQQibCc7L9b4nGx1WyncXneBUTYd8ewoRec5i12Nwb12ffCtNWs VzAhIhqdgllR7PNuYmvODbsCGv00UU5wkzTWc+eTDdvMVEv2iiJnUSQaEtVmb34WjGjn pNFspcGfOY+GLC0JbhfYJzALzTZbeQ1wji+iGXJmwdGz0QLgX6HnuyYlolnKKKdAGEal CBVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=wCsYpb+1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 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 morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id i22-20020a056a00225600b0068fcccf5c79si191816pfu.220.2023.10.12.08.16.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Oct 2023 08:16:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=wCsYpb+1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 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 morse.vger.email (Postfix) with ESMTP id 5E0AF8068E18; Thu, 12 Oct 2023 08:16:16 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378304AbjJLPP5 (ORCPT + 99 others); Thu, 12 Oct 2023 11:15:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42448 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347298AbjJLPPv (ORCPT ); Thu, 12 Oct 2023 11:15:51 -0400 Received: from mail-lf1-x12c.google.com (mail-lf1-x12c.google.com [IPv6:2a00:1450:4864:20::12c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6EA94C0 for ; Thu, 12 Oct 2023 08:15:49 -0700 (PDT) Received: by mail-lf1-x12c.google.com with SMTP id 2adb3069b0e04-5032a508e74so4010e87.1 for ; Thu, 12 Oct 2023 08:15:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1697123747; x=1697728547; 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=WDm03tbPxIT0QGcdFVM1esLuIKdKzQrObVrEEj/6HeY=; b=wCsYpb+1WEEWnbhfMzlQL2Da5bi8igAJYbzwI9nzHI5gFerlw2B7obhmraZlCv5H4K uutAUOIxLuURMmje2p1xKla8bzcrkeZZpXqqy35tmCkjAbj5aT2+IepoBgIUuEFfu5O/ 7eLvWGeXbT21T0YXDZabKv4d3dl+u0tTS742n0Avkrtzo+QwXlnnw6GRFa3R2favlkvm EXmOOmLKMtMGsMILSCWL3VWIoHPHKRoBsW3ZT9WTqIupFMGCjF131h0jgE/UnFJYeb2m f+EXLrvOS8ANkDAEvfGFH/t5lUAzMcNSQz/ekHmRBn0jG/cpUoK3zgnv4sTjh1a6gtei mKLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697123747; x=1697728547; 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=WDm03tbPxIT0QGcdFVM1esLuIKdKzQrObVrEEj/6HeY=; b=u5TVMsrg7mq+29f7Z2neYBE4yAl7BeDnVLhnx+9x+ChcAbskzLKEyGgd+x1Afb2iCn 6aHi3HIr5WI/86bIJCx9Ni4yD5gsjyyqi+Q0vEXTScuqD//loGSsHqscEG8MZ/cGcp0b 5HltCx8ZefAaRkjjBDvUDoz1WYr7eFRMM9K1+WRXV2EYXYXO9MOSxLPglAPcrhXYO/1t 2vEGYerpfEGELvuUuM/fhYXoxyexnSAQAsbSfKVZjd1mumF73XXoyQg00YWn8UYdeSgM Fg6kAtYlTmimoe36o9+YwPHTIWDtIjgg8ToNgHl2BdvaQ8fB9k7Bld6VFGvqrn0QB9ZD r1wg== X-Gm-Message-State: AOJu0YxAW2NM8ms8d2zBMchobAKhmDYXJlFUjlsOZg8ZP1oW1KYIm0Ui xKkq274motGHbQQ6PU6fsaO9kk7OEjQJQB0NeTnXaw== X-Received: by 2002:a19:ad41:0:b0:501:ba53:a4f7 with SMTP id s1-20020a19ad41000000b00501ba53a4f7mr199955lfd.0.1697123747342; Thu, 12 Oct 2023 08:15:47 -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: <20231012121004.2127918-3-yangcong5@huaqin.corp-partner.google.com> From: Doug Anderson Date: Thu, 12 Oct 2023 08:15:32 -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 morse.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 (morse.vger.email [0.0.0.0]); Thu, 12 Oct 2023 08:16:16 -0700 (PDT) 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 meet > 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. > 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_Power_S= equence > > 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 *il= i) > 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(page); > + > + 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", r= et); > + 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 ili9882t= *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 *panel) > 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).