From patchwork Wed Mar 29 13:19:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 2836 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pl1-f197.google.com (mail-pl1-f197.google.com [209.85.214.197]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id B05FB4147B for ; Wed, 29 Mar 2023 15:19:49 +0200 (CEST) Received: by mail-pl1-f197.google.com with SMTP id kw3-20020a170902f90300b001a274ccf620sf817087plb.8 for ; Wed, 29 Mar 2023 06:19:49 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1680095988; cv=pass; d=google.com; s=arc-20160816; b=Gnn5cVbcViSuAq7zNIJH/SPfjoCzX87WkhZCBJpMbI1i1hXWGAIGSTdH1Ubq3t0ePS AiiRFOdYzTVrMhsffBEzJyCQt5bXSAQsf7o9s8U1E6ZlddCvtOZwbHajl9QcuTmPz2R6 VfeBxsh4p5SBtlohhvn+J4Y3kqup9vbLQrxG7Zcae8YkngHMv7TGFc0rBYWTEVOM/wvq 30Nl4C2JTuaq5KzvXrqz6RqMnnwii5DQfZnw1yz0eYwaxNNglTEpOI1FMLoNPHdbI8tA 3qGtpZt/FpJ9TjA6Gwfm484b8CMRPVfJqkPqP52tDwZyvzN8ro5PYzaH6t/ZC9rubRkm SdFw== 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=p3D+WGy+NelEqfVsf1DveonTqZinQVOhuobjO16ZyIg=; b=nX5eM8RuLtz+5sfKCjD8Ova2kG+Nrc/zf6e5YMtZukvidncl7O+faPW+bTS5GRdJom 5Wl8G29Z/yC5wwUX8jaa/TDwlRlkL8fcl1IVzIIB740m283MAitUs/siDV8N2z3qrguc qvI8YgKk44MdKPrrqyX2J7J0iDoIALyPuafzwz49oOMhkXjoH/TOwD09/vM1PgaSFzQE HAu+KBtuHWgbuqhYHE6Pnx9iIqBbiIpiI+j69oEmg5iUP4LokH8RwrBi7s32UmN2Gcqs JRxewaaaUtv9q6p4QmF+fwzTKR2GRJirMtgqeyUsQYSQYXbC5VgrBJWxQg+n1kbiZwu9 vHcg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=QQ4mv0hz; 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=1680095988; 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=p3D+WGy+NelEqfVsf1DveonTqZinQVOhuobjO16ZyIg=; b=HN8x4iOgi4MBjekHxK+fbhQom7Na/V2WntaSJUFTrEtG0tKhGQJDMThY3eBlIHzCuG C4kPJ8AFhCZZFxcILJX9Sws5Hruf7/vx51SqHBj31cgrVz2/xFV5eADkqLT2YehYxSj1 lxSmcYWjv3Y2fTonXBxmByUg/TYF86dPcOaxw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680095988; 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=p3D+WGy+NelEqfVsf1DveonTqZinQVOhuobjO16ZyIg=; b=woQbIgjS+bK6aAS/uv4bpwMRkTNEJPOvCCrcSPAALGGqYl8iqn+8Udjrwjp2gf6sxK 0BLhHZpG7DqMXM9UdoiYMgCULtwYkP6dmp6/4dGIKtVQQPVrNryrP8SqvjVc0bNEV0hh YExqFU5DNu/osqyEZRmzd11tGkkt8juF+k+igu428/hPylSbncxb6Hxy11zdlMxZoKEk TwCprPJmQVYSCIRkGEmJGwsodR5N0sBsV7EabKT7Uv0Qn+RiVhKklpiUzFJ6UN4LJIKI jLgexLrtJLs2/NpEp6HxnaoWNOU3QnwZALtpYcW/gHnkdBrj+eDvruGT84wQ3LOSSYHZ Dl5g== X-Gm-Message-State: AAQBX9dSgRviVVHLG+Yw6TPrn+f5LtSqbRNAAgQjSEhfKDV9vCm7//Qd /P36PXkUXDzFxcwOxQN7fLSrxcAL X-Google-Smtp-Source: AKy350beJgk5jn0zDF1OxnP3wBDzEVvUB/I50wenyvuR+3eZ5dXAam7Ks4RQhRBUnMGNWUGUtafiQQ== X-Received: by 2002:a17:902:b195:b0:19f:3aa9:9ea1 with SMTP id s21-20020a170902b19500b0019f3aa99ea1mr7482169plr.8.1680095988499; Wed, 29 Mar 2023 06:19:48 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:90a:1992:b0:237:7ef0:5b8 with SMTP id 18-20020a17090a199200b002377ef005b8ls2188046pji.3.-pod-canary-gmail; Wed, 29 Mar 2023 06:19:47 -0700 (PDT) X-Received: by 2002:a17:902:d4ca:b0:19d:20a:a219 with SMTP id o10-20020a170902d4ca00b0019d020aa219mr23523368plg.66.1680095987450; Wed, 29 Mar 2023 06:19:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680095987; cv=none; d=google.com; s=arc-20160816; b=tPUewMffJiY2UMkKxCvUkBDpnyFuIaYR+0gm7CJJBhUohk1GlQta/VQG1vuW1ltxmj 3kfrChBi0Zn8cwUElWYLzze3YcXt6WlyVMmJmr72OnvaNExCegNvulicvhNoXbGyzjf5 0qjNI9g9cFkRMf8+zlsu3XO4fbZv4Ov8Mg5RSVZ/6S4PXCFXBGGBMIhk8P/pl3mEzy4+ 5HBtueJnc+a0XDQs5VoREUzOSl00bVKT7r0Uxw3jg33rO6kOKrAjbcrSHg7BthLSdXem h36lS282KddCTw/fLuArV22iwlCLEaAnarzajKjbMIHY8AGJrDYWAK4Rp+HRzDCRoudc JJyw== 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=u6Zop59KiDms2RJ1oWf1wfATSRqRH4OJms0tUCu66Ds=; b=snBfi/PD9WTyzuB13wubXNyZlaM2T8BXmPXpJe3sU6ccV8dnHNJxNu0JbFAia6SP6I M3QjNquRtBuJYUeVhxsZgG7Z8enHrJQ3fr4EaBYL4YmYublxca3S5t2Mc1Uatr42SW/u K/Z/408/ItwabLodiHxWPDAVYsnYi7yDFHbprobWqZH29TjuwSzcLpjm8f/Io3J+nZNy mNmIXObVEkpD9EyBGlt4JS4ZtbFEpCyReq/au0JarhH9+yDI4ItFlv3Swz8ch5wWI4kN cEAmW8aRXeiFtO0XZkKHqvVHv37sEqa+RLBg+ez7EZIhuEBnKQu7QLUhpNsX/K/mKU40 MjeQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=QQ4mv0hz; 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 n4-20020a170902e54400b001a066c17627sor13708263plf.11.2023.03.29.06.19.47 for (Google Transport Security); Wed, 29 Mar 2023 06:19: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:a17:902:d2d2:b0:1a0:6ed9:f9d0 with SMTP id n18-20020a170902d2d200b001a06ed9f9d0mr24347448plc.68.1680095987116; Wed, 29 Mar 2023 06:19:47 -0700 (PDT) Received: from localhost.localdomain ([2405:201:c00a:a047:206d:4722:c4fa:e845]) by smtp.gmail.com with ESMTPSA id d9-20020a170902854900b0019c90f8c831sm22949389plo.242.2023.03.29.06.19.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Mar 2023 06:19:46 -0700 (PDT) From: Jagan Teki To: Dave Stevenson , Maxime Ripard , Maarten Lankhorst , Thomas Zimmermann , David Airlie , Daniel Vetter , Andrzej Hajda , Neil Armstrong , Robert Foss , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Sam Ravnborg , Rob Herring , Krzysztof Kozlowski Cc: linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, devicetree@vger.kernel.org, dri-devel@lists.freedesktop.org, Marek Vasut , linux-amarula , Jagan Teki Subject: [PATCH v7 11/12] drm/bridge: Document bridge init order with enable_next_first Date: Wed, 29 Mar 2023 18:49:28 +0530 Message-Id: <20230329131929.1328612-2-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230329131929.1328612-1-jagan@amarulasolutions.com> References: <20230329131929.1328612-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=QQ4mv0hz; 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 switch HS mode properly by DSI host, the DSI sink has to send the MIPI-DCS commands first before the DSI host switches to HS mode. This behavior requires a bridge init alter in @enable and @disable function calls with the help of @enable_next_first. Document the affected bridge init order with a proper explanation. Signed-off-by: Jagan Teki --- Changes for v7: - new patch drivers/gpu/drm/drm_bridge.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/drivers/gpu/drm/drm_bridge.c b/drivers/gpu/drm/drm_bridge.c index cdc2669b3512..3c6c9937537a 100644 --- a/drivers/gpu/drm/drm_bridge.c +++ b/drivers/gpu/drm/drm_bridge.c @@ -190,6 +190,21 @@ * Ultra Low Power State (ULPS) is not explicitly supported by DRM. If * implemented, it therefore needs to be handled entirely within the DSI Host * driver. + * + * DSI sink devices typically send the MIPI-DCS commands to the DSI host via + * general MIPI_DSI_DCS read and write API. The classical DSI sequence + * mentioned that the DSI host receives MIPI-DCS commands from the DSI sink + * first in order to switch HS mode properly. Once the DSI host switches to + * HS mode any MIPI-DCS commands from the DSI sink are unfunctional. + * + * DSI sink uses the @enable function to send the MIPI-DCS commands. In a + * typical DSI host, sink pipeline the @enable call chain start with the + * DSI host, and then the DSI sink which is the "wrong" order as DSI host + * @enable is called and switched to HS mode before DSI sink @enable. If + * the DSI host enables with the @enable_next_first flag then the @enable + * for the DSI sink will be called first before the @enable of the DSI host. + * This alter bridge init order makes sure that the MIPI-DCS commands send + * first and then switch to the HS mode properly by the DSI host. */ static DEFINE_MUTEX(bridge_lock);