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=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable 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 138ACC433E0 for ; Fri, 26 Mar 2021 01:08:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E12ED61A2B for ; Fri, 26 Mar 2021 01:08:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230044AbhCZBHl (ORCPT ); Thu, 25 Mar 2021 21:07:41 -0400 Received: from perceval.ideasonboard.com ([213.167.242.64]:60814 "EHLO perceval.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230006AbhCZBHf (ORCPT ); Thu, 25 Mar 2021 21:07:35 -0400 Received: from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi [62.78.145.57]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 3A104443; Fri, 26 Mar 2021 02:07:34 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1616720854; bh=y74YFIeevRlwE5RBrGfsHg2CMgmPqzDERAKQwOXXbc0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ZyDBfJBQsNXY9WijS1gOvie5Oh77sykQAXa+bjfobuMfwy7swT/SFr+vRoAhWqbeE q3XKBxVndZctpeIM6HBbGsJ75q9w1KOTvWlCEYWQEK5fW/pltovSyq4v98NBPkegKa fP6pJpg5I4VkfeNr3i3OeYLLGreDDIfoZkJrtPaU= Date: Fri, 26 Mar 2021 03:06:51 +0200 From: Laurent Pinchart To: Doug Anderson Cc: dri-devel , linux-renesas-soc@vger.kernel.org, Andrzej Hajda , Neil Armstrong , Jonas Karlman , Jernej Skrabec , Stephen Boyd Subject: Re: [RFC PATCH 05/11] drm/bridge: ti-sn65dsi86: Wrap panel with panel-bridge Message-ID: References: <20210322030128.2283-1-laurent.pinchart+renesas@ideasonboard.com> <20210322030128.2283-6-laurent.pinchart+renesas@ideasonboard.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org Hi Doug, On Wed, Mar 24, 2021 at 03:44:39PM -0700, Doug Anderson wrote: > On Sun, Mar 21, 2021 at 8:02 PM Laurent Pinchart wrote: > > > > To simplify interfacing with the panel, wrap it in a panel-bridge and > > let the DRM bridge helpers handle chaining of operations. > > > > This also prepares for support of DRM_BRIDGE_ATTACH_NO_CONNECTOR, which > > requires all components in the display pipeline to be represented by > > bridges. > > > > Signed-off-by: Laurent Pinchart > > --- > > drivers/gpu/drm/bridge/ti-sn65dsi86.c | 30 +++++++++++++++++++-------- > > 1 file changed, 21 insertions(+), 9 deletions(-) > > > > diff --git a/drivers/gpu/drm/bridge/ti-sn65dsi86.c b/drivers/gpu/drm/bridge/ti-sn65dsi86.c > > index 1d1be791d5ba..c21a7f7d452b 100644 > > --- a/drivers/gpu/drm/bridge/ti-sn65dsi86.c > > +++ b/drivers/gpu/drm/bridge/ti-sn65dsi86.c > > @@ -124,6 +124,7 @@ > > * @edid: Detected EDID of eDP panel. > > * @refclk: Our reference clock. > > * @panel: Our panel. > > + * @next_bridge: The next bridge. > > To make it easier for folks who don't work with DRM all day, could you > somehow clarify which direction "next" is talking about. AKA the next > "outward" (towards the sink) or the next "inward" (toward the source)? Sure, I'll expand the comment. > > * @enable_gpio: The GPIO we toggle to enable the bridge. > > * @supplies: Data for bulk enabling/disabling our regulators. > > * @dp_lanes: Count of dp_lanes we're using. > > @@ -152,6 +153,7 @@ struct ti_sn_bridge { > > struct mipi_dsi_device *dsi; > > struct clk *refclk; > > struct drm_panel *panel; > > + struct drm_bridge *next_bridge; > > There's no reason to store the "panel" pointer anymore, right? It can > just be a local variable in probe? Good point, I'll fix that. > > @@ -850,8 +856,6 @@ static void ti_sn_bridge_pre_enable(struct drm_bridge *bridge) > > */ > > regmap_update_bits(pdata->regmap, SN_HPD_DISABLE_REG, HPD_DISABLE, > > HPD_DISABLE); > > - > > - drm_panel_prepare(pdata->panel); > > Ugh, I guess conflicts with my EDID patch [1] which assumes that this > function will directly turn the panel on. I'll see if I can find some > solution... > > [1] https://lore.kernel.org/r/20210304155144.3.I60a7fb23ce4589006bc95c64ab8d15c74b876e68@changeid/ Would using the drm_bridge_connector help ? It's a helper that creates a connector based on a chain of bridges. It implements the .get_modes() connector operation (see drm_bridge_connector_get_modes()), based on the .get_edid() operation provided by the bridges. As it has a full view of the chain, it could enable bridges prior to reading the EDID, and then power them off, including the panel-bridge. -- Regards, Laurent Pinchart 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.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,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 300CAC433DB for ; Fri, 26 Mar 2021 01:07:38 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 E2558619E8 for ; Fri, 26 Mar 2021 01:07:37 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E2558619E8 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ideasonboard.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3DEEB6E11E; Fri, 26 Mar 2021 01:07:37 +0000 (UTC) Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by gabe.freedesktop.org (Postfix) with ESMTPS id D4B196E11E for ; Fri, 26 Mar 2021 01:07:35 +0000 (UTC) Received: from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi [62.78.145.57]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 3A104443; Fri, 26 Mar 2021 02:07:34 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1616720854; bh=y74YFIeevRlwE5RBrGfsHg2CMgmPqzDERAKQwOXXbc0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ZyDBfJBQsNXY9WijS1gOvie5Oh77sykQAXa+bjfobuMfwy7swT/SFr+vRoAhWqbeE q3XKBxVndZctpeIM6HBbGsJ75q9w1KOTvWlCEYWQEK5fW/pltovSyq4v98NBPkegKa fP6pJpg5I4VkfeNr3i3OeYLLGreDDIfoZkJrtPaU= Date: Fri, 26 Mar 2021 03:06:51 +0200 From: Laurent Pinchart To: Doug Anderson Subject: Re: [RFC PATCH 05/11] drm/bridge: ti-sn65dsi86: Wrap panel with panel-bridge Message-ID: References: <20210322030128.2283-1-laurent.pinchart+renesas@ideasonboard.com> <20210322030128.2283-6-laurent.pinchart+renesas@ideasonboard.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jernej Skrabec , Jonas Karlman , Neil Armstrong , dri-devel , Stephen Boyd , linux-renesas-soc@vger.kernel.org, Andrzej Hajda Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Hi Doug, On Wed, Mar 24, 2021 at 03:44:39PM -0700, Doug Anderson wrote: > On Sun, Mar 21, 2021 at 8:02 PM Laurent Pinchart wrote: > > > > To simplify interfacing with the panel, wrap it in a panel-bridge and > > let the DRM bridge helpers handle chaining of operations. > > > > This also prepares for support of DRM_BRIDGE_ATTACH_NO_CONNECTOR, which > > requires all components in the display pipeline to be represented by > > bridges. > > > > Signed-off-by: Laurent Pinchart > > --- > > drivers/gpu/drm/bridge/ti-sn65dsi86.c | 30 +++++++++++++++++++-------- > > 1 file changed, 21 insertions(+), 9 deletions(-) > > > > diff --git a/drivers/gpu/drm/bridge/ti-sn65dsi86.c b/drivers/gpu/drm/bridge/ti-sn65dsi86.c > > index 1d1be791d5ba..c21a7f7d452b 100644 > > --- a/drivers/gpu/drm/bridge/ti-sn65dsi86.c > > +++ b/drivers/gpu/drm/bridge/ti-sn65dsi86.c > > @@ -124,6 +124,7 @@ > > * @edid: Detected EDID of eDP panel. > > * @refclk: Our reference clock. > > * @panel: Our panel. > > + * @next_bridge: The next bridge. > > To make it easier for folks who don't work with DRM all day, could you > somehow clarify which direction "next" is talking about. AKA the next > "outward" (towards the sink) or the next "inward" (toward the source)? Sure, I'll expand the comment. > > * @enable_gpio: The GPIO we toggle to enable the bridge. > > * @supplies: Data for bulk enabling/disabling our regulators. > > * @dp_lanes: Count of dp_lanes we're using. > > @@ -152,6 +153,7 @@ struct ti_sn_bridge { > > struct mipi_dsi_device *dsi; > > struct clk *refclk; > > struct drm_panel *panel; > > + struct drm_bridge *next_bridge; > > There's no reason to store the "panel" pointer anymore, right? It can > just be a local variable in probe? Good point, I'll fix that. > > @@ -850,8 +856,6 @@ static void ti_sn_bridge_pre_enable(struct drm_bridge *bridge) > > */ > > regmap_update_bits(pdata->regmap, SN_HPD_DISABLE_REG, HPD_DISABLE, > > HPD_DISABLE); > > - > > - drm_panel_prepare(pdata->panel); > > Ugh, I guess conflicts with my EDID patch [1] which assumes that this > function will directly turn the panel on. I'll see if I can find some > solution... > > [1] https://lore.kernel.org/r/20210304155144.3.I60a7fb23ce4589006bc95c64ab8d15c74b876e68@changeid/ Would using the drm_bridge_connector help ? It's a helper that creates a connector based on a chain of bridges. It implements the .get_modes() connector operation (see drm_bridge_connector_get_modes()), based on the .get_edid() operation provided by the bridges. As it has a full view of the chain, it could enable bridges prior to reading the EDID, and then power them off, including the panel-bridge. -- Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel