From patchwork Tue Mar 28 17:07:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 2823 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pf1-f199.google.com (mail-pf1-f199.google.com [209.85.210.199]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 867DA4147B for ; Tue, 28 Mar 2023 19:08:17 +0200 (CEST) Received: by mail-pf1-f199.google.com with SMTP id o14-20020a62f90e000000b0062d87d997eesf2862992pfh.18 for ; Tue, 28 Mar 2023 10:08:17 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1680023296; cv=pass; d=google.com; s=arc-20160816; b=FgBHLRHBwBrXk2fxjnb6oTYOWDzUoHxARGp5JBYb8EBihGcXX1iQN+8GHNpriWrYhW cfe0Hz0AnK7EKyvldF9zA2Sc+oixweMuDMSC7ogUegYAG/2FWYcIEMNhNs6qC+NpiEDZ xHigI4c2eddwJIOg4qJhCE4p3L00X0MssV/FPR+misLkLRpQxhlfeMJpEsplmvz3WaCz HGNVJ/2FwIN+ZndDulIsNhwfzc2ZIvyTslBxM0LjALTq8XDxUkH556wbNxFPhwmxEnJr Oucwo48ZHcqr2iPAqKmfqI+OxGuIp9xkjjqFRQUnY6oPdfG3Cn3ySYIaXT0+FMU0FU0X mwrQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:message-id:date:subject:cc:to :from:dkim-signature; bh=tK8A/UnDAf5nWRLW3sxGzwwcbVZCDIACPEMf9jJuZsI=; b=DVMRMd62lMgJYJs13OkaTzhtXaQ7VzX9krSRfusqt5WhGC7Qx3XoEdq2IrIXgXrX+O 3U4vnGshIdOjp8JqthKADsVlz5nyrILm1hZcE2WoziP4WdJilAt3nXujddMNr5lCo0t4 mgMUsj0EXfxj6wcm8Hmg8ggeIa9KSXUhvWGQV0EOSeh6slH7YxbAozh+f0L9FLRAWFmd VbzjDTrdYhp+TUHcEY7ptUyckzCMQJNJLmGi2J7KWjyRtM48uMzldmDwaDjykWULNcwI ZjwywZxbsIbTeIlGvF0kljYsOJDdDQ/SHTkgwyKqp9Ra22UZ2hb9w3iJJvbDnj/OMETw +++g== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="lL/wtX/B"; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1680023296; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:message-id:date:subject:cc:to:from :from:to:cc:subject:date:message-id:reply-to; bh=tK8A/UnDAf5nWRLW3sxGzwwcbVZCDIACPEMf9jJuZsI=; b=EsT7Vd2IR/VZZZ+T/dMOmmjvlIRYjviCE335ean9bOVJil71rbJT/yaaMliZTAsuFH MeVTH5Wf2yNrLeWJGiGWwgzPGxfujaT60YtbHA4aYh+5MAqftRsiTFnazhHsB4hu7uRP EqFcrwrKz+LE3Ox0TOJ4HhUn3E8AhwNvhCHJw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680023296; h=list-unsubscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:mime-version :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=tK8A/UnDAf5nWRLW3sxGzwwcbVZCDIACPEMf9jJuZsI=; b=zU83ZARWFrtgOs9au3kY9lsqSE3M6h35HBoKPIDHbishbAcNie10o39eexzTqD34F7 i+9GNo6UJE1pFYMB2gSoO18bQeB4jkTxVP5BtDNhRwZGRrJ+KPlzyhAotH0KsNQ8NvzG XEwvJn5cl9FHLJepcS7Riubb6kSOa4kc6yFiUSM973QqE/rchey6seMsDKVocns+PkTY coTQne3v6jz0Net1oPQGBmk/k0PCE5pBNVlIEPNL5aNqsK3aVucGZgmbN0cDvC2YfTZ/ 7ocTZCHOWbxQ7WAeJbRVnAMYvR7ATCV+iSqHxohqJGerBdGW3VfQcC7j8UnwahnryRPD 03Iw== X-Gm-Message-State: AAQBX9ex6YdNyqlM6hOpiu+ToNRmhhuordZwbZbJiycZzhZrrnuUoUop XXPSloF6CYoDQOlU5jGVV0teDDbR X-Google-Smtp-Source: AKy350aIO9j28u4gF0H+LrJY7hZardITcPHd/h+xFMahJp61EDJD5MpwrB3F5L33pxl57Xqk41tMaA== X-Received: by 2002:a17:902:9041:b0:1a1:bbc5:be8e with SMTP id w1-20020a170902904100b001a1bbc5be8emr6006370plz.11.1680023296078; Tue, 28 Mar 2023 10:08:16 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:902:ecca:b0:199:50f5:6729 with SMTP id a10-20020a170902ecca00b0019950f56729ls10421915plh.11.-pod-prod-gmail; Tue, 28 Mar 2023 10:08:15 -0700 (PDT) X-Received: by 2002:a17:902:d48b:b0:1a0:4046:23f2 with SMTP id c11-20020a170902d48b00b001a0404623f2mr19657287plg.56.1680023294911; Tue, 28 Mar 2023 10:08:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680023294; cv=none; d=google.com; s=arc-20160816; b=w+m5wlODfCh/O4OUinKuQEUyOAZNsx5vwAbrtBGsNAUBCklllPVSrJJ88QIQ/9CUjP MyB73786O0t864bpm37N9cuZ49PG7s6FSoi6ncp6J7OV7eybgZziB/KO7+KV/Hsy2ozl h5l+POr+Z25haAHpnjvVONkOV8s+qtaDdcGh0HzBvpqhradeNxzkxsve2csGmQpW4Zzd ytiet7eHKVI5Oa1yCFCw3AA00ylkE+l/+0p81kK6e2oc9lS/n0JmHzKguB0LI8O9fLOg RX5/QdFcA1PiGdGKLqVKfVX7fGvd7pTFFfYBfnqHSfsdspYzQh3PuqekNn7sjINzH7lv YMmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:dkim-signature; bh=O72nQMvXwuS9p7u9XEXsCt0AwfhA6j8fJBtuOxggIi4=; b=dISKYzSzhdrMcEGEsxO3Issh6jaONSv78+t++uqtzQb7sWs7l1pDEWl54cmvb6IhmO AgoOYCK4ox+yjqrYOEZF8hDIrVq++s1wENoSw4LB2meT12Aa15yuPUWRDiS6BdVXLmwg f2JgKxGnZBYydNqDq/fOhtC/5E7RDh2I9EOS+IdEsA9G0AOEc8LkAKHxZmEoiEuzUOml qp3OglsCMvpvQ+Wiyk0IZzXdqvlE9BZwhpsrlw+o7CSsYlKqRUnXrZqlotMqcXkkZcHb 2w1Kn6aF4XxQe6+xuTrnZ+sHX1Fp3f9Z12s2szgzypcXjJ92LkxqBcFjDcjRlRf5ji9g PZ4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="lL/wtX/B"; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id j23-20020a170902759700b001a21fceff32sor4123605pll.79.2023.03.28.10.08.14 for (Google Transport Security); Tue, 28 Mar 2023 10:08:14 -0700 (PDT) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; X-Received: by 2002:a17:902:d4c3:b0:19f:36ae:c29f with SMTP id o3-20020a170902d4c300b0019f36aec29fmr21442520plg.46.1680023294314; Tue, 28 Mar 2023 10:08:14 -0700 (PDT) Received: from localhost.localdomain ([2405:201:c00a:a047:2fbc:aff5:d52a:cc2c]) by smtp.gmail.com with ESMTPSA id y17-20020a170902b49100b0019f114570b0sm20470349plr.152.2023.03.28.10.08.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Mar 2023 10:08:13 -0700 (PDT) From: Jagan Teki To: Dave Stevenson , Maarten Lankhorst , Thomas Zimmermann , David Airlie , Daniel Vetter , Andrzej Hajda , Neil Armstrong Cc: dri-devel@lists.freedesktop.org, Marek Vasut , linux-amarula , Jagan Teki Subject: [PATCH v2 1/2] drm/bridge: Fix improper bridge init order with pre_enable_prev_first Date: Tue, 28 Mar 2023 22:37:51 +0530 Message-Id: <20230328170752.1102347-1-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="lL/wtX/B"; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , For a given bridge pipeline if any bridge sets pre_enable_prev_first flag then the pre_enable for the previous bridge will be called before pre_enable of this bridge and opposite is done for post_disable. These are the potential bridge flags to alter bridge init order in order to satisfy the MIPI DSI host and downstream panel or bridge to function. However the existing pre_enable_prev_first logic with associated bridge ordering has broken for both pre_enable and post_disable calls. [pre_enable] The altered bridge ordering has failed if two consecutive bridges on a given pipeline enables the pre_enable_prev_first flag. Example: - Panel - Bridge 1 - Bridge 2 pre_enable_prev_first - Bridge 3 - Bridge 4 pre_enable_prev_first - Bridge 5 pre_enable_prev_first - Bridge 6 - Encoder In this example, Bridge 4 and Bridge 5 have pre_enable_prev_first. The logic looks for a bridge which enabled pre_enable_prev_first flag on each iteration and assigned the previou bridge to limit pointer if the bridge doesn't enable pre_enable_prev_first flags. If control found Bridge 2 is pre_enable_prev_first then the iteration looks for Bridge 3 and found it is not pre_enable_prev_first and assigns it's previous Bridge 4 to limit pointer and calls pre_enable of Bridge 3 and Bridge 2 and assign iter pointer with limit which is Bridge 4. Here is the actual problem, for the next iteration control look for Bridge 5 instead of Bridge 4 has iter pointer in previous iteration moved to Bridge 4 so this iteration skips the Bridge 4. The iteration found Bridge 6 doesn't pre_enable_prev_first flags so the limit assigned to Encoder. From next iteration Encoder skips as it is the last bridge for reverse order pipeline. So, the resulting pre_enable bridge order would be, - Panel, Bridge 1, Bridge 3, Bridge 2, Bridge 6, Bridge 5. This patch fixes this by assigning limit to next pointer instead of previous bridge since the iteration always looks for bridge that does NOT request prev so assigning next makes sure the last bridge on a given iteration what exactly the limit bridge is. So, the resulting pre_enable bridge order with fix would be, - Panel, Bridge 1, Bridge 3, Bridge 2, Bridge 6, Bridge 5, Bridge 4, Encoder. [post_disable] The altered bridge ordering has failed if two consecutive bridges on a given pipeline enables the pre_enable_prev_first flag. Example: - Panel - Bridge 1 - Bridge 2 pre_enable_prev_first - Bridge 3 - Bridge 4 pre_enable_prev_first - Bridge 5 pre_enable_prev_first - Bridge 6 - Encoder In this example Bridge 5 and Bridge 4 have pre_enable_prev_first. The logic looks for a bridge which enabled pre_enable_prev_first flags on each iteration and assigned the previou bridge to next and next to limit pointer if the bridge does enable pre_enable_prev_first flag. If control starts from Bridge 6 then it found next Bridge 5 is pre_enable_prev_first and immediately the next assigned to previous Bridge 6 and limit assignments to next Bridge 6 and call post_enable of Bridge 6 even though the next consecutive Bridge 5 is enabled with pre_enable_prev_first. This clearly misses the logic to find the state of next conducive bridge as everytime the next and limit assigns previous bridge if given bridge enabled pre_enable_prev_first. So, the resulting post_disable bridge order would be, - Encoder, Bridge 6, Bridge 5, Bridge 4, Bridge 3, Bridge 2, Bridge 1, Panel. This patch fixes this by assigning next with previou bridge only if the bridge doesn't enable pre_enable_prev_first flag and the next further assign it to limit. This way we can find the bridge that NOT requested prev to disable last. So, the resulting pre_enable bridge order with fix would be, - Encoder, Bridge 4, Bridge 5, Bridge 6, Bridge 2, Bridge 3, Bridge 1, Panel. Validated the bridge init ordering by incorporating dummy bridges in the sun6i-mipi-dsi pipeline Fixes: 4fb912e5e190 ("drm/bridge: Introduce pre_enable_prev_first to alter bridge init order") Signed-off-by: Jagan Teki Reviewed-by: Dave Stevenson --- Changes for v2: - add missing dri-devel in CC drivers/gpu/drm/drm_bridge.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/drm_bridge.c b/drivers/gpu/drm/drm_bridge.c index c3d69af02e79..052a8e6c9961 100644 --- a/drivers/gpu/drm/drm_bridge.c +++ b/drivers/gpu/drm/drm_bridge.c @@ -684,11 +684,17 @@ void drm_atomic_bridge_chain_post_disable(struct drm_bridge *bridge, */ list_for_each_entry_from(next, &encoder->bridge_chain, chain_node) { - if (next->pre_enable_prev_first) { + if (!next->pre_enable_prev_first) { next = list_prev_entry(next, chain_node); limit = next; break; } + + if (list_is_last(&next->chain_node, + &encoder->bridge_chain)) { + limit = next; + break; + } } /* Call these bridges in reverse order */ @@ -771,7 +777,7 @@ void drm_atomic_bridge_chain_pre_enable(struct drm_bridge *bridge, /* Found first bridge that does NOT * request prev to be enabled first */ - limit = list_prev_entry(next, chain_node); + limit = next; break; } } From patchwork Tue Mar 28 17:07:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 2824 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pf1-f200.google.com (mail-pf1-f200.google.com [209.85.210.200]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 9BC254147B for ; Tue, 28 Mar 2023 19:08:21 +0200 (CEST) Received: by mail-pf1-f200.google.com with SMTP id x68-20020a628647000000b0062624c52117sf6120760pfd.14 for ; Tue, 28 Mar 2023 10:08:21 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1680023300; cv=pass; d=google.com; s=arc-20160816; b=VpjvWyJzd8SHwPypARWVOC3RbFeAoRFzAeEGV+bWisIa4Cmp6Dapco1GkMRh6BDR10 HC6mt9inHtuQJX/OXDHnGE2CcOPgqZ2tYP1jFwrIV8AWwGmA02fjFHiOnxyQNEjUD4h8 rXlViVS6NBK9VP/fQK/B6X30j+endOkx0bCjgYrfA3ustz2cM9JBEGgj3qLXoYTnZHyV WyBp+qXMpPS9GUU35Y+IWlPhm6DlnXMtgVLuLJwRmcjv/m+AvDAW/x4wfke+BHK3WXnL +6CQZqEZN/Ldf9UoIGfz5cO98KEdNnildw0lqRXgllYRniACwA6edMSQEr73zN/SnktW Q+GA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=fQrZYJLcosxEaU28538TFgxab8DttZywoE8TT07kOFE=; b=kfqGZXC7LdzGb1su/Xiwy/E/x/XNnZh4PBkpk3nD+AG5j+H3kC3oVfovGtxc7GP0yE exuRx+pcynaHq4v8Oc2sW4sTE4WXGn5rUSUyb5Msy5zHE9Q1iG/EuQQPcOZxIkfHWXGt bFQ6F7n2CWkl5jNhM5OsJ4FJpAmfY5othLyhXs3u4q9ahH3y3j6bOlbrnHuYSG/ihBCz hsk+5qxNTK8vv6JaYhb7caj7TYrhlt89QvneLQM0BJMqBh3OKfqBNkivAbz+E7GyhKmK B5dFYwHYlOM5E5QEtdZJg2pWVYWB4+mIbiLPurx1GriKiiG1Vg4MArmRxVfprlz/GT9U +H1A== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=h9ybu4KV; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1680023300; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:x-original-authentication-results :x-original-sender:content-transfer-encoding:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to; bh=fQrZYJLcosxEaU28538TFgxab8DttZywoE8TT07kOFE=; b=H2eNpJPXofLulPR0fFmo6VBUk8G6oHdd4XcQ4LtQ2aDf5hyAcuDlqliv8ByUPZ6SZJ GEtpaW+Ndmq5wDiotNURepCozjVENpOMPo8bwQT0EPUQqebjMLamGlSqmQ9EYu1PGTcH GiLDDh79NMnVxZ/WWviLELAweQrjvBc2sOAdM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680023300; h=list-unsubscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=fQrZYJLcosxEaU28538TFgxab8DttZywoE8TT07kOFE=; b=ZP/fwWdxcX6jmOi6GWwXLkaamb3j5N5KBaXm2lUPuJkn5PIGw0QOpyXVKcgsaxusAD Dx18I1xHwIhsY4TTBTmFIaMoHn8U7qodIMvGZ5XBIiO6jIMeeEz6VBnXvf8+bqoscxaO fbDQ1lRmopf/Slvjva7GeXRqTBEdAei7Kjgpmg+2Esf+bURzNQVlrfFxtuNj+v0VFgrv Ki6FoqaJfwTCZ5eC68vzYp2UaEErl+dlJ4QL9ju/rdN3ajq+dz5FvZopMtJ58a0xtAEB UMOc6EvwqcD0KN0O2lCKV6OdxygWB5P74mNfv6JodTlsf9O/C6iD3yj0hBlSDWYx6zEC uWIg== X-Gm-Message-State: AAQBX9fB30tV5kgC5pQjJ/vmzezMUZvlQPI4GkvEyCISJEbCSJJ/x7xz m6GZtnQ+oZDLn0g8YeCbrIYdtqTpXs9uWQHf X-Google-Smtp-Source: AKy350YthT3wLToSBVV7szyBtyYfy+Sty0+8SroBejEIW7UZyXyuUmgtmjWiNTj0vopjz3nVLUTUog== X-Received: by 2002:a17:90b:113:b0:23b:32c0:7cc8 with SMTP id p19-20020a17090b011300b0023b32c07cc8mr4934334pjz.7.1680023300178; Tue, 28 Mar 2023 10:08:20 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:90a:62c3:b0:236:6df7:76b0 with SMTP id k3-20020a17090a62c300b002366df776b0ls11125235pjs.2.-pod-canary-gmail; Tue, 28 Mar 2023 10:08:19 -0700 (PDT) X-Received: by 2002:a17:902:f551:b0:1a0:616d:7618 with SMTP id h17-20020a170902f55100b001a0616d7618mr15974501plf.51.1680023299237; Tue, 28 Mar 2023 10:08:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680023299; cv=none; d=google.com; s=arc-20160816; b=wDOFSI5Boigskbe3YAPyQfFzs4U940gm74qmGz0Lo393R44hfQ9+pEw5yuLQ188vVt Hcoq8jCw/1JLQBD4xNPN+zm6fyhvJ/5uiY4rCSAt6Ga56enYQU//OdMZzP89rgyAxSEm a8OM24Cu0O7yJBE0VUro8jMbC1icGJx/1DgXi6P7q8SElDUBZpCjrADXJPty2qfbA9ZD W9MPay2vFflkeRZcYZIeBaO4bcHPQsOc1QYnX4zWBtKsZ5e5KwwdZ6vQkIr1NApfMqfd u21vhMlkcDph1Q6hJGxZxpPWw9+/Ztpe+CkN9ymiJjbzHjZi/dpfJLjKilJfvOCjpSF+ PEIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=qiCO4IDfxsC8fotKJWg3fnLWcorJmHZQyMnMP9mcruw=; b=q5k4HyKu9ft9q+dbFuoiA4xu647ocy/hUImuUMWrrwlnURisyOITdhjS004LFOGfK9 mrkErdXTAu4MBzK1Z9f9i2Ufql2b+Qcj+vOGjAJle/+JGDaDAodkOEqJbTeFtl93ppuE 2kK2yXgjVlKsDD3v99cr2feBMi4uOYiRA4A2oCJ1u5e5Kb9k9ot0mbZLzWgvZY7nCiVg UqMS5Xc6m2gAAfAI0pqwFpyR83ekg522mUwdRHMQ3qJ98/kMIx7zO+OgN6osM2lDzL8g hsKuRh3J1Mns6b8RWinfDV8+NGqX27mdKGxWh7z+FyCvzYy7WkrchXS62t5OwOvmUOne dSlw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=h9ybu4KV; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id y16-20020a17090322d000b0019c35405636sor12146944plg.178.2023.03.28.10.08.19 for (Google Transport Security); Tue, 28 Mar 2023 10:08:19 -0700 (PDT) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; X-Received: by 2002:a17:902:d506:b0:1a1:b172:5428 with SMTP id b6-20020a170902d50600b001a1b1725428mr20545489plg.18.1680023298915; Tue, 28 Mar 2023 10:08:18 -0700 (PDT) Received: from localhost.localdomain ([2405:201:c00a:a047:2fbc:aff5:d52a:cc2c]) by smtp.gmail.com with ESMTPSA id y17-20020a170902b49100b0019f114570b0sm20470349plr.152.2023.03.28.10.08.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Mar 2023 10:08:18 -0700 (PDT) From: Jagan Teki To: Dave Stevenson , Maarten Lankhorst , Thomas Zimmermann , David Airlie , Daniel Vetter , Andrzej Hajda , Neil Armstrong Cc: dri-devel@lists.freedesktop.org, Marek Vasut , linux-amarula , Jagan Teki Subject: [PATCH v2 2/2] drm/bridge: Document bridge init order with pre_enable_prev_first Date: Tue, 28 Mar 2023 22:37:52 +0530 Message-Id: <20230328170752.1102347-2-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230328170752.1102347-1-jagan@amarulasolutions.com> References: <20230328170752.1102347-1-jagan@amarulasolutions.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=h9ybu4KV; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , In order to satisfy the MIPI DSI initialization sequence the bridge init order has been altered with the help of pre_enable_prev_first in pre_enable and post_disable bridge operations. Document the affected bridge init order with an example on the bridge operations helpers. Signed-off-by: Jagan Teki Reviewed-by: Dave Stevenson --- Changes for v2: - add missing dri-devel in CC - prefix @ for bridge helper names drivers/gpu/drm/drm_bridge.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/gpu/drm/drm_bridge.c b/drivers/gpu/drm/drm_bridge.c index 052a8e6c9961..caf0f341e524 100644 --- a/drivers/gpu/drm/drm_bridge.c +++ b/drivers/gpu/drm/drm_bridge.c @@ -654,6 +654,13 @@ static void drm_atomic_bridge_call_post_disable(struct drm_bridge *bridge, * bridge will be called before the previous one to reverse the @pre_enable * calling direction. * + * Example: + * Bridge A ---> Bridge B ---> Bridge C ---> Bridge D ---> Bridge E + * + * With pre_enable_prev_first flag enable in Bridge B, D, E then the resulting + * @post_disable order would be, + * Bridge B, Bridge A, Bridge E, Bridge D, Bridge C. + * * Note: the bridge passed should be the one closest to the encoder */ void drm_atomic_bridge_chain_post_disable(struct drm_bridge *bridge, @@ -750,6 +757,13 @@ static void drm_atomic_bridge_call_pre_enable(struct drm_bridge *bridge, * If a bridge sets @pre_enable_prev_first, then the pre_enable for the * prev bridge will be called before pre_enable of this bridge. * + * Example: + * Bridge A ---> Bridge B ---> Bridge C ---> Bridge D ---> Bridge E + * + * With pre_enable_prev_first flag enable in Bridge B, D, E then the resulting + * @pre_enable order would be, + * Bridge C, Bridge D, Bridge E, Bridge A, Bridge B. + * * Note: the bridge passed should be the one closest to the encoder */ void drm_atomic_bridge_chain_pre_enable(struct drm_bridge *bridge,