Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp2441397pxb; Mon, 11 Jan 2021 09:41:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJyLZ8uuRL0rWXDc+QTHbBSW9QRk6PVV/5nZBrkeiYOIWIKfXvfakBlJqfn10o0+d2VQDxdm X-Received: by 2002:a17:906:77c5:: with SMTP id m5mr397489ejn.424.1610386862607; Mon, 11 Jan 2021 09:41:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610386862; cv=none; d=google.com; s=arc-20160816; b=SYhQYDnf5E2CKS4XYuhammCFHW/hGKCTK3fIfhyoFZRWw7bs+VHEWNy4RwrrssDP6+ 5gM+Om9kqOvqgd7Ol6OSMJrDJBc+Gtp+0mmORbqBrKIBlWEQ0mx9UkoJ0aalBYsys/k3 8AgKGX8fggE+sOoYbvwKpEzb8OxDQBPC33tmB2/uKSs0XBUfKRo+GYPWoX6T1Waoe4dw p98xBxvAWPp2oEzKvjqnhkZjbI5nxMJ9/RMCoYF6JqV71NTTj7XdICYBA/D7Pu6tQZhY gIpueOrOybSLfH6YOoporceT1biQHmTI1zi/24MEADtaR9VZiDLHBwvyQqvQIxe7CK47 qaYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=3mHLqHc3vaiAMd7ZTpWZa2FM0Smp/43TOAlD5rakosI=; b=B1WKdisP0gM0oKYK1MbsENg0hJkbuCsvVi7jUj/oft0hkoJ1+gDiMJZr2GKPYL2fZh 8u/VVOksVpEedMgPZIqe6FmKlbwZP5lJ+nKS6d6OzjO52VO3N8jcprz/rO1UaP7AhP/R fYZlrE6/Zt25WgVFXAONmkYvIPTLRnjK/QGHMHS1UJgFB4rh/84BOER4RbgTxa4HhCln Q7AiqbhkPN0Xza2FcMnxC3d6c9st6YbDIixk380ZaNqc94T/MtrAmFYcM3VHR33i5OWY J3TcfG/YOJqLROoHHDhn3t9ThUO/ZmhinIh8la8XCQgsh1l6FzLsahoQ7p/FjNtXy57F inlA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@aruba.it header.s=a1 header.b=F75mtUW8; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dh5si150127edb.122.2021.01.11.09.40.39; Mon, 11 Jan 2021 09:41:02 -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; dkim=pass header.i=@aruba.it header.s=a1 header.b=F75mtUW8; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389775AbhAKRi5 (ORCPT + 99 others); Mon, 11 Jan 2021 12:38:57 -0500 Received: from smtpcmd0756.aruba.it ([62.149.156.56]:53131 "EHLO smtpcmd15176.aruba.it" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2389564AbhAKRi5 (ORCPT ); Mon, 11 Jan 2021 12:38:57 -0500 Received: from [192.168.126.129] ([146.241.213.249]) by Aruba Outgoing Smtp with ESMTPSA id z18QkRB5IiSGyz18QkaX0h; Mon, 11 Jan 2021 18:37:49 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=aruba.it; s=a1; t=1610386669; bh=9rypusLXSregUp5IREA3MTJHjP1GCcUbjnNzJVPU29A=; h=Subject:To:From:Date:MIME-Version:Content-Type; b=F75mtUW8k9w5YP0g3OxcngzxU/7uRbim1V62GTN1xj27hKfVNQgMohcE0MEniDgl8 U1hCZ5vaujqq03jOtOD4r2bJNRQQFSyMiTjHIXQ1kL1huX/TECbxBWoohTxLsg6SdN MwVarMQpuiiAPVLaXYHwXNa9hIrAjo3PiqQ1qVScpRGBylzo5ZMvClam14ktGe0g8S i1NHeYFAOpwa6c7e523+lsaodbI85DEp4MdvNc8iYJJpUHJcJ2y0OTYvL7S/jqHEe6 TFWG6pb/QsDy/gDsNoCiyX4SLhw6PvlUjK52+IkE6jWRlaTn0nVbpnyvidYYHe28R+ Rc5d0YMTXnjRA== Subject: Re: [PATCH v2 2/2] drm/sun4i: tcon: improve DCLK polarity handling To: Maxime Ripard Cc: Marjan Pascolo , wens@csie.org, daniel@ffwll.ch, airlied@linux.ie, treding@nvidia.com, Jernej Skrabec , dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Giulio Benetti References: <3685133.SLcexNTYsu@kista> <20210107023032.560182-1-giulio.benetti@benettiengineering.com> <20210107023032.560182-3-giulio.benetti@benettiengineering.com> <20210108092355.7p5uakxt7lpdu3bn@gilmour> <35622307-5e88-a2ed-bdf9-fca6554efefc@benettiengineering.com> <20210111172052.7v522xam74xkq6se@gilmour> From: Giulio Benetti Message-ID: Date: Mon, 11 Jan 2021 18:37:42 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20210111172052.7v522xam74xkq6se@gilmour> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-CMAE-Envelope: MS4wfK8Kt4nJXeFMs4gCbJtRGyPSD58rPmQLQ1OKbK7WAyj6e0WfasPgC+VWds73gfqHjRv51nb+TgfqF82quQSbJOZrAsthYIroOpocDqIL4QQRuWu1d5bE sOPKvRqjYYl5cYKzWTIEj2j76ZBlBKnuC7ITHZ9B4QGKr2PAouWcDC/hbUInTuxP48DlTRc9bXRWeH+/NozPc97jpN6gQUpVqZ7DVZCk0Xrok0qTkvw1VkyV LkagEdS5aN9bV682N6z4ltxiTw6Sc1aClsfZL0hzFruiUJGt/jvkcVg7/GzgbwNB7emG+gCjrzo17hxYYXAqcoFphBD0P5CUQKT6uAxq9Naysjz7dsfPKYyR DnddLFC/3fnH7Jr24Jiu46SueAfUW8394VkKWhCnXqg8zjKVxpPDtamlZQu5iuzYQjG/jHTU/fw4tHl9TlYGRjjoMdTCgcdkoCMxOS3zuXqr9VKVk9t3udyQ 0LW2wDYmLXuP7AxgjPc/+moYG/Wl+rbdwY7zogPE4DlUUJXFFLSVTD93ehuA8abYWHc5I43IujLuMdTe+peICcKyLLoyDxVzmBmLOg== Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 1/11/21 6:20 PM, Maxime Ripard wrote: > On Fri, Jan 08, 2021 at 03:34:52PM +0100, Giulio Benetti wrote: >> Hi, >> >> On 1/8/21 10:23 AM, Maxime Ripard wrote: >>> Hi, >>> >>> Thanks for those patches >>> >>> On Thu, Jan 07, 2021 at 03:30:32AM +0100, Giulio Benetti wrote: >>>> From: Giulio Benetti >>>> >>>> It turned out(Maxime suggestion) that bit 26 of SUN4I_TCON0_IO_POL_REG is >>>> dedicated to invert DCLK polarity and this makes thing really easier than >>>> before. So let's handle DCLK polarity by adding >>>> SUN4I_TCON0_IO_POL_DCLK_POSITIVE as bit 26 and activating according to >>>> bus_flags the same way is done for all the other signals. >>>> >>>> Cc: Maxime Ripard >>> >>> Suggested-by would be nice here :) >> >> Ok, didn't know about this tag >> >>>> Signed-off-by: Giulio Benetti >>>> --- >>>> drivers/gpu/drm/sun4i/sun4i_tcon.c | 20 +------------------- >>>> drivers/gpu/drm/sun4i/sun4i_tcon.h | 1 + >>>> 2 files changed, 2 insertions(+), 19 deletions(-) >>>> >>>> diff --git a/drivers/gpu/drm/sun4i/sun4i_tcon.c b/drivers/gpu/drm/sun4i/sun4i_tcon.c >>>> index 52598bb0fb0b..30171ccd87e5 100644 >>>> --- a/drivers/gpu/drm/sun4i/sun4i_tcon.c >>>> +++ b/drivers/gpu/drm/sun4i/sun4i_tcon.c >>>> @@ -569,26 +569,8 @@ static void sun4i_tcon0_mode_set_rgb(struct sun4i_tcon *tcon, >>>> if (info->bus_flags & DRM_BUS_FLAG_DE_LOW) >>>> val |= SUN4I_TCON0_IO_POL_DE_NEGATIVE; >>>> - /* >>>> - * On A20 and similar SoCs, the only way to achieve Positive Edge >>>> - * (Rising Edge), is setting dclk clock phase to 2/3(240?). >>>> - * By default TCON works in Negative Edge(Falling Edge), >>>> - * this is why phase is set to 0 in that case. >>>> - * Unfortunately there's no way to logically invert dclk through >>>> - * IO_POL register. >>>> - * The only acceptable way to work, triple checked with scope, >>>> - * is using clock phase set to 0? for Negative Edge and set to 240? >>>> - * for Positive Edge. >>>> - * On A33 and similar SoCs there would be a 90? phase option, >>>> - * but it divides also dclk by 2. >>>> - * Following code is a way to avoid quirks all around TCON >>>> - * and DOTCLOCK drivers. >>>> - */ >>>> if (info->bus_flags & DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE) >>>> - clk_set_phase(tcon->dclk, 0); >>>> - >>>> - if (info->bus_flags & DRM_BUS_FLAG_PIXDATA_DRIVE_NEGEDGE) >>>> - clk_set_phase(tcon->dclk, 240); >>>> + val |= SUN4I_TCON0_IO_POL_DCLK_POSITIVE; >>> >>> I'm not really sure why we need the first patch of this series here? >> >> The idea was to have 2 for testing, 1st one is already applicable, while the >> other must be tested, but I can send only one with no problem. >> >>> That patch only seem to undo what you did in patch 1 >> >> No, it doesn't, the 2nd one change the way it achieve the same thing, >> because the 1st swap DCLK phase, while the 2nd uses the IO_POL bit to set IO >> polarity according to bus_flags. > > It makes sense for testing, but I'm not sure we want to carry it into > the history. Can you squash them both into the same patch? Sure, I'm going to send V3 then. Thank you Best regards -- Giulio Benetti Benetti Engineering sas