Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp289210rwd; Tue, 16 May 2023 00:44:41 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4NX+dsrqwrbbMisX2WxAVsSuZJne28t33v3JGfljHEIv0tFT+hKflZIN1dIXq84nMNeE/V X-Received: by 2002:a05:6a00:298e:b0:63c:b3be:9784 with SMTP id cj14-20020a056a00298e00b0063cb3be9784mr44905241pfb.3.1684223081218; Tue, 16 May 2023 00:44:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684223081; cv=none; d=google.com; s=arc-20160816; b=wcpzvLzxZR/Rtibmp7KTUnPPrm7yBi4/WGFEI/5Gd8JxrXrK67lbfWOgCqxy6JcrCJ kRi/n5knO8uUD4ZsKWuI+PY5Dg6b2/jIOAhFviQ64OurRhvou51ylP4KgtlfRxEhwroq 7sre0K+/gmI3pQGVLacfBKoCt2jKPJx9GJq9efwudqfGl1u9jnc5AOiVZ79ASbTrOdmb 8aspCK+hp+FYF7CViYfWS4YW/11igPwFAxA2sfLGckta9JO9FyL3NTZFzyKNmxV/pgMy 7BcTKm47h2calcVlksJimyfXet8eVkq0RQfgHwkFnZeIub79YMfvi2kFdUYOgO8+azv9 EY6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :organization:references:cc:to:content-language:subject:reply-to :from:user-agent:mime-version:date:message-id:dkim-signature; bh=/9dx6R//z1RQpkhpsooU3dvEBQ61yF1rCpRuUAhlSyU=; b=qcLlDGRAFkwjj2HKe4GvRh1WwVEH0nuyNJ2penCV8AOdtqOoLYVPFPOafd8YmHlIFs EPvFWign+YcxR0vLUj9YK85T08bgEAgsiU10EV77cZ1qUv2rjVS1j76xO4x0R0ljSUmv 7j9xebGX9oRdsEd/91ll5Zs7EO8H5Vx6WdgLkzTwBGsjC2PyP6+8l/l7ECdUqFBDtTZi peQWfJQHm8+8gxXL4odZ0EM7Qr92ZMrlXSZMj6r+SvTbASvM2ir9JoWTztdII9VdS2G6 8CmTb8GVmNrjDXwRHOQETQHwsSCPc5RduuMnnlVvqIDkkDz/VR2b3za9VxcoxrqaSW3o bf3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OzfiKpEo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g206-20020a6252d7000000b0063f032d78efsi19795705pfb.269.2023.05.16.00.44.27; Tue, 16 May 2023 00:44:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OzfiKpEo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230467AbjEPHVN (ORCPT + 99 others); Tue, 16 May 2023 03:21:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55938 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230283AbjEPHVL (ORCPT ); Tue, 16 May 2023 03:21:11 -0400 Received: from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com [IPv6:2a00:1450:4864:20::32b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8EA97421D for ; Tue, 16 May 2023 00:21:09 -0700 (PDT) Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-3f4249b7badso96887315e9.3 for ; Tue, 16 May 2023 00:21:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1684221668; x=1686813668; h=content-transfer-encoding:in-reply-to:organization:references:cc:to :content-language:subject:reply-to:from:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to; bh=/9dx6R//z1RQpkhpsooU3dvEBQ61yF1rCpRuUAhlSyU=; b=OzfiKpEokqMpwSBb7CcRlXceL550ISmoDpO+8RmxURTiv5fNOzmkePwHC+uZh11WhS 2BBL7SWGz83UnXDL2NQ7iED7vbuU/1S8hynshCBG6L9zOGpMdjs3cNr2sFH55WU2HtJi T7w5brtvR86e5HF2Qzu1PPgbCEklk8ymYSFenuC2WrFFy25qCnG/PxhVIMdUCNBfxE37 X1ZNbwSyB5yvWo1vwsRJXQzZl/ER++IA3jyWuVAV9Dnl2qKy3a9NX0FUEjZUo87ZT46l v8Y+nlHqyY8M8EfwAQ19+n5xMJnuww/kHAneWwOYKBQ7DC4FpCeFrQjrNLe3WoMLBkqG Y+yQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684221668; x=1686813668; h=content-transfer-encoding:in-reply-to:organization:references:cc:to :content-language:subject:reply-to:from:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=/9dx6R//z1RQpkhpsooU3dvEBQ61yF1rCpRuUAhlSyU=; b=eciysUCGneYDKzQSeuPfCjbyjLjf9JEDZg+fAdjv2kwZIOy0e+oJ/dE7+0c8LQsanW jnEsLl5kCkqBLlEs97GqgRxp0R03TZuHVqf5uDqZGkZVg102EJvZv2gNPrkL6zO/nSbg 5mdciZ/Er5aLMCvQtNVgHwa8gkBtccUVsH8lB3+WCaK7D8OCH0Lp1yvKtvd2Y/oY3KHm RRvFDZXjSyqUA/WvABqiefjMnjfXx4efknV41CZHQyyN/D7rMggUEC+KelVbBYyG9Zvh CwdxI1xs73nXBdAHHxmBQ8WRTW88rbEJ/vQxPUEJCsk647MEHKL2pmrXPvmwFtLJlyH1 4O/A== X-Gm-Message-State: AC+VfDwEY1zOcv5Qb8CeeG3vKzo5IOaRmWlFqjqTAQwvBDbcB6Y+r330 0i+XLKJc3i5fxLRI0yhODNzT5w== X-Received: by 2002:a05:600c:2144:b0:3f4:2438:e201 with SMTP id v4-20020a05600c214400b003f42438e201mr19423225wml.21.1684221667960; Tue, 16 May 2023 00:21:07 -0700 (PDT) Received: from ?IPV6:2a01:e0a:982:cbb0:86be:97a:a043:77a8? ([2a01:e0a:982:cbb0:86be:97a:a043:77a8]) by smtp.gmail.com with ESMTPSA id l24-20020a1ced18000000b003f4290720cbsm1259658wmh.29.2023.05.16.00.21.06 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 16 May 2023 00:21:07 -0700 (PDT) Message-ID: <305382fd-2312-59d9-e2d3-25a17e0a2158@linaro.org> Date: Tue, 16 May 2023 09:21:06 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.1 From: Neil Armstrong Reply-To: neil.armstrong@linaro.org Subject: Re: [PATCH v6 3/8] drm/bridge: mhdp8546: Add minimal format negotiation Content-Language: en-US To: Aradhya Bhatia , Tomi Valkeinen , Jyri Sarha , David Airlie , Daniel Vetter , Laurent Pinchart , Andrzej Hajda , Robert Foss , Jonas Karlman , Jernej Skrabec , Rahul T R , Swapnil Jakhade , Boris Brezillon , Francesco Dolcini Cc: DRI Development List , Linux Kernel List , Nishanth Menon , Vignesh Raghavendra , Devarsh Thakkar , Jayesh Choudhary References: <20230509093036.3303-1-a-bhatia1@ti.com> <20230509093036.3303-4-a-bhatia1@ti.com> Organization: Linaro Developer Services In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-5.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham 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 On 15/05/2023 17:59, Aradhya Bhatia wrote: > Hi Tomi, > > On 12-May-23 14:45, Tomi Valkeinen wrote: >> On 09/05/2023 12:30, Aradhya Bhatia wrote: >>> From: Nikhil Devshatwar >>> >>> With new connector model, mhdp bridge will not create the connector and >>> SoC driver will rely on format negotiation to setup the encoder format. >>> >>> Support minimal format negotiations hooks in the drm_bridge_funcs. >>> Complete format negotiation can be added based on EDID data. >>> This patch adds the minimal required support to avoid failure >>> after moving to new connector model. >>> >>> Signed-off-by: Nikhil Devshatwar >>> Reviewed-by: Tomi Valkeinen >> >> You need to add your SoB to this and the other patches. > > Okay! > >> >>> --- >>> >>> Notes: >>> >>>      changes from v1: >>>      * cosmetic fixes, commit message update. >>> >>>      changes from v5: >>>      * dropped the default_bus_format variable and directly assigned >>>        MEDIA_BUS_FMT_RGB121212_1X36 to input_fmts. >>> >>>   .../drm/bridge/cadence/cdns-mhdp8546-core.c   | 25 +++++++++++++++++++ >>>   1 file changed, 25 insertions(+) >>> >>> diff --git a/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c >>> b/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c >>> index f6822dfa3805..623e4235c94f 100644 >>> --- a/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c >>> +++ b/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c >>> @@ -2146,6 +2146,30 @@ cdns_mhdp_bridge_atomic_reset(struct drm_bridge >>> *bridge) >>>       return &cdns_mhdp_state->base; >>>   } >>>   +static u32 *cdns_mhdp_get_input_bus_fmts(struct drm_bridge *bridge, >>> +                     struct drm_bridge_state *bridge_state, >>> +                     struct drm_crtc_state *crtc_state, >>> +                     struct drm_connector_state *conn_state, >>> +                     u32 output_fmt, >>> +                     unsigned int *num_input_fmts) >>> +{ >>> +    u32 *input_fmts; >>> + >>> +    *num_input_fmts = 0; >>> + >>> +    if (output_fmt != MEDIA_BUS_FMT_FIXED) >>> +        return NULL; >> >> The tfp410 and sii902x drivers don't have the above check. Why does mhdp >> need it? Or the other way, why don't tfp410 and sii902x need it? > > I had removed this condition in order to follow status quo, from the > ITE-66121 HDMI bridge driver. > > The idea would have been to drop this for MHDP as well, but I guess I > overlooked this one. > > However... > >> I guess at the moment we always do get MEDIA_BUS_FMT_FIXED as the out >> fmt (in all three bridge drivers), don't we? > > ... I tested again to ensure that the above is indeed the case. And > ended up catching some odd behavior. > > It turns out that for all the HDMI bridges (TFP410, SII902X, ITE-66121), > the format negotiation doesn't stop at output_fmt = MEDIA_BUS_FMT_FIXED. > The {bridge}_get_input_format API gets called again with the output_fmt > = MEDIA_BUS_FMT_RGB24_1X24. > > This doesn't happen with the MHDP driver. Format negotiation with MHDP > bridge stops after one round, at output_fmt = MEDIA_BUS_FMT_FIXED. This is because the bridge negociation logic will test with all possible output formats from the chain, and won't stop at first working test. If your bridge only supports a single input format, it should return the same format whatever output_fmt is tried. So indeed remove this test on mhdp aswell, or filter out invalid output formats. The MEDIA_BUS_FMT_FIXED is when there's no output format to test, so this should be always supported. Neil > > > Regards > Aradhya