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=-14.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,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 60A27C433DB for ; Tue, 9 Feb 2021 10:33:26 +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 06E1164E4B for ; Tue, 9 Feb 2021 10:33:25 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 06E1164E4B 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=edv2xBqPnDr5kmyLYuaQJ3DuvNfSmF526F1MBdlU1DI=; b=F3blR8ryakcOKTsgdEoPtOg9L T3YVPaXOrWOj996pPmLXEWU0BT2OpnSxFO84EgMStGOVkVl5t4DRlZW7udN5icq0WLi+/LL87DFf7 zy1u+q8TPu0HyiLdGe36xYlEz5n3UoDc2auUQq61fRDuT3QWYoy0ETvKfDln2LHz98GnMSpNI1uJu 8YBjaVXdURhdLQDHH4zOtcOZmRu2rv081kyhI2jRmDXKUl1bYpY6mJZaHvPoEfVKfDoJuoU+Rxg/n OgJnepmKwqlTTounlqAWWQgioktolMaBJ5R4euS2WpHvmDaJdyZw2ivOTgVR40LZCkQIpi0VGhN2l xmwCN2SVQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l9QJW-0007t8-ER; Tue, 09 Feb 2021 10:32:10 +0000 Received: from new4-smtp.messagingengine.com ([66.111.4.230]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l9QJT-0007rq-Tj for linux-arm-kernel@lists.infradead.org; Tue, 09 Feb 2021 10:32:09 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailnew.nyi.internal (Postfix) with ESMTP id A893558018B; Tue, 9 Feb 2021 05:32:03 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Tue, 09 Feb 2021 05:32:03 -0500 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=fm2; bh=Jt1fO61HE02mor/p4/e0vvQVzyp UYMVpukrxRr4pIl0=; b=gy8fEdwmYdkeQ8fotFSQU0/tDyfUqgMq2SUYoNaDlpb rUJikXAa4pKn4hMdRrJmJAuJ+ujlOORjbAz5VLGwL3OH9xErQquWjsotKMrp/aoA fIUjkF5x8cEzBDPL6Xk2+e+BIFW+J3nadR13oLak15wDh5XJre9kgh1kxc4OEXqb RHaWXPY4gHL1tKb+mvV6jCmr2miXegc5pOBQdryZDZ+S2fET+NT2f2XYYwyQaEV1 tTeJ//9RFCXthIoXil/W6obfRqFYODEjnv4ywaEtH1l9H7I/T3XSeCvS93GEkL1A MKMpJePR8b58FXSqALe5orCQItF/nx/lJPGhkrNypqQ== 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=fm2; bh=Jt1fO6 1HE02mor/p4/e0vvQVzypUYMVpukrxRr4pIl0=; b=nIf3OoCE1HypM0jgX2mMyK 4d+rnAtKa3pDVr7BeGt1EHBk197gCDnXnXO5EUUHkBrsVqjv/C072X3C0pVbXpY6 T9lpK7lZNyZMBTRHuVoaPUl6zWcb6PsJVophqUDkv9zdcVJKra1UX77bnHX55GG2 F1HQpy6hcgnJJUBhf8yM5L/k17rhWQ81/WMSPosD9b6yZIp6ZPXW73AsNf7odUjA cJQVQr++fjfMFZ6Fgq2N+pFLePGD94t5WwSiDo3CkpRfqGWqKUCX72L2E2umIZeD 4EBA6C1zAMopyJKHl5AC67Hu9TLk+7hmKGJzL2iaj9g174O3pLs9zYZI133i3wEw == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrheehgddukecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvuffkfhggtggujgesghdtreertddtjeenucfhrhhomhepofgrgihimhgv ucftihhprghrugcuoehmrgigihhmvgestggvrhhnohdrthgvtghhqeenucggtffrrghtth gvrhhnpeeutdfgjeeuudehvefgvedvtedtudelfffgffekledtffekgedukeejueevieeg udenucfkphepledtrdekledrieekrdejieenucevlhhushhtvghrufhiiigvpedtnecurf grrhgrmhepmhgrihhlfhhrohhmpehmrgigihhmvgestggvrhhnohdrthgvtghh 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 4AF51108006A; Tue, 9 Feb 2021 05:32:00 -0500 (EST) Date: Tue, 9 Feb 2021 11:31:58 +0100 From: Maxime Ripard To: Jernej =?utf-8?Q?=C5=A0krabec?= Subject: Re: [PATCH 2/5] drm/sun4i: tcon: set sync polarity for tcon1 channel Message-ID: <20210209103158.rnzvlvo44nnzrmk4@gilmour> References: <20210204184710.1880895-1-jernej.skrabec@siol.net> <2156838.FvJGUiYDvf@kista> <3972834.uPFdDeCNB3@kista> MIME-Version: 1.0 In-Reply-To: <3972834.uPFdDeCNB3@kista> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210209_053208_143516_D1D36A21 X-CRM114-Status: GOOD ( 28.67 ) 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: Andre Heider , Stephen Boyd , Mike Turquette , linux-sunxi , linux-kernel , dri-devel , David Airlie , Chen-Yu Tsai , Daniel Vetter , linux-clk , linux-arm-kernel Content-Type: multipart/mixed; boundary="===============6091538289387510724==" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org --===============6091538289387510724== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="lvwjttyd23hbxwrd" Content-Disposition: inline --lvwjttyd23hbxwrd Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Feb 05, 2021 at 07:47:17PM +0100, Jernej =C5=A0krabec wrote: > Dne petek, 05. februar 2021 ob 17:28:23 CET je Chen-Yu Tsai napisal(a): > > On Sat, Feb 6, 2021 at 12:21 AM Jernej =C5=A0krabec =20 > wrote: > > > > > > Dne petek, 05. februar 2021 ob 17:01:30 CET je Maxime Ripard napisal(= a): > > > > On Fri, Feb 05, 2021 at 11:21:22AM +0800, Chen-Yu Tsai wrote: > > > > > On Fri, Feb 5, 2021 at 2:48 AM Jernej Skrabec=20 > > > > wrote: > > > > > > > > > > > > Channel 1 has polarity bits for vsync and hsync signals but dri= ver=20 > never > > > > > > sets them. It turns out that with pre-HDMI2 controllers seeming= ly=20 > there > > > > > > is no issue if polarity is not set. However, with HDMI2 control= lers > > > > > > (H6) there often comes to de-synchronization due to phase shift= =2E=20 > This > > > > > > causes flickering screen. It's safe to assume that similar issu= es=20 > might > > > > > > happen also with pre-HDMI2 controllers. > > > > > > > > > > > > Solve issue with setting vsync and hsync polarity. Note that di= splay > > > > > > stacks with tcon top have polarity bits actually in tcon0 polar= ity > > > > > > register. > > > > > > > > > > > > Fixes: 9026e0d122ac ("drm: Add Allwinner A10 Display Engine=20 > support") > > > > > > Tested-by: Andre Heider > > > > > > Signed-off-by: Jernej Skrabec > > > > > > --- > > > > > > drivers/gpu/drm/sun4i/sun4i_tcon.c | 24 ++++++++++++++++++++++= ++ > > > > > > drivers/gpu/drm/sun4i/sun4i_tcon.h | 5 +++++ > > > > > > 2 files changed, 29 insertions(+) > > > > > > > > > > > > diff --git a/drivers/gpu/drm/sun4i/sun4i_tcon.c b/drivers/gpu/d= rm/ > sun4i/ > > > sun4i_tcon.c > > > > > > index 6b9af4c08cd6..0d132dae58c0 100644 > > > > > > --- a/drivers/gpu/drm/sun4i/sun4i_tcon.c > > > > > > +++ b/drivers/gpu/drm/sun4i/sun4i_tcon.c > > > > > > @@ -672,6 +672,29 @@ static void sun4i_tcon1_mode_set(struct=20 > sun4i_tcon > > > *tcon, > > > > > > SUN4I_TCON1_BASIC5_V_SYNC(vsync) | > > > > > > SUN4I_TCON1_BASIC5_H_SYNC(hsync)); > > > > > > > > > > > > + /* Setup the polarity of sync signals */ > > > > > > + if (tcon->quirks->polarity_in_ch0) { > > > > > > + val =3D 0; > > > > > > + > > > > > > + if (mode->flags & DRM_MODE_FLAG_PHSYNC) > > > > > > + val |=3D SUN4I_TCON0_IO_POL_HSYNC_POSIT= IVE; > > > > > > + > > > > > > + if (mode->flags & DRM_MODE_FLAG_PVSYNC) > > > > > > + val |=3D SUN4I_TCON0_IO_POL_VSYNC_POSIT= IVE; > > > > > > + > > > > > > + regmap_write(tcon->regs, SUN4I_TCON0_IO_POL_REG= ,=20 > val); > > > > > > + } else { > > > > > > + val =3D SUN4I_TCON1_IO_POL_UNKNOWN; > > > > > > > > > > I think a comment for the origin of this is warranted. > > > > > > > > If it's anything like TCON0, it's the pixel clock polarity > > > > > > Hard to say, DW HDMI controller has "data enable" polarity along hsyn= c and > > > vsync. It could be either or none of those. > > > > > > What should I write in comment? BSP drivers and documentation use onl= y=20 > generic > > > names like io2_inv. > >=20 > > Just say that we don't know exactly what it is, but it is required for= =20 > things > > to work properly? Would be interesting to know what happens if you don'= t set > > this bit, but do set VSYNC/HSYNC polarity properly. >=20 > Nothing seems to happen - tested on H3 with HDMI (4k@30) and CVBS. At lea= st I=20 > didn't notice anything. That's pretty normal, an inverted pixel clock would at worst give you some weird artifacts and / or pixels being of the wrong color. Data enable on the other hand would very likely stall the HDMI controller since you would have only the blanking periods that would be considered valid. Maxime --lvwjttyd23hbxwrd Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCYCJkngAKCRDj7w1vZxhR xedJAQCvyb+V3yoXMwG3DqhG21kI9ivkqbheculNc5PYOa79ZQD/cKZtr++3tXXL b0t+vjHAf3eohmy56y3F2ZBXFWYzhg8= =MfCa -----END PGP SIGNATURE----- --lvwjttyd23hbxwrd-- --===============6091538289387510724== 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 --===============6091538289387510724==--