Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp844622pxb; Wed, 6 Apr 2022 01:39:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz86N/A3pZXc3oVxGhTNHXYZxIv/cvJno8a3pjKPHmb227eGcM74EEa6ecBwSSNR59FY421 X-Received: by 2002:a17:902:da88:b0:156:2b13:81c5 with SMTP id j8-20020a170902da8800b001562b1381c5mr7517641plx.138.1649234364549; Wed, 06 Apr 2022 01:39:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649234364; cv=none; d=google.com; s=arc-20160816; b=Do4RggYry74H+4jBP1l25C/o53q0dY2mahJAZhs+dBtON7/CAT2Cx/9CuDMBzEM4r9 Y0x6X3v73Dv8xJIsaY9fJ2yx/EdtW51pZUZoajLccQLJC2I5xYfoQZA7brvQz3oGaDLv O54RQfhMCV3DWqdwI2/9ly0xOPp5qPMcuyBHBmpEYSlI5DjOog5iDZ1PCyOsuITGvI/J uUI+FH4wgk7Gm82HX42BEzXcj2Hd5RfoiyOZmBwg94ApN6IjM5lltCNXX6RCRYDnuGIv F1x3HuIPEyRMup7GfJa2DN1hzysLKj69/CxxdWgJLerfdDdxZV/ne+P0+sDBr3+RDLx9 DNVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=aoCiTsUbHaOHLfENQqh4JrRgIzkEzL0VmL1JBruUeVk=; b=kArwTjfRXZoifBUmHlQinh90IfbIJ3T3oCX2TJFZ+3GLIZ7mE0+LTtBJxQlzsJS4c2 WoZW9WEwmPdHZU+cXTIKgGDwFbYRmIETHT6mlQOeyniU7zlmAmSgkWPhDAishML0KISS neR4w0B88MSjlMzXbcidyCngemTi8Jzi9PXx84Jsr2NAg4GhnLTmv9mJyLmGvZdI3kxO 6f1AXjHwHjx+LuYHXY3T/8z6aZqOxA0Hfv9AyEEZaEjGJWmLbjHtJPrwIBF03AEGsRUI zBJA7Dnko7LOY71jHjE8nQqSOoYhyEtytPw8gvLGPnbspXigpzA7qiMS8MOFcASUiF7t RkKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=PTmxC0P8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id s12-20020a170902ea0c00b00156a039ea93si8693692plg.222.2022.04.06.01.39.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 01:39:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=PTmxC0P8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 7AD0857575A; Wed, 6 Apr 2022 01:26:13 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1379830AbiDEUyL (ORCPT + 99 others); Tue, 5 Apr 2022 16:54:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39730 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230042AbiDEJsy (ORCPT ); Tue, 5 Apr 2022 05:48:54 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 96335DF35; Tue, 5 Apr 2022 02:38:57 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 3E093B818F3; Tue, 5 Apr 2022 09:38:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 82CC5C385A2; Tue, 5 Apr 2022 09:38:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649151534; bh=FEhFHiceQxymASY0Cnhc+plWks288D4lT8BKESj8hAc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PTmxC0P8LrGBEpQvyTQ6xgNIiMY8N8we4Sahk7urP1E1dA7A5iM6leXUge7Jn8VC+ uMBkneddj2u4GiWixjSVTXk6rLbVZ3g7SDbCj4uF79QkdPLF+xnQKESgckZFyLPiW4 5SNmgeGW55TCMWmW9sJquUNovCvEE4DL/qj6RKj4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Biju Das , Kieran Bingham , Neil Armstrong , Robert Foss , Sasha Levin Subject: [PATCH 5.15 449/913] drm/bridge: dw-hdmi: use safe format when first in bridge chain Date: Tue, 5 Apr 2022 09:25:11 +0200 Message-Id: <20220405070353.306917779@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070339.801210740@linuxfoundation.org> References: <20220405070339.801210740@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,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 From: Neil Armstrong [ Upstream commit 1528038385c0a706aac9ac165eeb24044fef6825 ] 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. Reported-by: Biju Das Bisected-by: Kieran Bingham Tested-by: Kieran Bingham Fixes: 6c3c719936da ("drm/bridge: synopsys: dw-hdmi: add bus format negociation") Signed-off-by: Neil Armstrong [narmstrong: add proper fixes commit] Reviewed-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20220204143337.89221-1-narmstrong@baylibre.com Signed-off-by: Sasha Levin --- 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 e1211a5b334b..25d58dcfc87e 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.34.1