From patchwork Fri Jan 12 07:48:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 10160741 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 6705F602D8 for ; Fri, 12 Jan 2018 12:53:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 57F83288B8 for ; Fri, 12 Jan 2018 12:53:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4C83F289E1; Fri, 12 Jan 2018 12:53:32 +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 DC304288B8 for ; Fri, 12 Jan 2018 12:53:31 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 30A536E7AC; Fri, 12 Jan 2018 12:53:31 +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 7A6FE6E7AC for ; Fri, 12 Jan 2018 12:53:30 +0000 (UTC) Received: by mail-lf0-x241.google.com with SMTP id j143so5851003lfg.0 for ; Fri, 12 Jan 2018 04:53:30 -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=EZDGuseldOtALoU7pz1JLreUdN5+JMrai8rtPUfPvQc=; b=PW+WbsQpHccIiYtGnEBqDgIb4LGsYEv4zYLevMz2ki6aBmSTcpQyEaZnlKk1VhVz3K 4Hep8qb7WIzzkK1fii+5NSKFmozWilLQLfDk1oP9Nc3gfHmrO5i5K1c08/LtDiH2LiqY u4MGKCKbsRBQxNHh4ldA+tJXpwzax6En0ud8c= 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=EZDGuseldOtALoU7pz1JLreUdN5+JMrai8rtPUfPvQc=; b=FjGIS+S4d2nYfP3xK6pufjkbpRxcPuTlkMvPUXxvZBiVet5W/nY0yXHC5n4k1bWgm+ B2cNvZDv+dcK/hQ8fA7YUdGpsvZfb95Kn+rGesSmjeCtXENHYNDqXKXX5fUrFPlvWH+4 Uicl2h9KL1sdL4S/+zea86WVSmBNhg7J6XSQO+7JTEPePJp82ZZc9elFapg3WxIPCg6Y qRV7Npiud/HbyoTy4Rn5EmWk+cY2+B3XghFFqmgxgPjfMTxFLjvQMzsFGiMPetTkX4Ds gVvfjzZgJUai1mJsPv+ihWQCEVykw/0mfJRM5D3TTaMDgYvKfzIEAnejI7XoM4jJbx1b yuLA== X-Gm-Message-State: AKwxytcccjX7u7ized7zSUOZYRAMSdA4wpfX53nB/crm7rsTxRuI3pJv cSLroFY4K2avEsJzdApUO4dnMrZjuXc= X-Google-Smtp-Source: ACJfBoutvtR4Jzf99THjpRPE/gwfYrDiCrmPlLaKRkGk2IFudFEAV0KO2DITQB9bAfgVucZH6FU0DQ== X-Received: by 10.25.121.6 with SMTP id u6mr11858033lfc.34.1515743605638; Thu, 11 Jan 2018 23:53:25 -0800 (PST) Received: from localhost.localdomain (c-cb7471d5.014-348-6c756e10.cust.bredbandsbolaget.se. [213.113.116.203]) by smtp.gmail.com with ESMTPSA id a69sm4115039ljf.54.2018.01.11.23.53.24 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 11 Jan 2018 23:53:24 -0800 (PST) From: Linus Walleij To: Archit Taneja , Andrzej Hajda , Laurent Pinchart Subject: [PATCH 2/4 v7] drm/bridge: Provide a way to embed timing info in bridges Date: Fri, 12 Jan 2018 08:48:52 +0100 Message-Id: <20180112074854.9560-2-linus.walleij@linaro.org> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180112074854.9560-1-linus.walleij@linaro.org> References: <20180112074854.9560-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 Reviewed-by: Laurent Pinchart --- ChangeLog v6->v7: - Fix the comment style to use the new inline type of kerneldoc for struct members. - Need an explicit ACK/review by someone on this patch to continue with the series... 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 | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/include/drm/drm_bridge.h b/include/drm/drm_bridge.h index 682d01ba920c..d3c2eea0bb63 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,35 @@ struct drm_bridge_funcs { void (*enable)(struct drm_bridge *bridge); }; +/** + * struct drm_bridge_timings - timing information for the bridge + */ +struct drm_bridge_timings { + /** + * @sampling_edge: + * + * Tells 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). + */ + u32 sampling_edge; + /** + * @setup_time_ps: + * + * Defines the time in picoseconds the input data lines must be + * stable before the clock edge. + */ + u32 setup_time_ps; + /** + * @hold_time_ps: + * + * Defines the time in picoseconds taken for the bridge to sample the + * input signal after the clock edge. + */ + u32 hold_time_ps; +}; + /** * struct drm_bridge - central DRM bridge control structure * @dev: DRM device this bridge belongs to @@ -229,6 +259,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 +272,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;