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: 122079 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp386057qgn; Fri, 15 Dec 2017 04:12:07 -0800 (PST) X-Google-Smtp-Source: ACJfBouL+YKETs8+7GzCsApY/HpfI34JMOs0c+wHPLPHf1PJ/ft3boHD8dOftVMDrtI1NQPmfzjm X-Received: by 10.98.156.81 with SMTP id f78mr13107017pfe.211.1513339927292; Fri, 15 Dec 2017 04:12:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513339927; cv=none; d=google.com; s=arc-20160816; b=SZWMXF5XnQEh7QEeAIp9BP/NLWRQR0oWEcFLxSin+uQ+xcSpYTau1NzmGEXYrhJe3n Lf216ULk4iAal5SFvCMU27H4BWsE0SIB8pVJCCnaAdy6G5tor3ZH5MlLlxADu8OimLIF yg//D9ynpchkIWngPwQrNJb7ZU5GSQqHWy1qpc9euX7dMY7aZhPxWiJoXwx0wSg8LLUW WR7i6CXote5MxschpAc6tvHOzIs0yx7BBWbeFh++vW2xW7BhXlJBE91TvdiiVsSrai+p hDhEnSu4CEShJb4O79vdNGBwi8pzzFNLihI82yp6UTmK+1qSS7h18nXvp7gxYUMTK/rF 3nXQ== 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=iIX+lLU3kgLz0RAPiHSuMqgaE24PEow+adxn7RNRNsk=; b=zv1RxgttPRoA8vpu2SO/R6zQf66k5yCsHenqbFyNto1jrq4IhLNQ/6+FI/SgOTbmVw VHebTuYFZAUy1Xyr8KzGaj5AlN2MPnkGN/pp4JJ5b8hGl6smsZDzgfO3Fs/ytrTCXBWo eezOi0wWVmTCL41Vqf6syyxPnpwswwxKTCQtJWVwkgGMBL2rpOKgTOvcKMPGE+f5vK0F Fw2y6xebtoJiVlN72pDmkfjxm3AoNSkLZBhoHa4lEydaUaB3LHTaTuaroMtakne9jUGo TKDSO3oCsKgSvjvbI6NfFB2gQ0WVaXKnubP0rhSUXmEUZayG4iLMDivwD8jT0rDzfgP9 3rWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=Cn6vY2GD; 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 66si4247672pld.784.2017.12.15.04.12.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 15 Dec 2017 04:12:07 -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=Cn6vY2GD; 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 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-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" 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;