Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2315966pxb; Fri, 5 Feb 2021 14:53:09 -0800 (PST) X-Google-Smtp-Source: ABdhPJyldV08DzfYmZbUDAC8fq9dW6CS7G5eD2tyzLa0NdnjV0wtdMOzPQmyKYOuNpmDCXoWnvcJ X-Received: by 2002:a17:906:d93:: with SMTP id m19mr6061599eji.212.1612565589319; Fri, 05 Feb 2021 14:53:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612565589; cv=none; d=google.com; s=arc-20160816; b=KPQ75ghhN5a8NbCZFhe7uZEEg3EBt/Wl9Mav3rdjbNIl042kOKsNyD28jgJi5n23F3 xXiptvHVAgg6ecE6RwUAeKrc850JEkD2/vh2+tLRjW0mVSQA8KScid8fFYADE1BB1Whf gPH3R40deuFdNDHIIPEqUb2/O+rxheMCscVudLTxnAsb/BH0DCdA1Hv0jEc0iTxLqyzD TxRNWCasZFHfaOztenVw2Gx/mdZ2vnpdzeBg7IlO9b0+dv5lh4A+7sgglIrMyQnot3ic 43177/XUN8E5+8GYOkRZ6k6Kpz+K/OywHCSNSZu2Fx5ftzWmQjZWghSPl9vfdm8QFTpV 4aPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=8QXhfCGkT6nt6Gm8DYvHl+r0eG8aFncmksfOR7svUZ0=; b=mL9JUGukFHaxYQycgSBs3RzOnypqy7z2FjMmx0526vaFpg+FxQLZlznfrjoxC5OgA4 c+Q6IrsVKULcbMl7eErQslWoKyL+UmHlUp3s00Mj7EW4W3uKwRHIVj1n97DZJSMjPow7 39MePtuqXadQsBEM/KmpchRFBXnGhhwLxQLnx3IkuYNtrsFuCrER7+gYIZ/PeB+sopKS GekmJk4Dzp1aQxoK8iatZlQjiM6ne50xYx7ejhr6EY4rbTfdR1iGEkmWYdMWP01MmWsb 7EZn7LICkH+vMcxeYuIgzGFiJ1BhWHKN4FKNJLlBBuYk3MMdcY7Wzg1NPhNNI3us21JM 3R0Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=siol.net Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id eb13si7872678edb.8.2021.02.05.14.52.44; Fri, 05 Feb 2021 14:53:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=siol.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229751AbhBEWwD (ORCPT + 99 others); Fri, 5 Feb 2021 17:52:03 -0500 Received: from mailoutvs7.siol.net ([185.57.226.198]:42821 "EHLO mail.siol.net" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S231404AbhBEOnc (ORCPT ); Fri, 5 Feb 2021 09:43:32 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.siol.net (Zimbra) with ESMTP id CDAA15212DD; Fri, 5 Feb 2021 17:21:25 +0100 (CET) X-Virus-Scanned: amavisd-new at psrvmta12.zcs-production.pri Received: from mail.siol.net ([127.0.0.1]) by localhost (psrvmta12.zcs-production.pri [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id TKfwXNZRDSav; Fri, 5 Feb 2021 17:21:25 +0100 (CET) Received: from mail.siol.net (localhost [127.0.0.1]) by mail.siol.net (Zimbra) with ESMTPS id 7BD0E52391A; Fri, 5 Feb 2021 17:21:25 +0100 (CET) Received: from kista.localnet (cpe-86-58-58-53.static.triera.net [86.58.58.53]) (Authenticated sender: jernej.skrabec@siol.net) by mail.siol.net (Zimbra) with ESMTPA id C6873523912; Fri, 5 Feb 2021 17:21:24 +0100 (CET) From: Jernej =?utf-8?B?xaBrcmFiZWM=?= To: Chen-Yu Tsai , Maxime Ripard Cc: Mike Turquette , Stephen Boyd , David Airlie , Daniel Vetter , linux-clk , linux-arm-kernel , linux-kernel , dri-devel , linux-sunxi , Andre Heider Subject: Re: Re: [PATCH 2/5] drm/sun4i: tcon: set sync polarity for tcon1 channel Date: Fri, 05 Feb 2021 17:21:24 +0100 Message-ID: <2156838.FvJGUiYDvf@kista> In-Reply-To: <20210205160130.ccp7jfcaa5hgyekb@gilmour> References: <20210204184710.1880895-1-jernej.skrabec@siol.net> <20210205160130.ccp7jfcaa5hgyekb@gilmour> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 wrote: > > > > > > Channel 1 has polarity bits for vsync and hsync signals but driver never > > > sets them. It turns out that with pre-HDMI2 controllers seemingly there > > > is no issue if polarity is not set. However, with HDMI2 controllers > > > (H6) there often comes to de-synchronization due to phase shift. This > > > causes flickering screen. It's safe to assume that similar issues might > > > happen also with pre-HDMI2 controllers. > > > > > > Solve issue with setting vsync and hsync polarity. Note that display > > > stacks with tcon top have polarity bits actually in tcon0 polarity > > > register. > > > > > > Fixes: 9026e0d122ac ("drm: Add Allwinner A10 Display Engine 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/drm/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 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 = 0; > > > + > > > + if (mode->flags & DRM_MODE_FLAG_PHSYNC) > > > + val |= SUN4I_TCON0_IO_POL_HSYNC_POSITIVE; > > > + > > > + if (mode->flags & DRM_MODE_FLAG_PVSYNC) > > > + val |= SUN4I_TCON0_IO_POL_VSYNC_POSITIVE; > > > + > > > + regmap_write(tcon->regs, SUN4I_TCON0_IO_POL_REG, val); > > > + } else { > > > + val = 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 hsync and vsync. It could be either or none of those. What should I write in comment? BSP drivers and documentation use only generic names like io2_inv. Best regards, Jernej