Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp1255502pxb; Fri, 21 Jan 2022 13:31:55 -0800 (PST) X-Google-Smtp-Source: ABdhPJwas3FhiASepoJ6W9pBCAfcNZVLzUoxF0MKhJ3KXtaO3qOmkxjjJbGwkLVmey0KVEs4vO7I X-Received: by 2002:a05:6a00:a90:b0:4bd:320a:d579 with SMTP id b16-20020a056a000a9000b004bd320ad579mr5357933pfl.47.1642800714872; Fri, 21 Jan 2022 13:31:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642800714; cv=none; d=google.com; s=arc-20160816; b=xYJsB7lXqI7GIoPane+vELPgL8jC/miyz6Sddapchy5CemZH8X2hIQhSB/sfAI/AWx fygkIIDlSOsXI8kUdR6tG++YOo+wfQtuTNEW6+3xsaYJg67QTr5/2lIBwWGxvFH7dvbe DqTTRWor2JQ1KIWZOM2Xp+wjKBYC2K2TQ9fRcQIjV5P5r6jDOcsKsBxtV001qfRu/+Vz zN7mAm7tAshN83Vj+jy0j1Dql5RRjd4SqV5T0VIl8MG/UZsj3QZByMIpFc4uamU864aQ 3Wc2m3NoPKWRWgQxlE9JEovgM8sJZl8gcQvOQs8FlkXXaPeIrQpLaE+1SLlW6sOGuWrQ j3kQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=iCGbnSIdeVbc+bdXt5zsiojMkCxV5VpYtP9a9mDjURU=; b=wgs8Z4h17X67okJEHSst3hQzdSrW5Zf/x2HeRwdG4oSTAzyoJe27TPw3OWOi3q+Zz0 8P2FgHWmnEdpB2bpgt201L3bJrjrrHpu4tTwzG+lE5J5AVQK20X/zWdIEJ5if20vWHjs UZbKwgWGOMFoaY1RXXkomIBDSSdbxkcFXmSV2PtatYtFkhJI1JRQ3JS7Cz7YS4+ewy4+ +wQa1H6E4TA9iC9QlmZhiC4IKEtoq3X6hU7h4Kh8Fuwpa9skCM9E2GG/WUzEOwxWXx6o uyqY6AmbaYtskaYnaWb0SUyQ1MbetE3wgWwdX7oLnuWM82kI4h3Bv9qe2rZwuBA4qRkn HRfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=FT7qC5sP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id kx1si6524474pjb.28.2022.01.21.13.31.42; Fri, 21 Jan 2022 13:31:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=FT7qC5sP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230311AbiATLPH (ORCPT + 99 others); Thu, 20 Jan 2022 06:15:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43612 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230268AbiATLPC (ORCPT ); Thu, 20 Jan 2022 06:15:02 -0500 Received: from mail-ed1-x536.google.com (mail-ed1-x536.google.com [IPv6:2a00:1450:4864:20::536]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 83F1CC061574 for ; Thu, 20 Jan 2022 03:15:02 -0800 (PST) Received: by mail-ed1-x536.google.com with SMTP id m11so27022584edi.13 for ; Thu, 20 Jan 2022 03:15:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=iCGbnSIdeVbc+bdXt5zsiojMkCxV5VpYtP9a9mDjURU=; b=FT7qC5sPu+G1OIfrLGzhNGP+P1cPEnYbuJkYByoReQfid0NZ7HxsgC9qC2YGLtgdHp C2p7aktVbPdVexnAAX9rTbxTVDCIOyMc7PaesN3OWvw9LET1QlycXuzgU5P3f+Hs44wR gsZhHmatoEmOwZ46sMLQdUM3vzmMe3Mxkhk8A= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=iCGbnSIdeVbc+bdXt5zsiojMkCxV5VpYtP9a9mDjURU=; b=jMsOY1ZEE9DFyA3Zy7H5m6U87SFviO/ZPJ6NR5WYDj4sLy38k/cP1LhzJ0dR/+Ipl1 aLIG5ezBLaoTHlina8fDqwqyRbLpOzFcT0ZlIh9sT3f5OOnFg0R5A9hFGGpBljCO7tti bBmYwPNTlo6CQHJbknHoruf4rmctD54+HqTYUZd4g4xVd4zdGxBp9TnnQ8BK0NByrX/7 hGEq09YWM1u+HlyDmZ8zaYQet3TGIoo1kYSev3yzG2EOpnQOnu8JHo48DbnC0EdeK4Of plbqyQheMaZ/wPGrf8hziN8UKLD7zJcHPjuCLPmwNuDqhEVlF3ra5YmhkSe/r7uK9BBo CDXQ== X-Gm-Message-State: AOAM532LWQfYPqxPC6SgVqJN/068zVzhfXLcqACNT3tKwpCH2DAnVdYQ UB4jhbvGT1YpvkMM86yooMvmJWvTYMqUa9rvff3oZQ== X-Received: by 2002:a05:6402:4244:: with SMTP id g4mr12693422edb.271.1642677301085; Thu, 20 Jan 2022 03:15:01 -0800 (PST) MIME-Version: 1.0 References: <20220119122843.1455611-1-narmstrong@baylibre.com> In-Reply-To: <20220119122843.1455611-1-narmstrong@baylibre.com> From: Jagan Teki Date: Thu, 20 Jan 2022 16:44:50 +0530 Message-ID: Subject: Re: [PATCH v2] drm/bridge: dw-hdmi: use safe format when first in bridge chain 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 Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 19, 2022 at 5:58 PM 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 0656d1285b79 ("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. > > Reported-by: Biju Das > Bisected-by: Kieran Bingham > Tested-by: Kieran Bingham > Fixes: 0656d1285b79 ("drm/bridge: display-connector: implement bus fmts callbacks"). > Signed-off-by: Neil Armstrong > --- > 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)) { What if we use bridge helper, drm_bridge_chain_get_first_bridge in order to find the first bridge in chain? Thanks, Jagan.