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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AAF89C4332F for ; Tue, 31 Oct 2023 18:15:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236233AbjJaSPy (ORCPT ); Tue, 31 Oct 2023 14:15:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55332 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344909AbjJaQDg (ORCPT ); Tue, 31 Oct 2023 12:03:36 -0400 Received: from lelv0143.ext.ti.com (lelv0143.ext.ti.com [198.47.23.248]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5A30E8F for ; Tue, 31 Oct 2023 09:03:32 -0700 (PDT) Received: from lelv0266.itg.ti.com ([10.180.67.225]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id 39VG31fm016531; Tue, 31 Oct 2023 11:03:01 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1698768181; bh=d6XCKoIX+3E3TBFJdEYzPt7lI+PEkS1xWwCznuSQDKE=; h=Date:Subject:To:CC:References:From:In-Reply-To; b=UFmdfjm6Gj8t/1emNUaYxJZf+UCy8IWYrgPnG8RGmVweNfVz/xUs0XLlknY4mFw5z 7cdEccnOoYSimkxg/hJRybPeZhc+XuxHPR/mJs2018VQ4Pwq0yJTmAaufWR0GJTd0w wDPYySna7tM1Hdv56IEJxr1DcQ6zNG9yIS+v+7/E= Received: from DFLE107.ent.ti.com (dfle107.ent.ti.com [10.64.6.28]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 39VG31an079771 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 31 Oct 2023 11:03:01 -0500 Received: from DFLE112.ent.ti.com (10.64.6.33) by DFLE107.ent.ti.com (10.64.6.28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Tue, 31 Oct 2023 11:03:01 -0500 Received: from fllv0039.itg.ti.com (10.64.41.19) by DFLE112.ent.ti.com (10.64.6.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23 via Frontend Transport; Tue, 31 Oct 2023 11:03:01 -0500 Received: from [10.249.132.69] (ileaxei01-snat2.itg.ti.com [10.180.69.6]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id 39VG2p9X103201; Tue, 31 Oct 2023 11:02:52 -0500 Message-ID: Date: Tue, 31 Oct 2023 21:32:51 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Subject: Re: [PATCH 2/2] drm/bridge: tc358767: Fix link properties discovery Content-Language: en-US To: Tomi Valkeinen , Jan Kiszka , Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter CC: , References: <20231031-tc358767-v1-0-392081ad9f4b@ideasonboard.com> <20231031-tc358767-v1-2-392081ad9f4b@ideasonboard.com> From: Aradhya Bhatia In-Reply-To: <20231031-tc358767-v1-2-392081ad9f4b@ideasonboard.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 31-Oct-23 18:56, Tomi Valkeinen wrote: > When a display controller driver uses DRM_BRIDGE_ATTACH_NO_CONNECTOR, > tc358767 will behave properly and skip the creation of the connector. > > However, tc_get_display_props(), which is used to find out about the DP > monitor and link, is only called from two places: .atomic_enable() and > tc_connector_get_modes(). The latter is only used when tc358767 creates > its own connector, i.e. when DRM_BRIDGE_ATTACH_NO_CONNECTOR is _not_ > set. > > Thus, the driver never finds out the link properties before get_edid() > is called. With num_lanes of 0 and link_rate of 0 there are not many > valid modes... > > Fix this by adding tc_connector_get_modes() call at the beginning of > get_edid(), so that we have up to date information before looking at the > modes. > > Reported-by: Jan Kiszka > Closes: https://lore.kernel.org/all/24282420-b4dd-45b3-bb1c-fc37fe4a8205@siemens.com/ > Signed-off-by: Tomi Valkeinen > --- Thank you, Tomi, for quickly debugging this! Reviewed-by: Aradhya Bhatia Regards Aradhya > drivers/gpu/drm/bridge/tc358767.c | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/drivers/gpu/drm/bridge/tc358767.c b/drivers/gpu/drm/bridge/tc358767.c > index 0affcefdeb1c..137a9f5e3cad 100644 > --- a/drivers/gpu/drm/bridge/tc358767.c > +++ b/drivers/gpu/drm/bridge/tc358767.c > @@ -1579,6 +1579,13 @@ static struct edid *tc_get_edid(struct drm_bridge *bridge, > struct drm_connector *connector) > { > struct tc_data *tc = bridge_to_tc(bridge); > + int ret; > + > + ret = tc_get_display_props(tc); > + if (ret < 0) { > + dev_err(tc->dev, "failed to read display props: %d\n", ret); > + return 0; > + } > > return drm_get_edid(connector, &tc->aux.ddc); > } >