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 80AF1C433E2 for ; Tue, 1 Sep 2020 09:59:56 +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 43CB0206A5 for ; Tue, 1 Sep 2020 09:59:56 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="T/D+smwE"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=cerno.tech header.i=@cerno.tech header.b="dygodJFo"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="UB1kD/0u" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 43CB0206A5 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=FUXtY/QCdf4lbZztvsiBm7RwfAE/R0cipEfI2IFTCIc=; b=T/D+smwEvkwW1BZBB8WKU/wDy BVU69jk9SUXITF8sdn0xLQaYXjGSiONOB8jv2h0cWmdqux9NlqPgoqyrS7RmFfEv3LF7/yvpzH/rt Jy5nOGpUm7w5+ryi33ENmCwbiginv0pjbmSrvnbcx+nDlI9RjuE5+dleW5UZruPfZ1G2m+EAYzLBk LrNiikMGnm9ylVl5sDN5O55MIz4cM3p351BkVKOn4i9obxjJmjt6DlpdBlrXRVxzUGfRrW+QfMdz1 5/6+VGPn1eQXGE7juTx3tC2mtOjanyfpoSD0QrJeTvHKbzkqD5ywoX6bgQgdPeC2NDKYPNoVOdZZw S15NTX3Fw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kD33l-0002Em-5X; Tue, 01 Sep 2020 09:58:37 +0000 Received: from wnew3-smtp.messagingengine.com ([64.147.123.17]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kD33i-0002E0-Fi; Tue, 01 Sep 2020 09:58:35 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailnew.west.internal (Postfix) with ESMTP id E92ADEBD; Tue, 1 Sep 2020 05:58:31 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Tue, 01 Sep 2020 05:58:32 -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=+iAh4aljY3pCe+asolVpEIJfMGI jY9QIjsrE3sOKCtE=; b=dygodJFonFvm51AMycgBuf+IRqbIhNDlFi5LBR92pIB pVf+mHYo2ZKNjyYdDFll1x9jCyaT2pe3VsrUxuRqb1C8ETRGa0LNpehxt/dL/tu/ 4IPEq5iOi4mGDZ2rYLFQHI8FiZyiyhC5uaZmGflY2+qRvwdpezZuRQ9+hmqqYBkm 3/zwPrqgN7HW3RiEPOvo4RIIQIgahfVRFjbNNDj942dzXkagMAItjM/l3Ezq7Zh+ Vkke+1RzqaaaNh/yZP9fWlX+rE3aVAMgNA5oNTGnzPUxELfszvvpRLjHd1o5oH2u HeNirwY17E9e52j13hitbMAszN8Q9/nmwhcg4lUaGTA== 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=+iAh4a ljY3pCe+asolVpEIJfMGIjY9QIjsrE3sOKCtE=; b=UB1kD/0uql71evFTo8AJRF vouAnnP2gdCeXifw2lVkkHPiWXuOsn0QpWIn1LHe0Ap5zQmJ95ivAirb0aLwboGI rPbuVjjfGBBvq7vZKu4amHkqOJKtycLNiDdvfMSiC71XlLctZsO7GCySmGT7H6PI j5tA6x6ux2o9NV84i9skBK9tWygQgCvZOftCqcBpV8kU8iRIHqNWpfm8/E/VAXZj tQbConwxmbO16sV78/aS5ggQV1Ezav8REmWTA5AgCHTQpgDWreXU8Pc7AZr2+uuz h4LrVQ6qXXhVr+LebLzRYR9WGYb5eM00dq/eZEV7I1/8AGdju2bsVEONpL+lCLlA == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduiedrudefjedgvdefucetufdoteggodetrfdotf 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 583D93280060; Tue, 1 Sep 2020 05:58:30 -0400 (EDT) Date: Tue, 1 Sep 2020 11:58:29 +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: <20200901095829.64a5hjghf3mlsyvo@gilmour.lan> References: <20200729144251.us6a2pgkjjmm53ov@gilmour.lan> <20200825150606.utlynhzo664bwksy@gilmour.lan> MIME-Version: 1.0 In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200901_055834_657752_49CEF8BA X-CRM114-Status: GOOD ( 26.52 ) 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="===============3845909702818638958==" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org --===============3845909702818638958== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="gko6mttywam5g2hb" Content-Disposition: inline --gko6mttywam5g2hb Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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 wrote: > >>>>> In order to avoid pixels getting stuck in the (unflushable) FIFO be= tween > >>>>> the HVS and the PV, we need to add some delay after disabling the P= V output > >>>>> and before disabling the HDMI controller. 20ms seems to be good eno= ugh 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/v= c4_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 drm_= crtc *crtc, > >>>>> ret =3D wait_for(!(CRTC_READ(PV_V_CONTROL) & PV_VCONTROL_VI= DEN), 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 good > >>> 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, even > > though it's backed by an HR timer so the resolution is not a jiffy. Are > > we certain that we're going to be in that range? >=20 > you are right there is no guarantee about the upper wake up time. >=20 > 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. Maxime --gko6mttywam5g2hb Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCX04bRQAKCRDj7w1vZxhR xW3HAP49wZn0aa04HikR94/0ojilhpDXd01fDhWp5vQNPKerGwEAjBoqFGrVZZ3e UhBx+aeqO0CmnV+unyE9Fc/YCfCx0gc= =2JLx -----END PGP SIGNATURE----- --gko6mttywam5g2hb-- --===============3845909702818638958== 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 --===============3845909702818638958==--