Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp353895rdg; Tue, 10 Oct 2023 12:11:47 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGIXwtoBP+3WAiLbRhPppdZslR/VQ0RmWDPyXTaxl5eRd8u5OL3veWhqwujpAbyTTagILul X-Received: by 2002:a05:6a20:158e:b0:16a:bcde:397d with SMTP id h14-20020a056a20158e00b0016abcde397dmr18457952pzj.22.1696965107286; Tue, 10 Oct 2023 12:11:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696965107; cv=none; d=google.com; s=arc-20160816; b=LNIWlpECfqqJ9pVfwu6K0dt0wYy0Eo+XwG46vPukhK46uO+pV93zeZggO8P7E93dX+ fAifWQcfImF3xhDrFTuTyC/Z1itOCZBpbhhFF9ogWYfaNqMNHHji6DfpZqpCfei2tt2X Ibo72Aip+tZMmMmKWh9dtuEoegxwmuwh+z5q04qnlSl6AdjX9DOTEF+UHBzPYSlR+193 IHaZThCJ2GxqJXuOs0WZdCN/fnRV5UgUwWw5keXdpwDTBgPbJB8HbqDpLqYm+UYXfRsw wBM+QBDg+UhLfD/NQomejKSyUcBDT7zg7Q1SRFEc5E8TDT+nJcBCh3rhhK8ZMV/BHe2g ZsaQ== 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=JZoGL2Uu638tVmdTCZX+Di3sr5kqYNA/LstDS+q6xb8=; fh=dr62qdri0naaBXN8udU8DAXTqV165m3QhYlhprE7QnU=; b=w/aWmihusNSsXcRwMdtutiKC1hsijwbrEwC9wf1DvgKU88myIPCJQpa9zTFzv7ch4b iWFNpcS4UBQBlPxDalzQoQ5PZvDNH9tj/1HoSNLmIETfIgELtRCjq2pyJz6ACChF5qcp Yl6zJzInYxb/EXGtCB080GGf/csaFLAb1vHK5UwNZPN/CfWwvQbcKjqePYYUoeaSnrEM 23SMND4Id6ek+rQwn+kdu004iYTb4N7n+kVuet3cWgWzYAKgMjOO/jFk523bI8PK2jjL AIVElD/oJUOcv7gFRBF/tpQwVrqhXnVp9WI2zQ7I0OtdXz2mtfH4V1exyPoWu/QCgh93 xsQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=KW5rV+7j; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 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 lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id cb7-20020a056a00430700b0068ff659af62si10136775pfb.106.2023.10.10.12.11.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Oct 2023 12:11:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=KW5rV+7j; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 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 lipwig.vger.email (Postfix) with ESMTP id CC95081BFA9F; Tue, 10 Oct 2023 12:11:43 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343741AbjJJTL3 (ORCPT + 99 others); Tue, 10 Oct 2023 15:11:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33858 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234222AbjJJTL0 (ORCPT ); Tue, 10 Oct 2023 15:11:26 -0400 Received: from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com [IPv6:2a00:1450:4864:20::32b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D2B5E94 for ; Tue, 10 Oct 2023 12:11:24 -0700 (PDT) Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-40662119cd0so14805e9.1 for ; Tue, 10 Oct 2023 12:11:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1696965083; x=1697569883; 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=JZoGL2Uu638tVmdTCZX+Di3sr5kqYNA/LstDS+q6xb8=; b=KW5rV+7jWOyFCYN/V1G5uggK6s8QTz6bxNAPcjJ5cH6tnZOW7DHW04BrrZyFsSevCb tOl5qvmF0jjnyE10H5HVSqPIS8AK2/Tto30UpvdGGdJLjZGJ38GnjiG3F5m600wBS1Xo XrbW5Cadq8n7LS0fZHbFsJC3v7ho0WZxRwTQXSkWVQS5M/eidk7UROb4aeqgAYpenQCl maAuBE3rPrADDbXjdWdTpBF2jAHD3NC8WQaTHq8kAI9lgxbCnkrOERo1hmRodw61v0Wa YV8aVCfn6YUtpm1b7DDfEHWWXj95KsiqRdNQiyQ+6XqXnD/8J7jlpCz80VyQqmj7J6M2 BzzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696965083; x=1697569883; 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=JZoGL2Uu638tVmdTCZX+Di3sr5kqYNA/LstDS+q6xb8=; b=A3HRTreLDJlfr/hv4SIXK7aKH6NtJ5ikgyr1isddbVWf3rCUZYaugbYWqoTLtRtkg8 wxGvaRQALq4MOjAfDW1QN2oPMfqp0UE+V9RBLbl/2QXVZbLJsEhXc9BO/OGy+VKolSMM mU1n7vZ5PTVAqhcT+44Jqw5Q0Rn9xXmzi0iw+0N+ycFB7M2Tg/fDqpEx1oumSdicj6Zr zh1tuVAqiVSJ3MgvOsAibqXDSJ+IO7j63NX7dPuNYl1UUfCLqJjGjEpNHBL6mJMCuFWJ gygvnquo8ljC+ICXdN4Ku6pJyzAmhgpT/p1bge5aXkovxSHoaoY4uNHPCtv2oyOTXV+S 6t3Q== X-Gm-Message-State: AOJu0YxSNVdLyNUb8js1gGD59+y0/ZSvOJ+Ph59y7JkR1tCCyVTXLl4z sTpJ/DMNv9VgS9pw2+UjdbzZ7nlJaTTAuW3N4RTYDw== X-Received: by 2002:a05:600c:4fc2:b0:406:5779:181d with SMTP id o2-20020a05600c4fc200b004065779181dmr25484wmq.2.1696965082564; Tue, 10 Oct 2023 12:11:22 -0700 (PDT) MIME-Version: 1.0 References: <20231010121402.3687948-1-yangcong5@huaqin.corp-partner.google.com> <20231010121402.3687948-3-yangcong5@huaqin.corp-partner.google.com> In-Reply-To: <20231010121402.3687948-3-yangcong5@huaqin.corp-partner.google.com> From: Doug Anderson Date: Tue, 10 Oct 2023 12:11:04 -0700 Message-ID: Subject: Re: [v2 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=-4.8 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS, USER_IN_DEF_DKIM_WL autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.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 (lipwig.vger.email [0.0.0.0]); Tue, 10 Oct 2023 12:11:43 -0700 (PDT) Hi, On Tue, Oct 10, 2023 at 5:14=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, i2c_hid_core_suspend before ili9882t_disable. > This doesn't look very spec-compliant. 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 very nitty, but can you make the "X" lowercase? ...so 0x28 not 0X28. > 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 e095ad91c4bc..20ae370ebe2f 100644 > --- a/drivers/gpu/drm/panel/panel-ilitek-ili9882t.c > +++ b/drivers/gpu/drm/panel/panel-ilitek-ili9882t.c > @@ -465,6 +465,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; > @@ -486,8 +504,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)= ; > @@ -548,7 +568,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(40000, 50000); In response to v1 you said that you actually needed 50 ms here. Oh, I guess that's also in the patch description. The above allows the kernel to delay 40 ms. We need to change it to something that will force the kernel to do 50 ms. That could be: "usleep_range(50000, 51000)", but actually when we're this order of magnitude it should be just "msleep(50)".