From patchwork Wed Jan 10 14:12:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 124098 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp5325267qgn; Wed, 10 Jan 2018 06:12:39 -0800 (PST) X-Google-Smtp-Source: ACJfBov87HcTskl6xrPoxC1Mf3iVQ/ChV3ZKHxUwAC2pk82XqYo3g6nqHQn/Jd5FWcTiruJ98olP X-Received: by 10.99.125.9 with SMTP id y9mr15459278pgc.417.1515593559205; Wed, 10 Jan 2018 06:12:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1515593559; cv=none; d=google.com; s=arc-20160816; b=FQC4VCKivwRYA5E0eVoabw7a7XypRE4D2U9IFiSa9sEoHw1rlgs1TrKq+hLz4Mm5ME 2fM0X1DcNRrOtJifYgTrj0n41TAAgT9UndN8z8e79g/GC9qIHBR29qphFCHE5ihuLx4w CJkrBniwjHqOtqQkExNeMgY6wmPxCw7JhUBogVc4K+lXtV/KQQqv2/41gBEaOTvbX0KW UiQMQcwa+iZSfI3iTbFZu1XaWdWpyjW2FrtwNGHtVRk7/KqgxDrqxRFx0AkPgPpVqMZx TZCZ+QB6UjYssuBBnX8qqXFlTZYzh2fUFCb/ipXxdxmO8w5oewqirhJjTkw5u6+wB5gf V7rw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:cc:references:in-reply-to:message-id:date :subject:to:from:dkim-signature:delivered-to :arc-authentication-results; bh=MEcRAxl4rCqRIqvsAs+MYu1/NRVP/TIihoXUFu8ey0A=; b=J/yerEqy14jkstBElqY+sUk7aCqcnwug6eU6g8z9zby0UjogGvD2ObhDavb3HyURdN DPbTZCBexyAK+ezx/+YJ4g2d2hvsJIdhAFz5zwFsJs4h943hYB1c47uFBjHphqVrPV1e xR49fLlJ8N2mTdhQj+6DlnAx/YcypYn105YtPEXq5TbGsO2bxcG9IcVvpm4iAxfhfDqa SyWoQujCWjPa9xLtF0l0Ko//mN24B8Zx36DFHeNIo57qeS9JN/TZXhxqSj6IlcqEOyGp kXsMjRW39Glgq2g6QdSWuApHquUkP7h0F0j2LiWOfnmfdZuDBQOVWpxKFduCoY7z/yWK OyWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=LgVB60nA; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTPS id a15si12102772pll.818.2018.01.10.06.12.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 10 Jan 2018 06:12:39 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) client-ip=131.252.210.177; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=LgVB60nA; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B71F66E2D1; Wed, 10 Jan 2018 14:12:37 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-lf0-x241.google.com (mail-lf0-x241.google.com [IPv6:2a00:1450:4010:c07::241]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5A85B6E2CF for ; Wed, 10 Jan 2018 14:12:36 +0000 (UTC) Received: by mail-lf0-x241.google.com with SMTP id j143so20009559lfg.0 for ; Wed, 10 Jan 2018 06:12:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=0NKER+TkXQ8r9fIntYWGr2MJV1xi7N1nXTdWuUUf5Cc=; b=LgVB60nAXUATUA3gokh2EdcIx8T2l1oH7LUG2bBczp3LK2lAtRwMXe9l/i/j589bfT VE3mnXvzbXReR8rT/JMVvtSno1WpMU+Rl2Mm3yhVZsssaeiR9MlkvILHOYWJZ685h03e ntGkLfDD9MVzRFgU+PirBiAWnJrlU1RBFBBSo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=0NKER+TkXQ8r9fIntYWGr2MJV1xi7N1nXTdWuUUf5Cc=; b=hSAATeKn0uIsqjg6IKHjHt3lNCbJOHGik34wrzkbejHRm8S8++fEO5CcrKwikqHoyE oZIt/xWtcJJGSBQxJqSi15/hw+s8ZuyHBYbqtncAKdY4hHkHgyGuFGG+WSBdALXxxXgK JqtzNkBTnSIPFT9pgAdiCHIzMbVd16+ioU4XVOLoFc1G7+cLHYsqgwfBPL8LQHWhsrCz LvrqdwhO/thnjFpqwhxy6yr1mxzn1qrUxfI4hDO0PtreQmJJqWEmxyrom8WmiscEaZ88 0gtUZIs2vE3z2yOKBjLuufi805RDtG3tdhiP+4podCzXbaa0gzakKYc6N3RZYyLJkkZZ +zpA== X-Gm-Message-State: AKGB3mKsgQdKA+BGK1IX9rb7P6T93dqPQhrJPW306CX7uI8dbw92OEO4 o6VSAAOyTaUm5bzYbBbvQgrK1g== X-Received: by 10.46.33.163 with SMTP id h35mr12087777lji.0.1515593554843; Wed, 10 Jan 2018 06:12:34 -0800 (PST) Received: from genomnajs.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id u72sm1019258lfi.64.2018.01.10.06.12.33 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 10 Jan 2018 06:12:34 -0800 (PST) From: Linus Walleij To: Archit Taneja , Andrzej Hajda , Laurent Pinchart Subject: [PATCH 2/4 v6] drm/bridge: Provide a way to embed timing info in bridges Date: Wed, 10 Jan 2018 15:12:24 +0100 Message-Id: <20180110141226.27826-2-linus.walleij@linaro.org> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180110141226.27826-1-linus.walleij@linaro.org> References: <20180110141226.27826-1-linus.walleij@linaro.org> Cc: linux-arm-kernel@lists.infradead.org, dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" After some discussion and failed patch sets trying to convey the right timing information between the display engine and a bridge using the connector, I try instead to use an optional timing information container in the bridge itself, so that display engines can retrieve it from any bridge and use it to determine how to drive outputs. Signed-off-by: Linus Walleij --- ChangeLog v5->v6: - Sort forward struct declarations alphabetically - Switch to using DRM_BUS_FLAG_PIXDATA_[POS|NEG]EDGE to indicate positive or negatice clock samling edge ChangeLog ->v5: - New patch --- include/drm/drm_bridge.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/include/drm/drm_bridge.h b/include/drm/drm_bridge.h index 682d01ba920c..28c9ac6d9036 100644 --- a/include/drm/drm_bridge.h +++ b/include/drm/drm_bridge.h @@ -29,6 +29,7 @@ #include struct drm_bridge; +struct drm_bridge_timings; struct drm_panel; /** @@ -222,6 +223,23 @@ struct drm_bridge_funcs { void (*enable)(struct drm_bridge *bridge); }; +/** + * struct drm_bridge_timings - timing information for the bridge + * @sampling_edge: whether the bridge samples the digital input signal from the + * display engine on the positive or negative edge of the clock, this should + * reuse the DRM_BUS_FLAG_PIXDATA_[POS|NEG]EDGE bitwise flags from the DRM + * connector (bit 2 and 3 valid) + * @setup_time_ps: the time in picoseconds the input data lines must be stable + * before the clock edge + * @hold_time_ps: the time in picoseconds taken for the bridge to sample the + * input signal after the clock edge + */ +struct drm_bridge_timings { + u32 sampling_edge; + u32 setup_time_ps; + u32 hold_time_ps; +}; + /** * struct drm_bridge - central DRM bridge control structure * @dev: DRM device this bridge belongs to @@ -229,6 +247,8 @@ struct drm_bridge_funcs { * @next: the next bridge in the encoder chain * @of_node: device node pointer to the bridge * @list: to keep track of all added bridges + * @timings: the timing specification for the bridge, if any (may + * be NULL) * @funcs: control functions * @driver_private: pointer to the bridge driver's internal context */ @@ -240,6 +260,7 @@ struct drm_bridge { struct device_node *of_node; #endif struct list_head list; + const struct drm_bridge_timings *timings; const struct drm_bridge_funcs *funcs; void *driver_private;