From patchwork Mon Aug 26 15:26:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Boris Brezillon X-Patchwork-Id: 11114867 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 002291800 for ; Mon, 26 Aug 2019 15:26:56 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D741E2173E for ; Mon, 26 Aug 2019 15:26:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D741E2173E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=collabora.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4556C6E21C; Mon, 26 Aug 2019 15:26:56 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [46.235.227.227]) by gabe.freedesktop.org (Postfix) with ESMTPS id BDAB96E21C for ; Mon, 26 Aug 2019 15:26:54 +0000 (UTC) Received: from localhost.localdomain (unknown [IPv6:2a01:e0a:2c:6930:5cf4:84a1:2763:fe0d]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: bbrezillon) by bhuna.collabora.co.uk (Postfix) with ESMTPSA id E5D1D28BC20; Mon, 26 Aug 2019 16:26:52 +0100 (BST) From: Boris Brezillon To: dri-devel@lists.freedesktop.org Subject: [PATCH v2 00/21] drm: Add support for bus-format negotiation Date: Mon, 26 Aug 2019 17:26:28 +0200 Message-Id: <20190826152649.13820-1-boris.brezillon@collabora.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Nikita Yushchenko , Jernej Skrabec , Laurent Pinchart , Neil Armstrong , Andrey Smirnov , Jonas Karlman , Seung-Woo Kim , Kyungmin Park , Thierry Reding , Chris Healy , Boris Brezillon , kernel@collabora.com, Sam Ravnborg Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" This patch series aims at adding support for runtime bus-format negotiation between all elements of the 'encoder -> bridges -> connector/display' section of the pipeline. In order to support that, we need drm bridges to fully take part in the atomic state validation process, which requires adding a drm_bridge_state and a new drm_bridge_funcs.atomic_check() hook. Once those basic building blocks are in place, we can add new hooks to allow bus format negotiation (those are called just before ->atomic_check()). The bus format selection is done at runtime by testing all possible combinations across the whole bridge chain until one is reported to work. Major changes since the RFC: * Add a dummy bridge to the drm_encoder object so that vc4 and exynos DSI drivers can implement the pre_enable/post_disable hooks instead of manually setting encoder->bridge to NULL to control the enable/disable sequence. This change is also a first step towards drm_bridge/drm_encoder unification. New encoder drivers should stop implementing drm_encoder_helper_funcs and switch to drm_bridge_funcs. Existing drivers can be converted progressively (already have a branch where I started converting some of them [1]) * rework the bus format negotiation to give more control to bridge drivers in the selection process (driver can select at runtime which input bus format they support for a specific output bus format based on any information available in the connector, crtc and bridge state. A more detailed changelog is provided in each patch. This patch series is also available here [2]. Thanks, Boris [1]https://github.com/bbrezillon/linux-0day/commits/drm-encoder-bridge [2]https://github.com/bbrezillon/linux-0day/commits/drm-drm-bridge-busfmt-v2 Boris Brezillon (21): drm: Stop including drm_bridge.h from drm_crtc.h drm: Add a dummy bridge object to drm_encoder drm/vc4: Implement bridge_funcs instead of encoder_helper_funcs drm/exynos: Fix potential unbalanced calls to pm_runtime_put drm/exynos: Don't reset bridge->next drm/exynos: Implement bridge_funcs instead of encoder_helper_funcs drm/bridge: Rename bridge helpers targeting a bridge chain drm/msm: Use drm_attach_bridge() to attach a bridge to an encoder drm/bridge: Introduce drm_bridge_chain_get_next_bridge() drm/bridge: Make the bridge chain a double-linked list drm/bridge: Add the drm_for_each_bridge_in_chain() helper drm/bridge: Add a drm_bridge_state object drm/bridge: Patch atomic hooks to take a drm_bridge_state drm/bridge: Add an ->atomic_check() hook drm/bridge: Add the drm_bridge_chain_get_prev_bridge() helper drm/bridge: Add the necessary bits to support bus format negotiation drm/imx: pd: Use bus format/flags provided by the bridge when available drm/bridge: lvds-encoder: Implement basic bus format negotiation drm/bridge: panel: Propage bus format/flags drm/panel: simple: Add support for Toshiba LTA089AC29000 panel ARM: dts: imx: imx51-zii-rdu1: Fix the display pipeline definition .../display/bridge/lvds-transmitter.txt | 12 + .../display/panel/toshiba,lt089ac29000.txt | 5 +- arch/arm/boot/dts/imx51-zii-rdu1.dts | 24 +- drivers/gpu/drm/arc/arcpgu_hdmi.c | 1 + drivers/gpu/drm/bridge/analogix-anx78xx.c | 1 + .../drm/bridge/analogix/analogix_dp_core.c | 13 +- drivers/gpu/drm/bridge/dumb-vga-dac.c | 1 + drivers/gpu/drm/bridge/lvds-encoder.c | 105 +++ .../bridge/megachips-stdpxxxx-ge-b850v3-fw.c | 1 + drivers/gpu/drm/bridge/nxp-ptn3460.c | 1 + drivers/gpu/drm/bridge/panel.c | 31 + drivers/gpu/drm/bridge/parade-ps8622.c | 1 + drivers/gpu/drm/bridge/sii902x.c | 1 + drivers/gpu/drm/bridge/sii9234.c | 1 + drivers/gpu/drm/bridge/sil-sii8620.c | 1 + drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 1 + drivers/gpu/drm/bridge/tc358764.c | 1 + drivers/gpu/drm/bridge/tc358767.c | 1 + drivers/gpu/drm/bridge/ti-sn65dsi86.c | 1 + drivers/gpu/drm/bridge/ti-tfp410.c | 1 + drivers/gpu/drm/drm_atomic.c | 39 + drivers/gpu/drm/drm_atomic_helper.c | 46 +- drivers/gpu/drm/drm_bridge.c | 749 ++++++++++++++---- drivers/gpu/drm/drm_crtc_helper.c | 29 +- drivers/gpu/drm/drm_encoder.c | 26 +- drivers/gpu/drm/drm_probe_helper.c | 3 +- drivers/gpu/drm/drm_simple_kms_helper.c | 1 + drivers/gpu/drm/exynos/exynos_dp.c | 2 +- drivers/gpu/drm/exynos/exynos_drm_dsi.c | 70 +- drivers/gpu/drm/exynos/exynos_drm_mic.c | 1 + drivers/gpu/drm/exynos/exynos_hdmi.c | 1 + drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_rgb.c | 1 + drivers/gpu/drm/hisilicon/kirin/dw_drm_dsi.c | 1 + drivers/gpu/drm/i2c/tda998x_drv.c | 1 + drivers/gpu/drm/imx/imx-ldb.c | 1 + drivers/gpu/drm/imx/parallel-display.c | 137 +++- drivers/gpu/drm/ingenic/ingenic-drm.c | 1 + drivers/gpu/drm/mediatek/mtk_dpi.c | 1 + drivers/gpu/drm/mediatek/mtk_dsi.c | 1 + drivers/gpu/drm/mediatek/mtk_hdmi.c | 9 +- drivers/gpu/drm/msm/dsi/dsi.h | 1 + drivers/gpu/drm/msm/edp/edp.c | 4 +- drivers/gpu/drm/msm/edp/edp.h | 1 + drivers/gpu/drm/msm/edp/edp_bridge.c | 10 +- drivers/gpu/drm/msm/hdmi/hdmi.c | 4 +- drivers/gpu/drm/msm/hdmi/hdmi.h | 2 + drivers/gpu/drm/omapdrm/dss/output.c | 1 + drivers/gpu/drm/omapdrm/omap_drv.c | 5 +- drivers/gpu/drm/omapdrm/omap_encoder.c | 4 +- drivers/gpu/drm/panel/panel-simple.c | 36 + drivers/gpu/drm/rcar-du/rcar_du_crtc.c | 10 +- drivers/gpu/drm/rcar-du/rcar_du_encoder.c | 1 + drivers/gpu/drm/rockchip/rockchip_lvds.c | 1 + drivers/gpu/drm/rockchip/rockchip_rgb.c | 1 + drivers/gpu/drm/sti/sti_dvo.c | 1 + drivers/gpu/drm/sti/sti_hda.c | 1 + drivers/gpu/drm/sti/sti_hdmi.c | 1 + drivers/gpu/drm/sun4i/sun4i_lvds.c | 1 + drivers/gpu/drm/sun4i/sun4i_rgb.c | 1 + drivers/gpu/drm/sun4i/sun4i_tcon.c | 1 + drivers/gpu/drm/tilcdc/tilcdc_external.c | 1 + drivers/gpu/drm/vc4/vc4_dsi.c | 73 +- include/drm/drm_atomic.h | 3 + include/drm/drm_bridge.h | 335 +++++++- include/drm/drm_crtc.h | 1 - include/drm/drm_encoder.h | 23 +- 66 files changed, 1533 insertions(+), 314 deletions(-)