From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 61E63C43461 for ; Wed, 2 Sep 2020 15:14:43 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D3EB820773 for ; Wed, 2 Sep 2020 15:14:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="FelJoaRL"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=cerno.tech header.i=@cerno.tech header.b="SrtOi2z2"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="N1VBIZ8P" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D3EB820773 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=cerno.tech Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Type:Cc: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: In-Reply-To:MIME-Version:References:Message-ID:Subject:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=ljNj3Weol8y5QpCwS6WtlCB/JHJ9orS4KpZaLxk41jg=; b=FelJoaRLuR8lavn2M3VF76Mhp R9dU6KztWFXh0j10jG4LoD8VG9Kc8PB1CaSfSu12XRDFNFdsHgsd0JV0B5vuzG449og2LUUgtzKpG Mht6C+da1IL41HBZov4P97099MLRsUtGtRIo+szJKSudYTh/HjCZOY5oqXvZjBXSUDwGf5QjCwQnk oswpqdEU2oyihrrOWC3iDED/1b0Tsg74pCjHxngH6EMhP0yAKK6CwhdYkYwoDks8OLOH4gPwD7sR4 4Rum9XoZJFI54hgVsTkopWBp4MN9n1LFqno6gtmYMBMACeRoMpQMqqa1Hti0qna3m5sBpWL6cJxAY R8NUxfecg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kDURJ-0008LJ-Ap; Wed, 02 Sep 2020 15:12:45 +0000 Received: from wnew2-smtp.messagingengine.com ([64.147.123.27]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kDUN4-00064e-5t; Wed, 02 Sep 2020 15:08:27 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailnew.west.internal (Postfix) with ESMTP id 7C661D60; Wed, 2 Sep 2020 11:08:18 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Wed, 02 Sep 2020 11:08:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cerno.tech; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm3; bh=4N199FQkobK337JX6NaJjdNJ1Tw KdtxIk6GC3btyUAo=; b=SrtOi2z2ChvWDa5tfPeHqVKrp4mbVQpRikdJdgBfpOz o0YaLxKUyDs1BIzNFBguzce7mRb94WVHA1yC/MZ3LsaxstPiOr89MogRkE/s3DOs vkTSgdxq/RrP/2H3N4EEGFl4SqAG6PxC7oHkdepfrl8rEkS6Y4cGZfBotCPIwFzM EHGILdmS5wl7H/a75BVLRLUuEqRMdL9+iCltpqDdqVuxkJalXizEsX18siL4aoxk o5xXZkSLPBpoHZ3M8u9gGhRPRhUeeg2bfehXJE6ay6r0sZJcEbS8WeFyTVkNhkEO hO9QsnheUtvinvBx1w1FN77YreldZTmsJ2ek0QF05Nw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=4N199F QkobK337JX6NaJjdNJ1TwKdtxIk6GC3btyUAo=; b=N1VBIZ8P6SLnobJU5o2z+L /gBzJFAGdFyxD8WbjLE47L5YubPdoEGOMccvcUDsCEqb/6sZOdhrOqbdbdE8lEIk gvNPqygOfMGKrIXSoDC1dCvcjj9Gc4/jAGbeyYwjDrJ5D0tLfEbdkJE3UzbYz4vE ODCiOUPgFied2mUnwMpa8sRhf6jg9zgq47CUw5S2Om7F6Ftqe98spSNwnOzuld6f Ebrzo+QMFGYzHeTeNH3vCXZSVlmF7FHtoMJxnFxiXd36EQqKLi8mqC83bksMSlWc 7RlJhw168GIEQNtavO/sN5rFX/68GpCylawSRY2e+hmZi1PqUELicQKDsgooU54Q == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduiedrudefledgkeehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfhfgggtuggjsehgtderredttddvnecuhfhrohhmpeforgigihhm vgcutfhiphgrrhguuceomhgrgihimhgvsegtvghrnhhordhtvggthheqnecuggftrfgrth htvghrnhepleekgeehhfdutdeljefgleejffehfffgieejhffgueefhfdtveetgeehieeh gedunecukfhppeeltddrkeelrdeikedrjeeinecuvehluhhsthgvrhfuihiivgeptdenuc frrghrrghmpehmrghilhhfrhhomhepmhgrgihimhgvsegtvghrnhhordhtvggthh X-ME-Proxy: Received: from localhost (lfbn-tou-1-1502-76.w90-89.abo.wanadoo.fr [90.89.68.76]) by mail.messagingengine.com (Postfix) with ESMTPA id DC828328005E; Wed, 2 Sep 2020 11:08:16 -0400 (EDT) Date: Wed, 2 Sep 2020 17:08:15 +0200 From: Maxime Ripard To: Stefan Wahren Subject: Re: [PATCH v4 29/78] drm/vc4: crtc: Add a delay after disabling the PixelValve output Message-ID: <20200902150815.kw3nynnlvgrrcygc@gilmour.lan> References: <20200729144251.us6a2pgkjjmm53ov@gilmour.lan> <20200825150606.utlynhzo664bwksy@gilmour.lan> <20200901095829.64a5hjghf3mlsyvo@gilmour.lan> <27a549fe-e38d-f9a2-2677-ae5b5dc1aa45@i2se.com> MIME-Version: 1.0 In-Reply-To: <27a549fe-e38d-f9a2-2677-ae5b5dc1aa45@i2se.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200902_110822_390846_B76FDF39 X-CRM114-Status: GOOD ( 32.38 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Tim Gover , Dave Stevenson , LKML , DRI Development , Eric Anholt , bcm-kernel-feedback-list@broadcom.com, Nicolas Saenz Julienne , Phil Elwell , linux-arm-kernel@lists.infradead.org, linux-rpi-kernel@lists.infradead.org Content-Type: multipart/mixed; boundary="===============7416515761036678721==" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org --===============7416515761036678721== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="cdchspgt6i3o3s2q" Content-Disposition: inline --cdchspgt6i3o3s2q Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Sep 01, 2020 at 06:31:07PM +0200, Stefan Wahren wrote: > Hi Maxime, >=20 > Am 01.09.20 um 11:58 schrieb Maxime Ripard: > > Hi Stefan > > > > On Tue, Aug 25, 2020 at 11:30:58PM +0200, Stefan Wahren wrote: > >> Am 25.08.20 um 17:06 schrieb Maxime Ripard: > >>> Hi Stefan, > >>> > >>> On Wed, Jul 29, 2020 at 05:50:31PM +0200, Stefan Wahren wrote: > >>>> Am 29.07.20 um 16:42 schrieb Maxime Ripard: > >>>>> Hi, > >>>>> > >>>>> On Wed, Jul 29, 2020 at 03:09:21PM +0100, Dave Stevenson wrote: > >>>>>> On Wed, 8 Jul 2020 at 18:43, Maxime Ripard wro= te: > >>>>>>> In order to avoid pixels getting stuck in the (unflushable) FIFO = between > >>>>>>> the HVS and the PV, we need to add some delay after disabling the= PV output > >>>>>>> and before disabling the HDMI controller. 20ms seems to be good e= nough so > >>>>>>> let's use that. > >>>>>>> > >>>>>>> Signed-off-by: Maxime Ripard > >>>>>>> --- > >>>>>>> drivers/gpu/drm/vc4/vc4_crtc.c | 2 ++ > >>>>>>> 1 file changed, 2 insertions(+) > >>>>>>> > >>>>>>> diff --git a/drivers/gpu/drm/vc4/vc4_crtc.c b/drivers/gpu/drm/vc4= /vc4_crtc.c > >>>>>>> index d0b326e1df0a..7b178d67187f 100644 > >>>>>>> --- a/drivers/gpu/drm/vc4/vc4_crtc.c > >>>>>>> +++ b/drivers/gpu/drm/vc4/vc4_crtc.c > >>>>>>> @@ -403,6 +403,8 @@ static void vc4_crtc_atomic_disable(struct dr= m_crtc *crtc, > >>>>>>> ret =3D wait_for(!(CRTC_READ(PV_V_CONTROL) & PV_VCONTROL_= VIDEN), 1); > >>>>>>> WARN_ONCE(ret, "Timeout waiting for !PV_VCONTROL_VIDEN\n"= ); > >>>>>>> > >>>>>>> + mdelay(20); > >>>>>> mdelay for 20ms seems a touch unfriendly as it's a busy wait. Can = we > >>>>>> not msleep instead? > >>>>> Since the timing was fairly critical, sleeping didn't seem like a g= ood > >>>>> solution since there's definitely some chance you overshoot and end= up > >>>>> with a higher time than the one you targeted. > >>>> usleep_range(min, max) isn't a solution? > >>> My understanding of usleep_range was that you can still overshoot, ev= en > >>> though it's backed by an HR timer so the resolution is not a jiffy. A= re > >>> we certain that we're going to be in that range? > >> you are right there is no guarantee about the upper wake up time. > >> > >> And it's not worth the effort to poll the FIFO state until its empty > >> (using 20 ms as timeout)? > > I know this isn't really a great argument there, but getting this to > > work has been quite painful, and the timing is very sensitive. If we > > fail to wait for enough time, there's going to be a pixel shift that we > > can't get rid of unless we reboot, which is pretty bad (and would fail > > any CI test that checks for the output integrity). > > > > I know busy-looping for 20ms isn't ideal, but it's not really in a > > hot-path (it's only done when changing a mode), with the sync time of > > the display likely to be much more than that, and if it can avoid having > > to look into it ever again or avoid random failures, I'd say it's worth > > it. >=20 > i don't want to delay this series. >=20 > Could you please add a small comment to the delay to clarify the timing > is very sensitive? I will, thanks! Maxime --cdchspgt6i3o3s2q Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCX0+1XwAKCRDj7w1vZxhR xTExAQDs1BYdGeS/lvk546x1sgn6AifEwOlrVxDSeMO/QWhu3wD/RfIhHhh1s1j1 DfqNBjaatkPCQAZkursDakHjOFFOYQI= =bDzq -----END PGP SIGNATURE----- --cdchspgt6i3o3s2q-- --===============7416515761036678721== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel --===============7416515761036678721==--