Received: by 2002:ab2:7903:0:b0:1fb:b500:807b with SMTP id a3csp970638lqj; Mon, 3 Jun 2024 06:39:29 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWfd4jESban9+YrXdJyVjpHwBAT2IGWCh/drKrtEXiSKLyQb5/lQ1J3mZODtbHF36L7xuar6A7aTyGZbQxq6Jsgqz/ssaOSzKcmknB/1g== X-Google-Smtp-Source: AGHT+IGdwtIr5F6qr4CcNEkLzTFlct62uE8UltDSgELaU8JNE/ZCdnFhetd961Vtob60BVOEiq9I X-Received: by 2002:a81:be13:0:b0:61a:999f:e499 with SMTP id 00721157ae682-62c91d80f44mr35723287b3.22.1717421968489; Mon, 03 Jun 2024 06:39:28 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717421968; cv=pass; d=google.com; s=arc-20160816; b=oTHhpwGcYnxe/Q3a9EUw2oA/4veL85kw7wbrwDR81eX0Hdx5m1wg3XlKzrAVCq0ulS mgdJnoIhsBxfRqG0FIBMmQdJx0f5um5w9TFk4JuSm3/V0wsV97m35xy/arDWQYPnwBpb EBimpB1pzoC5wPT47BSqfGyGEV6cEXFgWVvf2D8q/p1VKE8v0Uria/auIJmpKVAwqTKB 00smKFtq1zvCdqK+NbDiSDFc48etdL7R6g5XWd1PfYOcKbN1gSU3qrMkAJUwl8tHdJRn uh580zm29WrkH9daFrmdAVUi3Bc6dqaVivjFqFxun7hb6M4CcJk3idVGOIZurErjiu4L CfWg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-id:precedence:in-reply-to :references:cc:subject:to:from:message-id:date:dkim-signature; bh=ibsbVqUCIkfY4VZsL9ao6faHOshE2uqopDLSKSRAhWU=; fh=MHEJPyrWzkJ3TKcyjVnjK7wRDFw4nGheOgW0iDA+qQ8=; b=vhUTBPdTdAQl4nRBqmqSVoeWWyA4btktFn7UlqSB9a+HOyhPycx0Y73Zoen8bBENDG VF7KIrp45P0yg0c2u8Sr/FVhDK/khhiLUpZRyYKqH+iOlltUQA3L9hfSJfgBXGaZgydF HA3BaVj/fO4QEIBbWsdrz2jQ07qKeFSIvSK0GsVte1jc/T7HQTt7gdRWN7g+CIOWKWEW bIdTgF7l1KKbSLY1/kOZLjSXXMoN116Mh9peWkVdGzPoSuDr/ESlprSYmdZE89YF+x56 FYOHyVgwfYgxCWxcKBOj2Bk4O8LLNvrLfDVoJOfgeiNZBwwf/MmBaGbOh8uzr9+T/W7k bXoQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Ama7ZkBt; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-199229-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-199229-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id af79cd13be357-794f32c2958si945838285a.747.2024.06.03.06.39.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Jun 2024 06:39:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-199229-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Ama7ZkBt; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-199229-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-199229-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 0EB2C1C21678 for ; Mon, 3 Jun 2024 13:39:28 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E0F4A12D76D; Mon, 3 Jun 2024 13:39:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Ama7ZkBt" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DE39415C3 for ; Mon, 3 Jun 2024 13:39:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717421961; cv=none; b=h5CoNedWn3USmo8LdnEmwSXh1dm1BDC5grTVozipKh57LptVlXhJJFKTM5xnFjdKtzZeKl9+d52AR0fE08f3I01J2Hx+lhkd7Rhr9z8rQezaO6oRP0pYRoee+o+8fqBboxMmPWU3J1SoN0g2OzBoxkVKJvOuWXIyl3cDTZb5ceQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717421961; c=relaxed/simple; bh=8ok/B/SKwxnEVlrKgCfgnVlO1/oDKY2C3MJSaCwQaKI=; h=Content-Type:Date:Message-Id:From:To:Subject:Cc:References: In-Reply-To; b=iZjmpnmd0DyQR9w1zg1c38aDRMYksm3/GIwzUwQqlifY1EwAOaQ7TfkPDS04L87sD+vwtrNrDqsKgVFIQNYfiUwci8PkBjVW4z9tRJMTiFpllv8BenpZvVUBArdHJMSA/LEBaX38SRJc1Uq7bp1600RDHdgzKv+sdgR5/snlpMM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Ama7ZkBt; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id D301DC2BD10; Mon, 3 Jun 2024 13:39:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717421961; bh=8ok/B/SKwxnEVlrKgCfgnVlO1/oDKY2C3MJSaCwQaKI=; h=Date:From:To:Subject:Cc:References:In-Reply-To:From; b=Ama7ZkBt8NAD6lXZL1WZXHaVHX1FXYyXteTPQgQ492yUo7Jnvdn9tXJijBJ6dgO77 71G0wWAVFOzvHxksNLpWzqkwfV5n8xzv2LoOW0CNxq6jPy/ps7DVREjV+vZF7jcbZi JwBBtLAKdZrhnwM+zVJgLFRIQMrTtL7XWx1AfpiljkJGUv3fkCUalwsm8rVn8SxwZ5 tdSdNWpTelTvyBLq8rZKmuv/UHHiW4NpV9MDkXJUxoiYF0VGPr1Vp4ATKhB++Vn9Xz HQHGqT1D18+U+a7o9t4vnm1KXAfgKPsU4tknjGmC/QWkel4vQ8nOpihi33R6LVzevz iG9GZKLMN1J6w== Content-Type: multipart/signed; boundary=cf88f22391bd096e9bbbe91854ac9cb1367c0eed60ddb60b6fffffe02fdd; micalg=pgp-sha384; protocol="application/pgp-signature" Date: Mon, 03 Jun 2024 15:39:17 +0200 Message-Id: From: "Michael Walle" To: "Dmitry Baryshkov" , "Alexander Stein" Subject: Re: [PATCH 01/20] drm/bridge: add dsi_lp11_notify mechanism Cc: "Andrzej Hajda" , "Neil Armstrong" , "Robert Foss" , "Laurent Pinchart" , "Jonas Karlman" , "Jernej Skrabec" , "Maarten Lankhorst" , "Maxime Ripard" , "Thomas Zimmermann" , "David Airlie" , "Daniel Vetter" , "Chun-Kuang Hu" , "Philipp Zabel" , "Matthias Brugger" , "AngeloGioacchino Del Regno" , "Sam Ravnborg" , "Vinay Simha BN" , "Tony Lindgren" , , "Daniel Semkowicz" , , , , "Marek Vasut" X-Mailer: aerc 0.16.0 References: <20240506-tc358775-fix-powerup-v1-0-545dcf00b8dd@kernel.org> <20240506-tc358775-fix-powerup-v1-1-545dcf00b8dd@kernel.org> <2189493.irdbgypaU6@steina-w> <577v55mspa672t2bqbwwvdtfdgtbj6mpejo3n56qk7bt2j6bt3@q54dfnupcvs4> In-Reply-To: <577v55mspa672t2bqbwwvdtfdgtbj6mpejo3n56qk7bt2j6bt3@q54dfnupcvs4> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: --cf88f22391bd096e9bbbe91854ac9cb1367c0eed60ddb60b6fffffe02fdd Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 [+ Marek ] Hi Dmitry, > > > Some bridges have very strict power-up reqirements. In this case, the > > > Toshiba TC358775. The reset has to be deasserted while *both* the DSI > > > clock and DSI data lanes are in LP-11 mode. After the reset is relase= d, > > > the bridge needs the DSI clock to actually be able to process I2C > > > access. This access will configure the DSI side of the bridge during > > > which the DSI data lanes have to be in LP-11 mode. > >=20 > > Apparently this is an issue for a lot of DSI bridges. But enabling LP-1= 1 for > > a bridge is impossible with current documentation [1], which states "A = DSI > > host should keep the PHY powered down until the pre_enable operation is > > called." > > Additionally tc358767/tc9595 (DSI-DP bridge) needs LP-11 for AUX channe= l > > access to even get EDID. This is a requirement before pre_enable would > > even be possible. > >=20 > > So some changes to the current flow are needed. But I am not so sure > > about LP-11 notification. IMHO a device request to the DSI host to > > enable LP-11 seems more sensible. > > Granted that there can be several DSI devices sharing the DSI bus (aka > split-link), I was toying with the idea of making the DSI host call > attached DSI devices when the transition happens. So almost the same, as this patch? > I don't have a fully working PoC and I probably won't have it ready til > the end of May because of the lack of time and different local > priorities. Any news regarding this? -michael > > Best regards, > > Alexander > >=20 > > [1] https://www.kernel.org/doc/html/latest/gpu/drm-kms-helpers.html#mip= i-dsi-bridge-operation > >=20 > > > After everything is > > > configured the video stream can finally be enabled. > > >=20 > > > This means: > > > (1) The bridge has to be configured completely in .pre_enable() op > > > (with the clock turned on and data lanes in LP-11 mode, thus > > > .pre_enable_prev_first has to be set). > > > (2) The bridge will enable its output in the .enable() op > > > (3) There must be some mechanism before (1) where the bridge can > > > release its reset while the clock lane is still in LP-11 mode. > > >=20 > > > Unfortunately, (3) is crucial for a correct operation of the bridge. > > > To satisfy this requriment, introduce a new callback .dsi_lp11_notify= () > > > which will be called by the DSI host driver. > > >=20 > > > Signed-off-by: Michael Walle > > > --- > > > drivers/gpu/drm/drm_bridge.c | 16 ++++++++++++++++ > > > include/drm/drm_bridge.h | 12 ++++++++++++ > > > 2 files changed, 28 insertions(+) > > >=20 > > > diff --git a/drivers/gpu/drm/drm_bridge.c b/drivers/gpu/drm/drm_bridg= e.c > > > index 28abe9aa99ca..98cd6558aecb 100644 > > > --- a/drivers/gpu/drm/drm_bridge.c > > > +++ b/drivers/gpu/drm/drm_bridge.c > > > @@ -1339,6 +1339,22 @@ void drm_bridge_hpd_notify(struct drm_bridge *= bridge, > > > } > > > EXPORT_SYMBOL_GPL(drm_bridge_hpd_notify); > > > =20 > > > +/** > > > + * drm_bridge_dsi_lp11_notify - notify clock/data lanes LP-11 mode > > > + * @bridge: bridge control structure > > > + * > > > + * DSI host drivers shall call this function while the clock and dat= a lanes > > > + * are still in LP-11 mode. > > > + * > > > + * This function shall be called in a context that can sleep. > > > + */ > > > +void drm_bridge_dsi_lp11_notify(struct drm_bridge *bridge) > > > +{ > > > + if (bridge->funcs->dsi_lp11_notify) > > > + bridge->funcs->dsi_lp11_notify(bridge); > > > +} > > > +EXPORT_SYMBOL_GPL(drm_bridge_dsi_lp11_notify); > > > + > > > #ifdef CONFIG_OF > > > /** > > > * of_drm_find_bridge - find the bridge corresponding to the device = node in > > > diff --git a/include/drm/drm_bridge.h b/include/drm/drm_bridge.h > > > index 4baca0d9107b..4ef61274e0a8 100644 > > > --- a/include/drm/drm_bridge.h > > > +++ b/include/drm/drm_bridge.h > > > @@ -630,6 +630,17 @@ struct drm_bridge_funcs { > > > */ > > > void (*hpd_disable)(struct drm_bridge *bridge); > > > =20 > > > + /** > > > + * dsi_lp11_notify: > > > + * > > > + * Will be called by the DSI host driver while both the DSI clock > > > + * lane as well as the DSI data lanes are in LP-11 mode. Some bridg= es > > > + * need this state while releasing the reset, for example. > > > + * Not all DSI host drivers will support this. Therefore, the DSI > > > + * bridge driver must not rely on this op to be called. > > > + */ > > > + void (*dsi_lp11_notify)(struct drm_bridge *bridge); > > > + > > > /** > > > * @debugfs_init: > > > * > > > @@ -898,6 +909,7 @@ void drm_bridge_hpd_enable(struct drm_bridge *bri= dge, > > > void drm_bridge_hpd_disable(struct drm_bridge *bridge); > > > void drm_bridge_hpd_notify(struct drm_bridge *bridge, > > > enum drm_connector_status status); > > > +void drm_bridge_dsi_lp11_notify(struct drm_bridge *bridge); > > > =20 > > > #ifdef CONFIG_DRM_PANEL_BRIDGE > > > bool drm_bridge_is_panel(const struct drm_bridge *bridge); > > >=20 > > >=20 > >=20 > >=20 > > --=20 > > TQ-Systems GmbH | M=C3=BChlstra=C3=9Fe 2, Gut Delling | 82229 Seefeld, = Germany > > Amtsgericht M=C3=BCnchen, HRB 105018 > > Gesch=C3=A4ftsf=C3=BChrer: Detlef Schneider, R=C3=BCdiger Stahl, Stefan= Schneider > > http://www.tq-group.com/ > >=20 > >=20 --cf88f22391bd096e9bbbe91854ac9cb1367c0eed60ddb60b6fffffe02fdd Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iKgEABMJADAWIQTIVZIcOo5wfU/AngkSJzzuPgIf+AUCZl3HhRIcbXdhbGxlQGtl cm5lbC5vcmcACgkQEic87j4CH/hJ/wGAw2m9ArER859FOX3/ufX868fxyr9c1boA J86YUXL6ZuonhsRMn8ngQOdVuJ7y6utcAYCcUCASrAqhAH+4jYUtnCXxQuLuhf2/ ihY9uYV8vOVfpkcfMsUIIB3coGCTAA4a1ug= =Dse2 -----END PGP SIGNATURE----- --cf88f22391bd096e9bbbe91854ac9cb1367c0eed60ddb60b6fffffe02fdd--