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: 124330 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp2025233qgn; Fri, 12 Jan 2018 04:54:02 -0800 (PST) X-Google-Smtp-Source: ACJfBosAgbV6xi3Tye6cm/JX/1IO0UV/+mf8Ku5sx40bplTd0hEj8E9hOGAKaysQtRv/E6MZVQ6q X-Received: by 10.84.212.150 with SMTP id e22mr26026159pli.447.1515761642248; Fri, 12 Jan 2018 04:54:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1515761642; cv=none; d=google.com; s=arc-20160816; b=UONjsUjXOTd7zA9FEB5GfV9+ji8YUhFEA1oLFh8ifZLFk2Ehdcmx9CwECRjv1TIYFq 6kV3K4IgxOWeZboOx7IO27Gm3pDExyAj3cZzGGUYgFR//LJMht4N/tHQ3INI7GZAIcUn xuIYzRcVGi8UtkzN3Uxt0XMAuOy/Tuf6/ziw+JgJ6iMGpL76oroZySe28DtBIRT7i/L0 j9hxZUDyYNT9GEoOUHDac2eYYAq/6xTUcm4RAibejmz9MR6dUAmNrRNqfZAcM6Urddf2 i8RDCTsf25dqVNm7+reraTKv7WM5c3bLpU/o2impDPxNW1TsbfGml/pWJt1y5JkZRY0e +J+Q== 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=bs3fmxF1+K7S1CxaKTZamQxmU1bEjDJuNThkqgQ9UTI=; b=FlY06Zbt9zikg4Ijy3Ja5ym4eBdRlWKo9ZzJH3iCyFLF8stsUMG8+EkWGNNT+BgAFW y20n1wzbDDS1ggqAwjWiNoMWL+nZGEn6Owr1Siuwlra0DWGuOKuejfy67WyxubFxleHm hnP4ndpbs0In0taqdd1huQLT6CspZFuOe2OBH7RFAD94zI3LMyCeulS6j3r2JcA27wYd xEMpIosz73qoWaroBmfYVZ9QuSosDFUKcsXGm4bHo892cIBE/AQhVfRguUfPtwOfe+5b XEYEPJB+uA4gToHYf6YuFrOL1FV1sIx1BfPIXk5JM4ltUB4HMtgxrRHHIT3MWe2ZhXxC bKBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=PW+WbsQp; 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 v8si15887464plg.491.2018.01.12.04.54.02 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 12 Jan 2018 04:54:02 -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=PW+WbsQp; 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 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-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" 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;