Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp776871imm; Thu, 6 Sep 2018 09:56:17 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaaGcP+QCQYh6qgmuFIOvz5ZcA1zm5RXIhHSisoR8bthVUfXY26z2yC1GwqjKqzQ+s2vkoY X-Received: by 2002:a63:3dc6:: with SMTP id k189-v6mr3718175pga.191.1536252977677; Thu, 06 Sep 2018 09:56:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536252977; cv=none; d=google.com; s=arc-20160816; b=p827UtA5LXAADx8juphmO4Q+W2QBmFnrCZdiyL6syQFF54XPHhyP7hy7MhqEDVkVHE hXUwXT8xsR9UzlQapk+n4asSLJ4ekFnulYZ2wyDKRAeV3zBqu67PXjP1pEbumcDGKviV lw1hiYBL0tY6DbKlZ+4FKukTq63EG1Q1rfEiaVBpu92Q0v0Is89USYwM7FlXOwhD7alu U+Ui5OqmL2pUHWI5nkNX2cQ24/RexYTjS97gsHy6Vmo1ZwPnyE7GqmVVM1EEkQkPwVgF kRDw82WY8UhuRui9GrPkVDlSEVUHwWRpRSWF97owf6lNZwfDbulxTNFF3x3+4O5YJRuU m5LQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:organization:message-id:date:subject:cc:to :from:dkim-signature; bh=HpUuH0s1/CqiysRqGCPSZTKC6XXj0OX+UU0sGrYFmrs=; b=fDD2y8uOLZjkPWpNjDCNr7G/7n3PP7VBHlyRMZFNMA3NuGS/G3Chizo81h0mAGYfzA oV/BtGU2moBLXv3A4vncbIIfm4UzZJC+fPbsqOaZsDrXHwy1mIlyg0XlGXRqGvYWCufP WLvu9B2jTnEF7I4fFIaCGajQFaazc5fhBF/y+c5X/6Pk6K/1fAPZQHpnQiL/tdq95RIj NHwvSaL3uA1EPVQYpXF/1QcZWYtaARlczCzMo7+n2XadwISCVfolk9VCMqFiGDYFhXDS w0a4nw81gT+Xv6GLFbXBD1xqCSlYbjgLO0rvzzNe7HPbJGAKGGe43mdYsG4hqE/AX1EE om4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b="Gr/Jr+SA"; 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 e9-v6si5784854pgj.70.2018.09.06.09.56.00; Thu, 06 Sep 2018 09:56:17 -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 (test mode) header.i=@ideasonboard.com header.s=mail header.b="Gr/Jr+SA"; 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 S1728514AbeIFVay (ORCPT + 99 others); Thu, 6 Sep 2018 17:30:54 -0400 Received: from perceval.ideasonboard.com ([213.167.242.64]:45590 "EHLO perceval.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727847AbeIFVax (ORCPT ); Thu, 6 Sep 2018 17:30:53 -0400 Received: from avalon.localnet (unknown [91.180.122.170]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id B7A911A45; Thu, 6 Sep 2018 18:54:29 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1536252870; bh=iUYv09LGxupqL5o1ekZOIs6mWAhQPxQW2N+FgcezwRk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Gr/Jr+SATsP+PVplvl8SaKDFbKf3v878VKeE/HRGKDgB39W7lPVwo+CPyWMm+GmBd +b8PoLDV2jK8TohpmtbDvI9Dgl+ZrstmkWRk/9Tr+wcr0b/oh+KGh54VWDDcXoJXDo 89OJfBAxusBkDPTJ90mK0Fp/M3Pb7xyrgtoTHDxw= From: Laurent Pinchart To: Stefan Agner 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 Date: Thu, 06 Sep 2018 19:54:37 +0300 Message-ID: <1611934.U20VZ57ca3@avalon> Organization: Ideas on Board Oy In-Reply-To: References: <20180905052113.21262-1-stefan@agner.ch> <10044412.4MiZRujKJI@avalon> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. > 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) -- Regards, Laurent Pinchart