Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp1738448pxb; Wed, 9 Feb 2022 03:31:48 -0800 (PST) X-Google-Smtp-Source: ABdhPJwbUJd9+NaHJ6TPm732DPp23Mw79Hq+Ql4ZQwRve7zOX6+MK5XD5W6jOpGrHbOnG0XBtk/r X-Received: by 2002:a63:5d61:: with SMTP id o33mr1549867pgm.442.1644406308726; Wed, 09 Feb 2022 03:31:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644406308; cv=none; d=google.com; s=arc-20160816; b=dLF3QcbhgL7+6Ai/pB64tc41NO0YpIcpU5wGh+KEuG9/UFCVp7y7sjanYRZSAceO05 5JvFB+xi2r24pu1m+YdhbzxjCslpkY5f3Tfh2vJ2SZhgUMHXyUM5/hpgixAL9jzAfUKt YYoIEiixgDdT/dPnAoIqbZhNkH8OYMm9USziuhJj7YXI5JGvAWNnmL+/p0trbQGxHBNx OBLh7WoTOncCmOUBvAri9mQenR6MsTUQ+VywdaZ/h8p7cPDkhM34Rxq0HZxCRJxJ21nZ xObIgZ80nbrB3aO+8bwA4xyxlQSc1hRciP9BOPSwWivqSHwBSvG9XUn1Her3SxccTPqV Qd9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=EM2vplUPN3iV9HzfDItayFccDap0B5FsaXEoS2whfgY=; b=XTe/zCG25p7UFepKPamabjLNINAw7n5Q2JJVLxzA65F1RRJktGtTSBgtn42G0ByR6W RQl3xo6dL5e//5sQX21d1A4fAyvqoecQUKaVikH988uqJ6rB2kHiGnYt92P7u5hJzzlw nhXdLrv5jYFrJXGrIHBhI7n2a1Q8ReJSEbkww0g7czH0bTBfGOLUgRJyiqQ3B5LR0/Gu nHx5eyB3BVhfruBUF0Le1tEJ/ti20qhhqegoiO2sFdCb+a317noXZFv585jZhR+LQx8L y8vIi5LZdbKLWP295gh94wcII0yiVR55++toF3fzZDNLNzPB+kWo7LdVkbut7gIjrheb eSiQ== ARC-Authentication-Results: i=1; mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id d70si15793437pgc.182.2022.02.09.03.31.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Feb 2022 03:31:48 -0800 (PST) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 963E7E00ED20; Wed, 9 Feb 2022 01:52:16 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237851AbiBFVdQ (ORCPT + 99 others); Sun, 6 Feb 2022 16:33:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49066 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229765AbiBFVdP (ORCPT ); Sun, 6 Feb 2022 16:33:15 -0500 Received: from mx1.smtp.larsendata.com (mx1.smtp.larsendata.com [91.221.196.215]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D5D1EC06173B for ; Sun, 6 Feb 2022 13:33:13 -0800 (PST) Received: from mail01.mxhotel.dk (mail01.mxhotel.dk [91.221.196.236]) by mx1.smtp.larsendata.com (Halon) with ESMTPS id 87b6f5d4-8794-11ec-b20b-0050568c148b; Sun, 06 Feb 2022 21:34:14 +0000 (UTC) Received: from ravnborg.org (80-162-45-141-cable.dk.customer.tdc.net [80.162.45.141]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: sam@ravnborg.org) by mail01.mxhotel.dk (Postfix) with ESMTPSA id F280B194BAB; Sun, 6 Feb 2022 22:33:11 +0100 (CET) Date: Sun, 6 Feb 2022 22:33:09 +0100 X-Report-Abuse-To: abuse@mxhotel.dk From: Sam Ravnborg To: Neil Armstrong Cc: robert.foss@linaro.org, jernej.skrabec@gmail.com, jonas@kwiboo.se, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, kieran.bingham@ideasonboard.com, Kieran Bingham , Laurent.pinchart@ideasonboard.com, biju.das.jz@bp.renesas.com Subject: Re: [PATCH v3] drm/bridge: dw-hdmi: use safe format when first in bridge chain Message-ID: References: <20220204143337.89221-1-narmstrong@baylibre.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220204143337.89221-1-narmstrong@baylibre.com> X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Neail, On Fri, Feb 04, 2022 at 03:33:37PM +0100, Neil Armstrong wrote: > When the dw-hdmi bridge is in first place of the bridge chain, this > means there is no way to select an input format of the dw-hdmi HW > component. > > Since introduction of display-connector, negotiation was broken since > the dw-hdmi negotiation code only worked when the dw-hdmi bridge was > in last position of the bridge chain or behind another bridge also > supporting input & output format negotiation. > > Commit 7cd70656d128 ("drm/bridge: display-connector: implement bus fmts callbacks") > was introduced to make negotiation work again by making display-connector > act as a pass-through concerning input & output format negotiation. > > But in the case where the dw-hdmi is single in the bridge chain, for > example on Renesas SoCs, with the display-connector bridge the dw-hdmi > is no more single, breaking output format. I have forgotten all the details during my leave from drm, so I may miss something obvious. This fix looks like it papers over some general thingy with the format negotiation. We do not want to see the below in all display drivers, so I assume the right fix is to stuff it in somewhere in the framework. Or do I miss something? Sam > > Reported-by: Biju Das > Bisected-by: Kieran Bingham > Tested-by: Kieran Bingham > Fixes: 7cd70656d128 ("drm/bridge: display-connector: implement bus fmts callbacks"). > Signed-off-by: Neil Armstrong > Reviewed-by: Robert Foss > --- > Changes since v2: > - Add rob's r-b > - Fix invalid Fixes commit hash > > Changes since v1: > - Remove bad fix in dw_hdmi_bridge_atomic_get_input_bus_fmts > - Fix typos in commit message > > drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c > index 54d8fdad395f..97cdc61b57f6 100644 > --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c > +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c > @@ -2551,8 +2551,9 @@ static u32 *dw_hdmi_bridge_atomic_get_output_bus_fmts(struct drm_bridge *bridge, > if (!output_fmts) > return NULL; > > - /* If dw-hdmi is the only bridge, avoid negociating with ourselves */ > - if (list_is_singular(&bridge->encoder->bridge_chain)) { > + /* If dw-hdmi is the first or only bridge, avoid negociating with ourselves */ > + if (list_is_singular(&bridge->encoder->bridge_chain) || > + list_is_first(&bridge->chain_node, &bridge->encoder->bridge_chain)) { > *num_output_fmts = 1; > output_fmts[0] = MEDIA_BUS_FMT_FIXED; > > -- > 2.25.1