Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1043506imm; Thu, 6 Sep 2018 14:25:39 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbFLTrKJteImnCw3O+VI8DARBg8FKICEpJ4PyiXFxBx2Yh4jJtgARGemGcffyu1kfahKH2v X-Received: by 2002:a63:5845:: with SMTP id i5-v6mr4958464pgm.272.1536269139144; Thu, 06 Sep 2018 14:25:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536269139; cv=none; d=google.com; s=arc-20160816; b=s1waDpEuiSVknHivwn0nMK1qJWkkzuwwidSFC7hkxWARAV+vjkuON+qaSbnYIqG4oK MjXQc6tX5smjodjBgQnpvMAfc/bAR2ezwIb5mHoAfKHYeSyx6YDwTc6DmtEkVP/cs9H5 IF9E56Nh+EzaAxJ9HKWQ1wKEVBo9Wy+cMweNH7S6PFy+s7aAj24DAUBcVZx3MLJK098V LXM8N5hNdlRwAIiE1NPdNBGcuSfv1+yL+XE3cphqkoncATzao5OyOZ/8gGg9vaPxLg8I lORfUMJM/gyxd9OV86DZ2/yOT+sKKKMXSC+frVu1x8jtFcMSUEi3TGaDPmsP5WNEJsm/ OwcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:message-id:references :in-reply-to:subject:cc:to:from:date:content-transfer-encoding :mime-version:dkim-signature; bh=WoWo7ocZy3OhtTKHZoy+DZARznPO7J5oz+g0gvUMo1A=; b=c+92k6wAXEzJ+GiFa5vZUIG8AIZ7/dx4D/0CoqP1gzVnDHq9Ae8W5M4PuP38DH3zKX i1w13nXtRgzhO3uZNTZuJKSnWkRXhQbdSMwCDji2OZR//UBBvz3oijoQ9pDoHMa9Ioek Zr66taaV0OfOVU08/kilENnk3fL8ydjuJVyIO//yWEnepX1GI5XQ2MP7eYoM6he7wfp9 wQr+SNpex+aFHxbJBdXz33rvzivLiZWkZ1p3YHiYveytV6y5rNxtlyVaozS5E60BIuT5 Pu552tg9/XEe+ts2OLCIJNNhyTPz3rh/A6tqYEoc9Wfrqn9Zhg7F7b96+g68FMFkuV2e /u6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@agner.ch header.s=dkim header.b=auM8DQNj; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m7-v6si5682648plt.7.2018.09.06.14.25.24; Thu, 06 Sep 2018 14:25:39 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@agner.ch header.s=dkim header.b=auM8DQNj; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729681AbeIGBDH (ORCPT + 99 others); Thu, 6 Sep 2018 21:03:07 -0400 Received: from mail.kmu-office.ch ([178.209.48.109]:48634 "EHLO mail.kmu-office.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729249AbeIGBDG (ORCPT ); Thu, 6 Sep 2018 21:03:06 -0400 Received: from webmail.kmu-office.ch (unknown [IPv6:2a02:418:6a02::a3]) by mail.kmu-office.ch (Postfix) with ESMTPSA id 9B33D5C0840; Thu, 6 Sep 2018 22:25:56 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=agner.ch; s=dkim; t=1536265556; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=WoWo7ocZy3OhtTKHZoy+DZARznPO7J5oz+g0gvUMo1A=; b=auM8DQNjnnhW/SKHfj5jaOa28QW2qS6SmIy9Dxgw3zzQ1ltS4RtRBwKViYgC65l1XWn/DQ u8j6AvH7/nWQ5mbU+2CCn2WAn1jal47rsvyk+nKEYDRV/ZTuUBk5n4WvFA33KtE1jNvGcL Pl+ag5XbUzmezkIFP8BMN5w2UQRhAK0= MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Date: Thu, 06 Sep 2018 13:25:56 -0700 From: Stefan Agner To: Linus Walleij , Laurent Pinchart Cc: Dave Airlie , Rob Herring , Mark Rutland , Shawn Guo , Sascha Hauer , Philipp Zabel , Sascha Hauer , Fabio Estevam , NXP Linux Team , Archit Taneja , Andrzej Hajda , Gustavo Padovan , Maarten Lankhorst , sean@poorly.run, Marcel Ziswiler , max.krummenacher@toradex.com, "open list:DRM PANEL DRIVERS" , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , Linux ARM , linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/6] drm/bridge: use bus flags in bridge timings In-Reply-To: References: <20180905052113.21262-1-stefan@agner.ch> <4035252.QuWadVx7pr@avalon> <1569297.pdEFdpi3HS@avalon> Message-ID: X-Sender: stefan@agner.ch User-Agent: Roundcube Webmail/1.3.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 06.09.2018 04:07, Linus Walleij wrote: > On Wed, Sep 5, 2018 at 8:32 PM Stefan Agner wrote: >> On 05.09.2018 00:44, Laurent Pinchart wrote: > >> Good point! I actually really don't like that we use the same flags here >> but from a different perspective. Especially since the flags defines >> document things differently: >> >> /* drive data on pos. edge */ >> #define DRM_BUS_FLAG_PIXDATA_POSEDGE (1<<2) >> /* drive data on neg. edge */ >> #define DRM_BUS_FLAG_PIXDATA_NEGEDGE (1<<3) > > Maybe a stupid comment from my side, but can't we just change the > documentation to match the usecases? > > /* Trigger pixel data latch on positive edge */ > #define DRM_BUS_FLAG_PIXDATA_POSEDGE (1<<2) > >> Using the opposite perspective would also need translation in crtc >> drivers... So far no driver uses sampling_edge. >> >> I would prefer if we always use the meaning as documented by the flags. >> >> I guess we would need to convert DRM_BUS_FLAG_PIXDATA_POSEDGE -> >> DRM_BUS_FLAG_PIXDATA_NEGEDGE. >> >> Linus Walleij, you added sampling edge, any thoughts? > > I just thought it was generally useful to have triggering edge encoded > into the bridge as it makes it clear that this edge is something > that is a delayed version of the driving edge which is subject to > clock skew caused by the speed of electrons in silicon and > copper and slew rate caused by parasitic capacitance. Ok, I read a bit up on the history of bridge timing, especially: https://www.spinics.net/lists/dri-devel/msg155618.html IMHO, this got overengineered. For displays we do not need all that setup/sample delay timing information, and much longer cables are in use. So why is all that needed for bridges? For Linus case, the THS8134(A/B) data sheet I found (revised March 2010) clearly states: Clock input. A rising edge on CLK latches RPr0-7, GY0-7, BPb0-7. So we need to drive on negative edge, hence DRM_BUS_FLAG_PIXDATA_NEGEDGE should be used, which makes the pl111 driver setting TIM2_IPC: http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0121d/index.html > DRM_BUS_FLAG_PIXDATA_POSEDGE is the right value for my use cases, but it > doesn't match how the ADV7123 operates. Using DRM_BUS_FLAG_PIXDATA_NEGEDGE > would match the hardware, but would break display for some modes, depending on > the display clock frequency as the internal 8.5ns output delay applied to a > falling clock edge would fall right into the 1.7ns setup + hold time window of > the ADV7123 around the rising edge. I can't test this right now as I don't > have local access to boards using the ADV7123, but from a quick calculation > that ignores the PCB transmission delay modes with frequencies between 57MHz > and 71MHz could break if the data was output on the falling edge of the clock. If clocks vs. data signal are really that much off on R-Car DU, then parallel displays must have the very same issue... Are you sure that only the clock signal has an output delay? And that this output delay is a fixed value, clock independent? Typically, delays apply to all signals equally, and often are clock frequency dependent... Without really looking at the signals, I would not jump to conclusions here! I am pretty sure that driving on negative edge works just as well. -- Stefan > > Yours, > Linus Walleij