From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 38541C433E0 for ; Wed, 3 Mar 2021 19:10:58 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (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 801C360295 for ; Wed, 3 Mar 2021 19:10:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 801C360295 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=cerno.tech Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Type: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: In-Reply-To:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Reply-To:Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date :Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=yHuBi8LU3CfOE0mfanzpJuLT8N36JsCfdCfVe68IirM=; b=bs8tIQjYz9pEED3n/nW6gDNe/ 2Y5lDDqXC1fXLB8gajUzqwgtw3VfCA5QKEGnQeAcyo0rBxfRgZ+cj4ogmOmWNdBpmvMJfkqeDwfcy /7gtGR906NotvUamH+VtxUzmwr5LM0v8J+5prlwgcdn4iZ71Ra5YnUM8q5ew2PaLMBeuJDaoPi23N QLoR8lB0Y8kTWSyr0ggulmzZZLMEi4ZF0Lrj/CLozpB5goa7AXV7UJmWZDB60lhBlBNJHj5t/1a9O v1T6ZRC/KpmHgr+/2unHa3bs/5mj39ZK0VGGLVvJD/MswCes+aKuX6jya5sTQzHDck/CvbKKhoPq2 Sbou1drDA==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lHWr3-0069BA-CL; Wed, 03 Mar 2021 19:08:18 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lHT2S-005HjL-VB for linux-arm-kernel@desiato.infradead.org; Wed, 03 Mar 2021 15:03:49 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=vuIY4u0JZta9sUcBiLwawr0TdijdW51uliU5N7yOuuo=; b=nPcvF043NefWktZPaAkr3R2+Ut KTSFL1Wlc3HdyiKg4anG7nTjNXE/7QUdHHff/xhUNKqvB/NOATjjGzleWL2NVhVfX41VAFLCS0ke/ YcczPLxjKC4crUx1+UwJUeSjgxA3k2KriqxuKrWM8UbYjTF7kQ6t4C0SyPvUZvAMOlWcgD0k+R5n0 3PL24sB8HznlBP3es7Abume1YNKxBHYt68w3pReaDizU/P0fiEml0T7rIfLq+nle11Qb8z++ZTWiD DLSoMPiKoBgygCTq1vF2fpOszrrajDI/DNNIXH0rCCmH55gaR8xNyI9fN2IXh2HcQ4emcjmUPGMmB d8WJua4g==; Received: from wout4-smtp.messagingengine.com ([64.147.123.20]) by casper.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lH7zR-00HSRh-8w for linux-arm-kernel@lists.infradead.org; Tue, 02 Mar 2021 16:35:22 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id EAC371400; Tue, 2 Mar 2021 11:35:11 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Tue, 02 Mar 2021 11:35:12 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cerno.tech; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm2; bh=vuIY4u0JZta9sUcBiLwawr0Tdij dW51uliU5N7yOuuo=; b=SiiE0UT/Jp8eV53mNX4Z66LwYb53fRTlwF9yo7exHaj GZ8l86OTUZBqhjruAgwvNtKVN1PQfqd/bgsbLY6YDnsGYAaFNguXoBRPWIMQVHqS 719AsWv/ISjB/qEG0MlUaARE45SX4f2UftonuTBclyJv7VjxbWoGdVMgp+Lgai8U BvweBfWWKzd+8IqLy9QGDKf5Y/ag+bBvH4NWr5j8kLVJRQgeyT3XaBBYok5pU3Tb QfBYCtULQnczvXOzd0CRBeLueW8c0TVyJ6hBBj5WI2bu9TD5FJZOMTAmx+dZFsI9 8CzogwGPxM3FzqXpol4R/Q2Fba2RB+iYa8n4SpIx5Vw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=vuIY4u 0JZta9sUcBiLwawr0TdijdW51uliU5N7yOuuo=; b=HTeRmuM1NDzmmBPiSK8gF3 Hry3iDJukX2IedJhmMjJpt53XgArBlWo5hbQdSRlGseyk9MSEEoqnu2oNP8sHtkW QQJOD0W1ZR+uV6jTO5o1NyjT9EakXIzCg+tffjCpgcGsDWYFANwYDgZ0wTeoRQxF Dar9H4/jCVvGC2pmyJWSdU/Ih/FRHUoQ4wIMZG2xN/odUOwReAHqNLar7uA457hq nYeeRDn96pHPd1V2T0jHyCctiArKCLPxSKcbBqNzBtfY2Tfc97gc0JpwXN7KREo/ H4xo/Xd/lW48pz5b8Xf4X0LrMfydNblIn/EY4+wEsbqJ0C7seRKNT1eoExiNPKUQ == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledruddttddgkeekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfhfgggtuggjsehgtderredttddvnecuhfhrohhmpeforgigihhm vgcutfhiphgrrhguuceomhgrgihimhgvsegtvghrnhhordhtvggthheqnecuggftrfgrth htvghrnhepleekgeehhfdutdeljefgleejffehfffgieejhffgueefhfdtveetgeehieeh gedunecukfhppeeltddrkeelrdeikedrjeeinecuvehluhhsthgvrhfuihiivgeptdenuc frrghrrghmpehmrghilhhfrhhomhepmhgrgihimhgvsegtvghrnhhordhtvggthh X-ME-Proxy: Received: from localhost (lfbn-tou-1-1502-76.w90-89.abo.wanadoo.fr [90.89.68.76]) by mail.messagingengine.com (Postfix) with ESMTPA id DA2551080066; Tue, 2 Mar 2021 11:35:07 -0500 (EST) Date: Tue, 2 Mar 2021 17:35:05 +0100 From: Maxime Ripard To: Jagan Teki Cc: Chen-Yu Tsai , Jernej Skrabec , Laurent Pinchart , dri-devel , linux-arm-kernel , linux-kernel , linux-amarula Subject: Re: [PATCH v3 6/7] drm: sun4i: dsi: Use drm_panel_bridge, connector API Message-ID: <20210302163505.2d42x364qsm26jo7@gilmour> References: <20210214194102.126146-1-jagan@amarulasolutions.com> <20210214194102.126146-7-jagan@amarulasolutions.com> <20210226165723.szblbiswz5vgapq2@hendrix> MIME-Version: 1.0 In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210302_163522_172451_9CAE584C X-CRM114-Status: GOOD ( 29.15 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: multipart/mixed; boundary="===============6053789699255712572==" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org --===============6053789699255712572== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="ub7ojtsuyl5akr4c" Content-Disposition: inline --ub7ojtsuyl5akr4c Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Feb 26, 2021 at 10:40:24PM +0530, Jagan Teki wrote: > On Fri, Feb 26, 2021 at 10:27 PM Maxime Ripard wrote: > > > > Hi, > > > > On Mon, Feb 15, 2021 at 01:11:01AM +0530, Jagan Teki wrote: > > > Use drm_panel_bridge to replace manual panel handling code. > > > > > > This simplifies the driver to allows all components in the > > > display pipeline to be treated as bridges, paving the way > > > to generic connector handling. > > > > > > Use drm_bridge_connector_init to create a connector for display > > > pipelines that use drm_bridge. > > > > > > This allows splitting connector operations across multiple bridges > > > when necessary, instead of having the last bridge in the chain > > > creating the connector and handling all connector operations > > > internally. > > > > > > Signed-off-by: Jagan Teki > > > > Most of the code removed in that patch was actually introduced earlier > > which feels a bit weird. Is there a reason we can't do that one first, > > and then introduce the bridge support? >=20 > This patch adds new bridge API's which requires the driver has to > support the bridge first. I'm not sure what you're saying, you can definitely have a bridge without support for a downstream bridge. Anyway, my point is that: > --- > Changes for v3: > - new patch > > drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c | 108 +++++++------------------ > drivers/gpu/drm/sun4i/sun6i_mipi_dsi.h | 7 -- > 2 files changed, 27 insertions(+), 88 deletions(-) > > diff --git a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c b/drivers/gpu/drm/sun= 4i/sun6i_mipi_dsi.c > index 3cdc14daf25c..5e5d3789b3df 100644 > --- a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c > +++ b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c > @@ -20,6 +20,7 @@ > #include > > #include > +#include > #include > #include > #include > @@ -769,12 +770,6 @@ static void sun6i_dsi_bridge_pre_enable(struct drm_b= ridge *bridge) > phy_set_mode(dsi->dphy, PHY_MODE_MIPI_DPHY); > phy_configure(dsi->dphy, &opts); > phy_power_on(dsi->dphy); > - > - if (dsi->panel) > - drm_panel_prepare(dsi->panel); > - > - if (dsi->panel_bridge) > - dsi->panel_bridge->funcs->pre_enable(dsi->panel_bridge); This is added in patch 2 > } > > static void sun6i_dsi_bridge_enable(struct drm_bridge *bridge) > @@ -793,12 +788,6 @@ static void sun6i_dsi_bridge_enable(struct drm_bridg= e *bridge) > * ordering on the panels I've tested it with, so I guess this > * will do for now, until that IP is better understood. > */ > - if (dsi->panel) > - drm_panel_enable(dsi->panel); > - > - if (dsi->panel_bridge) > - dsi->panel_bridge->funcs->enable(dsi->panel_bridge); > - This is added in patch 2 > sun6i_dsi_start(dsi, DSI_START_HSC); > > udelay(1000); > @@ -812,14 +801,6 @@ static void sun6i_dsi_bridge_disable(struct drm_brid= ge *bridge) > > DRM_DEBUG_DRIVER("Disabling DSI output\n"); > > - if (dsi->panel) { > - drm_panel_disable(dsi->panel); > - drm_panel_unprepare(dsi->panel); > - } else if (dsi->panel_bridge) { > - dsi->panel_bridge->funcs->disable(dsi->panel_bridge); > - dsi->panel_bridge->funcs->post_disable(dsi->panel_bridge); > - } > - This is added in patch 2 > phy_power_off(dsi->dphy); > phy_exit(dsi->dphy); > > @@ -828,63 +809,13 @@ static void sun6i_dsi_bridge_disable(struct drm_bri= dge *bridge) > regulator_disable(dsi->regulator); > } > > -static int sun6i_dsi_get_modes(struct drm_connector *connector) > -{ > - struct sun6i_dsi *dsi =3D connector_to_sun6i_dsi(connector); > - > - return drm_panel_get_modes(dsi->panel, connector); > -} > - > -static const struct drm_connector_helper_funcs sun6i_dsi_connector_helpe= r_funcs =3D { > - .get_modes =3D sun6i_dsi_get_modes, > -}; > - > -static enum drm_connector_status > -sun6i_dsi_connector_detect(struct drm_connector *connector, bool force) > -{ > - struct sun6i_dsi *dsi =3D connector_to_sun6i_dsi(connector); > - > - return dsi->panel ? connector_status_connected : > - connector_status_disconnected; > -} > - > -static const struct drm_connector_funcs sun6i_dsi_connector_funcs =3D { > - .detect =3D sun6i_dsi_connector_detect, > - .fill_modes =3D drm_helper_probe_single_connector_modes, > - .destroy =3D drm_connector_cleanup, > - .reset =3D drm_atomic_helper_connector_reset, > - .atomic_duplicate_state =3D drm_atomic_helper_connector_duplicate_state, > - .atomic_destroy_state =3D drm_atomic_helper_connector_destroy_state, > -}; > - > static int sun6i_dsi_bridge_attach(struct drm_bridge *bridge, > enum drm_bridge_attach_flags flags) > { > struct sun6i_dsi *dsi =3D bridge_to_sun6i_dsi(bridge); > - int ret; > - > - if (dsi->panel_bridge) > - return drm_bridge_attach(bridge->encoder, dsi->panel_bridge, NULL, 0); This is added in patch 2 > - if (dsi->panel) { > - drm_connector_helper_add(&dsi->connector, > - &sun6i_dsi_connector_helper_funcs); > - ret =3D drm_connector_init(bridge->dev, &dsi->connector, > - &sun6i_dsi_connector_funcs, > - DRM_MODE_CONNECTOR_DSI); > - if (ret) { > - dev_err(dsi->dev, "Couldn't initialise the DSI connector\n"); > - goto err_cleanup_connector; > - } > - > - drm_connector_attach_encoder(&dsi->connector, &dsi->encoder); > - } This has been added (through a rework) in patch 3 Surely we can do better? Maxime --ub7ojtsuyl5akr4c Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCYD5pOQAKCRDj7w1vZxhR xfVtAP9wMe7RvNvrSVuQdpWX/DrKN7q5fRUj7rXwkXAIEmLrnAD/Ss+8/iUbeEhs DnzERuMkDyrT9yxxKfbDbnnc+4hGTAc= =0UGu -----END PGP SIGNATURE----- --ub7ojtsuyl5akr4c-- --===============6053789699255712572== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel --===============6053789699255712572==--