From patchwork Fri Dec 15 12:10:45 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 10114869 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 8D70660231 for ; Fri, 15 Dec 2017 12:11:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7D74D29F3C for ; Fri, 15 Dec 2017 12:11:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 70B7229F3E; Fri, 15 Dec 2017 12:11:37 +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 2ABF729F3C for ; Fri, 15 Dec 2017 12:11:37 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 17EDD6E7E2; Fri, 15 Dec 2017 12:11:36 +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 E04E26E7E2 for ; Fri, 15 Dec 2017 12:11:34 +0000 (UTC) Received: by mail-lf0-x241.google.com with SMTP id f18so10206906lfg.8 for ; Fri, 15 Dec 2017 04:11:34 -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=TGSG2xCzauO3XJhdlnx4VWOWiTUnorIrXPxF2OS6jQk=; b=Cn6vY2GDzDwKir1c0xOvYdqnem7kR6YJz0b0/K4VPQjuhyRCDZrhYyyL4dJG991wax QnpYEqE/7lseUkLS+dJVgF4pnTunYjYDjLvJOVm9l1f/U9+N5lUaNWtqVsI8z/3smtCk KG/3G7JjRKCZ82kZe2YE84QHpwyUqkEXYGrGY= 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=TGSG2xCzauO3XJhdlnx4VWOWiTUnorIrXPxF2OS6jQk=; b=j9lZFYzKpFokROOFYP5MRSdnYed/U5Y9MrY2WMvp3xcZyjino8jYteYk0s5X1KZsZG Uv4N44z1g/aHa+OujG3wqQKjTWaJIN7nmWSF26MfHnS7SzyN5g26pdWj/EL/gHnAXp5d U9Yu9mXa5F4ilakbRb2LKp9GbPkkHIRu2eIw3tOe8956x3Vam7BLggvCLmWlT2uBmbPm 9/AMDmjQlUnV6z8msGj7f3KhbxV4RTLUsHqo8jDv1OszqaDeefnAfJLSdk+HyHdF+fkr j3+7TvYupyyZkGElvUINwt8Nm5fr15QZB++rQKS1zJV4haGQcJP2+2fP08KEYwsXrLcZ Yz0g== X-Gm-Message-State: AKGB3mLLR1GrJU+k8LRw+Q6vWfVfz+nLZ5hpKzqOryGvy4Zj6O13YZL5 G3TukTp3OE1JWy96Qmhbzx4f0A== X-Google-Smtp-Source: ACJfBovvWk2Glv+fLUvReGDP7Y+sbtM1YkmcaF/5IJb1wTfKMjfifC7ZMSTyEtCfMaxuXTNy5hBfHw== X-Received: by 10.46.29.11 with SMTP id d11mr6056635ljd.24.1513339893366; Fri, 15 Dec 2017 04:11:33 -0800 (PST) Received: from localhost.localdomain ([90.229.2.39]) by smtp.gmail.com with ESMTPSA id z81sm1289345lff.80.2017.12.15.04.11.31 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 15 Dec 2017 04:11:32 -0800 (PST) From: Linus Walleij To: Archit Taneja , Andrzej Hajda , Laurent Pinchart Subject: [PATCH 2/4 v5] drm/bridge: Provide a way to embed timing info in bridges Date: Fri, 15 Dec 2017 13:10:45 +0100 Message-Id: <20171215121047.3650-3-linus.walleij@linaro.org> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20171215121047.3650-1-linus.walleij@linaro.org> References: <20171215121047.3650-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: - New patch --- include/drm/drm_bridge.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/include/drm/drm_bridge.h b/include/drm/drm_bridge.h index 682d01ba920c..3bf34f7c90d4 100644 --- a/include/drm/drm_bridge.h +++ b/include/drm/drm_bridge.h @@ -30,6 +30,7 @@ struct drm_bridge; struct drm_panel; +struct drm_bridge_timings; /** * struct drm_bridge_funcs - drm_bridge control functions @@ -222,6 +223,22 @@ 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 - false means + * negative edge, true means positive edge. + * @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 rising or falling edge + */ +struct drm_bridge_timings { + bool 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 +246,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 +259,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;