Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1025541imm; Thu, 6 Sep 2018 14:06:02 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZDJIzKw6QvwLbevE82qrsyJ0UCbU5N/x/xb7PgmDcduOVwyRz0BkNx0EPDI5no/J8JtuhH X-Received: by 2002:a17:902:5a4e:: with SMTP id f14-v6mr4736916plm.311.1536267962186; Thu, 06 Sep 2018 14:06:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536267962; cv=none; d=google.com; s=arc-20160816; b=hYlF0iL1RnSTlsjHNfX1K9eIJDQY/KCJKr7epFxfuyyK1oHNabWGZ/kdN6WvH7kZ/1 Dctw5IBjKMC1QmYZF4FC3nw/4OyFdLW9MHTnQsiB/OPSItIHqo+zRFcyEqozHIH4payY OQSQjgPQqKTbf6iIm0POQBT9T9kkDEtct+TQo5SppqGIy1N+e2pbsUCBpoTTawZJJ7qS 3OQHvCtujc4zbn3V7hNNaRA0iL3EtvYzcaKbgYFVmn47Wh0vHm7EulzbHQh2c+0wU4+q O4/Vq+SipCKBTXnWa6jU2I7hrLi4Z8443eIapI4f5IgIHKeC/4FpCu6NgKhVtk3/Bdzd qC6Q== 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=zH15cs26qYQnTN72QlZnTgeN2SRn7AVR2FOdxCYzQgY=; b=Y2/UfDHvrP46+9ajUuriu5Hau2PJgnN8D9LUK8sZqlLOOf508p8V0xdiP9DnHfYHyz lug5CLSJnN8nDQFWMXcofse8mWV6Ej7Y1aIRQfeeOdrzWxHSr0thts9YU1CLC7LZnvB/ W6d5PaVGimmAK6QxEQFwSHHbpqRxRO0FCccp+eCv5cxq8Mef80DOFA72my0sHcXN1348 hN9IbwlOfB2DYMW2XeMiKRvBrV9pAwN62uSQeS473znUxpRkYR6gDPCtFP/mFdmS6K3X WiBaYgk0pBYmMBIvSH+3QxdAUoAUClIUfyWPSh9Yt0yoT1mTOp5IKBDV0d1o17o9/iIo EbXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@agner.ch header.s=dkim header.b=VruonReK; 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 d11-v6si6283764plo.91.2018.09.06.14.05.46; Thu, 06 Sep 2018 14:06:02 -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=VruonReK; 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 S1729309AbeIFWEJ (ORCPT + 99 others); Thu, 6 Sep 2018 18:04:09 -0400 Received: from mail.kmu-office.ch ([178.209.48.109]:47138 "EHLO mail.kmu-office.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728091AbeIFWEJ (ORCPT ); Thu, 6 Sep 2018 18:04:09 -0400 Received: from webmail.kmu-office.ch (unknown [IPv6:2a02:418:6a02::a3]) by mail.kmu-office.ch (Postfix) with ESMTPSA id 8B4075C08AC; Thu, 6 Sep 2018 19:27:37 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=agner.ch; s=dkim; t=1536254857; 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=zH15cs26qYQnTN72QlZnTgeN2SRn7AVR2FOdxCYzQgY=; b=VruonReK2ofsG31sFlqqOInLafO05tIX4KSblzTPbI/JBWpzUqsbvaEj9vz079wIoHuw8B c7Wrk/DsfzlpoKaAVryXf+5M1vHmrv3g63C9icjXPyJeYQ2Hsx5QG/UZk/TGvmYaTKKG3A TFYwl1ky8NV1PhVyNJnN9hsE+oUDHgw= MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Date: Thu, 06 Sep 2018 10:27:36 -0700 From: Stefan Agner To: Laurent Pinchart Cc: Linus Walleij , 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: <1611934.U20VZ57ca3@avalon> References: <20180905052113.21262-1-stefan@agner.ch> <10044412.4MiZRujKJI@avalon> <1611934.U20VZ57ca3@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 09:54, Laurent Pinchart wrote: > Hi Stefan, > > On Thursday, 6 September 2018 19:48:51 EEST Stefan Agner wrote: >> On 06.09.2018 05:25, Laurent Pinchart wrote: >> > On Thursday, 6 September 2018 14:07:41 EEST 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) >> > >> > The flags are used for the drm_connector bus_flags field, and really mean >> > driving on the positive/negative edges. We this can't change their meaning >> > like this. >> > >> >> > 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. >> > >> > I agree that we need both the driving and sampling edge. In many case they >> > will be opposite, and providing some kind of appropriate defaults in APIs >> > is fine by me, but we need a way to specify both when needed. >> >> We do have pixel clock flags for displays, but also they are actually >> controller oriented: >> >> https://elixir.bootlin.com/linux/latest/source/include/video/display_timing. >> h#L15 >> >> I guess having different flags to denote driving and sampling edge >> independently would be ideal. But then, is there really a use case where >> it wouldn't be the exact opposite? > > Yes, for instance when the transmission delay for clock and data signals is > different, you may want to sample on the same edge used by the transmitter to > latch the output. Linus had that case, which prompted him to add the sampling > edge field. > Bu in that case the controller does not know what it actually should do with the sampling information alone either... Where is that code handling that today? sample_edge has been added, but I only see setup_time_ps being used in pl111_display.c. I'm not a hardware guy, but according to my rough calculation a pixel clock signal at 100MHz would need to be 1.5m off compared to the data signals to skew by a half period! Length matching is usually only necessary at really high speed signals. Is that really what is going on here? Why not just work around by specifying "the wrong" edge...? -- Stefan >> The other bus flags are actually fine as is. I suggest to just stick >> with the bus flags as we have them now, at least for now. >> >> Alternatively, we could provide "consumer/bridge" oriented flags which >> use the same bit and just are the opposite of the controller oriented >> flags, e.g.: >> >> /* 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) >> /* sample data on neg. edge */ >> #define DRM_BUS_FLAG_PIXDATA_SAMPLE_NEGEDGE (1<<2) >> /* sample data on pos. edge */ >> #define DRM_BUS_FLAG_PIXDATA_SAMPLE_POSEDGE (1<<3)