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: 10155215 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 9CF5E60231 for ; Wed, 10 Jan 2018 14:12:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8E7992845C for ; Wed, 10 Jan 2018 14:12:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 82F4A2858E; Wed, 10 Jan 2018 14:12:39 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 3C6532845C for ; Wed, 10 Jan 2018 14:12:39 +0000 (UTC) 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-Google-Smtp-Source: ACJfBotPVnxThvN6yDMYE9kWh7hxInlqw5JzfSo/V3ykCL30J4HVn63aYjHoUwUXGPjwKDTE1vuR8A== 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" X-Virus-Scanned: ClamAV using ClamSMTP 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;