From patchwork Tue Mar 28 16:50:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 2821 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pl1-f198.google.com (mail-pl1-f198.google.com [209.85.214.198]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 660C4414B2 for ; Tue, 28 Mar 2023 18:51:45 +0200 (CEST) Received: by mail-pl1-f198.google.com with SMTP id u18-20020a170902e5d200b001a1d70ea3b6sf7894661plf.6 for ; Tue, 28 Mar 2023 09:51:45 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1680022304; cv=pass; d=google.com; s=arc-20160816; b=uQW+/mzldyH1kLNctDJ/1Xh9RbxczXHrL9XhFis/PqWGTnz1Uv3moL22LC+z8RC1+/ qv6xxOUh13JWvINf6bMXKBAxTMpSlwonarkiW43m3+gOzQIn8ifs1IvEd6CC0uqxwS1v 9wtCp/4IMKhHMYPZNwCb/XI0lv6VcylK1C9Gfi9I5zxBtb2bLT5C99afT5vl0jiGu/CD NJo+rAQgFC16DTvt9SYzRwC0uOHuyF6hgEhtSpoAtivo2ygjSfLJoYxLfmp9uFU1Xbk1 u+UPpMhy5ycRwxeRPGokN5vLmkuLPrF7Q2R2Gh6G39gn8FckEx4mhgUPdxDv08uh3w5X rYyQ== 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=JzRP1QwezYj3bC8PmQ/08TLmQyexxGjohwaTfVR7AXM=; b=0Sh6MVxK7ptciD0b4dS31g66jCNwGpsZZxjzzgWshlXlXpEsZBmB8s7VV4DHcbYSqD 4wUlqziJIV1sUDWT40KPMRSK0RxaFvxlQKRsWr9qbpEx6+Jc5LNlAEV0TQadTWcM/KdL coqqBOId1SpZMBdsIOiLqiPEw+O78HPMyOrTcmYoZ3Z2dKY9fqo28ZRCQTBmH1iQINHJ lw1yLzQApwZ56B01uviCoru4Ykn+9+X6Sar6Tl9vVKLqblOs0LrDxFb86oH2A+qEfB/K CBdlMBKOobh0Yea6jOs2IARyFlx6vFDjAUVlrQ8dXZa5iGSqGAyJFU0UoOsqRbFLAS4M V/Yw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=aZBXu1mi; 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=1680022304; 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=JzRP1QwezYj3bC8PmQ/08TLmQyexxGjohwaTfVR7AXM=; b=mGdhUevj4ZAlBhTK+VxjsTgYybo2gxVOFQXivVFPCbPIlxfp4F+7eSWFEmIKeTHo3L 0yU9m5znNMSfdU2gmr5CU+hvF8UMyxfze6A/rS/2FA3wCP+0Ga80f2P0rOYzHjUtj2cH hCK2zTE5WJr+9+SUpij5yoJu6L7iyqEnsqNR8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680022304; 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=JzRP1QwezYj3bC8PmQ/08TLmQyexxGjohwaTfVR7AXM=; b=JiY0hRfiDGGN4xgQcNQeWuZVFLrV+HRbqHsmaEOm5UVwU9rp3fROus1cJR+E1WowjY yuAhiagFmF3gZJrCgssWqFymW1JzXf7yR+pPDhAxDCrl4vpcdIJFB/IFq8TwLwFAabyr 0sYMWovHDUx2WKShcF89/jEpot7YlpOLhudCuCFD6BP9gXNW7+nN9EyRT0wNHIZ7a5TO 2YmK4U1Khg5B4fPvJjBxcewwB2USzyEuj6+JxHzRGF0Nzk7Rn28zEiBvfZDe6J2Rp9Ua Xy/kVLy+gk3oZtMAHcRNHB4UnKKaFcdATJlU0laSkXp50iU5MBLEHzH2e68hwIWS4q/v pphQ== X-Gm-Message-State: AAQBX9fW87jgLYKotlCkQvUvf2TW7vkEeoNxlJUrY3e1/Sj6n5vN2aed S646PRQtSUR8aZijxPb0x0/HTrfK X-Google-Smtp-Source: AKy350bdxudAKDibAoCoSHHSgd/LQtfPJqyuVRxT2nQd6jktqmp0+rUiafzzfuQRwFQoYMOhvVdKCg== X-Received: by 2002:a05:6a00:a09:b0:625:dc5b:9d1d with SMTP id p9-20020a056a000a0900b00625dc5b9d1dmr8719026pfh.0.1680022303955; Tue, 28 Mar 2023 09:51:43 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a63:2012:0:b0:503:a9:c2b8 with SMTP id g18-20020a632012000000b0050300a9c2b8ls1902140pgg.7.-pod-prod-gmail; Tue, 28 Mar 2023 09:51:43 -0700 (PDT) X-Received: by 2002:aa7:9ace:0:b0:626:248d:4ece with SMTP id x14-20020aa79ace000000b00626248d4ecemr15008190pfp.30.1680022302786; Tue, 28 Mar 2023 09:51:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680022302; cv=none; d=google.com; s=arc-20160816; b=0iBAsHzNp4ZrZKoY8pu/HjdvBgM82S+8HC68B4SuBeOioMllpLpzfDgksX1PkFp2qZ uwFrNAcgKrMpWuazdxB+md7Rdz57Uf2YfGoQxzSBXdzA3Z0ePZr1sf32QgOWLDz9CbbS hR3PTIFg3GZJifP7+4Pyh5eUsMrkHZQe2vc+tCTB3nZmbKg1lVRwigbKd76Fgxn7u+L6 CnJIwl0el4xHhXTGvrF6OSnYmrNuDDpJZg/kQ3DW4QxptmVCmbGzdzBgX8ylq0/UDpHZ BC/DrzGD42ZfneTbm9v1oHENNxuzFTNxjWQyVvRkMuSTlLkvT37N0/ilJxEZJWl/EiTk IysA== 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=y+csMJlZsqxFhr/e1f6wWRnXfPCTpSy58rS62NCEqwE=; b=Ug6ULPhr4+ok+QBxfPdKSTMPLsRIpNSy7OCjF6mIhYEP6agvMIJ+pzPPvPCIP9CSSr s01OxEmCID9Iz/AefnaEHvEwiYpqo81mm0XCe5hi9StTnHhbGhVnrSDk5dqYK6JERVvI WYiXWdn3OB1t9Ks8Eky9Gh6WAtsycKMVkZar/z7uGR4YB5+OQnjpEykPkvNJRnpaQFcj Vw58b42LGXo73j1UNybA648zZC2VWDcYL6D+5vClsmbTgKC9kp9kti1yGcIPday7qVNz zlExFzINq3Z5/84wwT212LC+6M7q1rCBYfeVcWHR9x9Iy5HE2zKuIGXLKIa2tUxRAtK4 H1Xg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=aZBXu1mi; 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 d7-20020aa78e47000000b006262684200csor13285263pfr.7.2023.03.28.09.51.42 for (Google Transport Security); Tue, 28 Mar 2023 09:51:42 -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:a62:1b12:0:b0:627:f9ac:8a33 with SMTP id b18-20020a621b12000000b00627f9ac8a33mr14166662pfb.13.1680022302308; Tue, 28 Mar 2023 09:51:42 -0700 (PDT) Received: from localhost.localdomain ([2405:201:c00a:a047:2fbc:aff5:d52a:cc2c]) by smtp.gmail.com with ESMTPSA id 15-20020aa7910f000000b0062c0cfbb264sm7583700pfh.93.2023.03.28.09.51.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Mar 2023 09:51:41 -0700 (PDT) From: Jagan Teki To: Dave Stevenson , Maarten Lankhorst , Thomas Zimmermann , David Airlie , Daniel Vetter , Andrzej Hajda , Neil Armstrong Cc: Marek Vasut , linux-amarula , Jagan Teki Subject: [PATCH 1/2] drm/bridge: Fix improper bridge init order with pre_enable_prev_first Date: Tue, 28 Mar 2023 22:20:57 +0530 Message-Id: <20230328165058.1100680-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=aZBXu1mi; 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 --- 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 16:50:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 2822 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 56ADD414B2 for ; Tue, 28 Mar 2023 18:51:49 +0200 (CEST) Received: by mail-pf1-f199.google.com with SMTP id i7-20020a626d07000000b005d29737db06sf6136235pfc.15 for ; Tue, 28 Mar 2023 09:51:49 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1680022308; cv=pass; d=google.com; s=arc-20160816; b=cl/IowlKWIOpqHFp4mBiGpyuDkyPW2mo5TVmgHftuRUZkeqqufvy+P30i7+HxQKCgl /gp9gPmQcoweEDgerNEljTfiLhQvr+6f92UFWX2/npl0ZX24NOPSCroRT4HzDb3dLZ0s +YPK62KaLrnSWhXisBgzxaYvuT8BOn3hsfaetVrpys9+1Mw2wKZBamzEYSC5WSuHEP4n GqEncCSm54RCrDn/+PW0QkJGdI6L9QySya/70wFB8v+dxBAmqOusyF8kPsA24L5NuNl7 JZHRYbyuMWql4iEhLVcqd53nXy98otJ9Qkuneq6IcoF5BGgDoPEOdLbJOtQyys8O1mJt dGdQ== 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=rhwKduWsPpqbFQk4bGzLo1icgI2IQn/HuzBgctoVAB0=; b=onD3NWIKgQhvk53Wwdp6ntJbkqUmAMGnYVuM3JA8c7VX3eTpT9PScXeoPWvD0Q8E// CakED7rgYzx/RYKSaLaBX8eCwD/sgVkJnhrMeLq3WZUl1ypOmDZY/yJtTTl0RP8yu8Fo wjTb5mGxqfwC/fy5AjeCFxDy29Z3h6mTJH/9BIsIR/bF0zofT7fGNIBW/AAdNY7BUm8X YAjbzQ+xm49xrs4Tx5oTvGnbrnObBQdohamiFTDo5gjnncYBE2mBctwSfZN3s5nDu6W6 Awb2if3w+Al0l6V8XIC4jqVNFNDnnZ++dx2CRzzv+wY3wwOVRFPbSEYC/ABFy8fXuNL7 eIzg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=YHye6rKB; 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=1680022308; 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=rhwKduWsPpqbFQk4bGzLo1icgI2IQn/HuzBgctoVAB0=; b=h/fv+CZ+WCWfUWU2dBIgdRbGZnvua7vvKrT4mctnTrDj20CIQZeWrWRv+mHq6pW5va UqFt2W/c/OamRM0pWgYGk4C289++h6rBt41gpcaPC4Riim5PXWA670Rwwx9m8NJG/muD XFioM86H0q2zVkcvjrdR/2dnAy7PNyxYPT9G0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680022308; 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=rhwKduWsPpqbFQk4bGzLo1icgI2IQn/HuzBgctoVAB0=; b=6kT5+Zotqn6xVmkfpXbVDCN2igKK/ECixdo6eNMHAOKEyTE12yY2pwU8TlrZVw+jKt 1chqn9pK6DAi8OsPvkF3jEOtETeAZcux+pG5AD1X/WrVV10iqmX3xplHK4/vHYncpKiC vCaIYbMyhfStOCQyba3UwyZrAravcS59HbLBRaDCwSsdBWpFYsoO1WbqAiL+RCLjCEJx jZZUf9GXyvLu+3iE2/thDfEMD9GrasS7Q8CVrhWjHB6mxJPi94GH5mugSWX78kTG1ALV +qcyYUt6xkCEYWbJKq3snYvdMVKndAMFbTdnYRPmVAXNT7MCrhBmmpuY5isL70aII+Hz ekyg== X-Gm-Message-State: AAQBX9cBie5gLn5NeUNh2+N6RVD5oS3wtY1Wob3My2sOeLCeXcSZOK/c FZLsqHCUP9BHuIWeh236pzM3JqCD3GUDjN41 X-Google-Smtp-Source: AKy350aUykLh7ObVDPAazr7pjb4sJu9yxBPaa3GhgWjsedXGYe6dAwnpkqXQcN/5zqI425PNRTvG9w== X-Received: by 2002:a17:90a:a594:b0:23b:353a:2e24 with SMTP id b20-20020a17090aa59400b0023b353a2e24mr4814898pjq.5.1680022307880; Tue, 28 Mar 2023 09:51:47 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:90b:3c05:b0:23c:1f9b:df20 with SMTP id pb5-20020a17090b3c0500b0023c1f9bdf20ls10833530pjb.1.-pod-control-gmail; Tue, 28 Mar 2023 09:51:47 -0700 (PDT) X-Received: by 2002:a05:6a20:4b02:b0:db:10c8:4c95 with SMTP id fp2-20020a056a204b0200b000db10c84c95mr14296150pzb.17.1680022307037; Tue, 28 Mar 2023 09:51:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680022307; cv=none; d=google.com; s=arc-20160816; b=R1yC9hTZM19ITdIb66p7DNG3dOyeC6Nf9UjEKB0amGfUjxuhOaqpG8IJ4TFMiC93ED it6A+AxCDqDq00HDMd+TMOe5rwkddF8lx+080YYTsIQ6LOrCOHs+DQdFqOAjbHMiLP/m 65E5ROTrbNLjM92Jy9mFrql/GJLLNyNnq/Kf3s/HsQFwRS61wTa/pEHflyCoCYPyC37y bhX9BxAPhrS5GSX3dWIl1q9YGA2JVAcRL0L9TVIxxsJgr6UfV4O94+h49EZTtBCXHur3 kOKmPqjXpnKk4uRfnltkGCeDUvwTyj/Tx5lxDBO1Sgcv1TylvQ4du/sQHu/WvaSNv4nH DP0Q== 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=rM1y7ajrzvJOQD0RppMz6B/F7H+zG/H/+oJOR/aaAOI=; b=iFu2mFQR1M1uBrbckxormk04IDtHW2Csog/fK5P3gqkL/hjxu6lmazYkW1sFiv4kO3 CcTcnUJLMPtCuwEkyl/s8PM2WwNUBB6sDLr2apgIINSfG7FQFLoDr7ApY7mmv41vnsTB O/FbO8nNGQaNdJSleKf3KBmoPy3FspYhLwuJ1qZBob+SOY/ewMuLqQn8mLUpT57/f2u6 QjNAGBb5OC6Ga7RCPzXfvsv7NZUBpHQ5Fee3eTxg2Z7U7X+mRDGUU2Q6RXSx2tOy1Vx2 aeWLJfL2msKbzhATlTmzr2h3lHz+vO+MX51xxtYsHRoa56HsyK26EOAhSQmclMZx6qVA OLgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=YHye6rKB; 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 e7-20020a056a00162700b005a8de206b2asor12237421pfc.67.2023.03.28.09.51.47 for (Google Transport Security); Tue, 28 Mar 2023 09:51:47 -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:aa7:942c:0:b0:627:e577:4331 with SMTP id y12-20020aa7942c000000b00627e5774331mr15225845pfo.1.1680022306677; Tue, 28 Mar 2023 09:51:46 -0700 (PDT) Received: from localhost.localdomain ([2405:201:c00a:a047:2fbc:aff5:d52a:cc2c]) by smtp.gmail.com with ESMTPSA id 15-20020aa7910f000000b0062c0cfbb264sm7583700pfh.93.2023.03.28.09.51.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Mar 2023 09:51:46 -0700 (PDT) From: Jagan Teki To: Dave Stevenson , Maarten Lankhorst , Thomas Zimmermann , David Airlie , Daniel Vetter , Andrzej Hajda , Neil Armstrong Cc: Marek Vasut , linux-amarula , Jagan Teki Subject: [PATCH 2/2] drm/bridge: Document bridge init order with pre_enable_prev_first Date: Tue, 28 Mar 2023 22:20:58 +0530 Message-Id: <20230328165058.1100680-2-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230328165058.1100680-1-jagan@amarulasolutions.com> References: <20230328165058.1100680-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=YHye6rKB; 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 --- 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..8342473f251c 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,