Received: by 2002:a05:7412:f589:b0:e2:908c:2ebd with SMTP id eh9csp152837rdb; Tue, 31 Oct 2023 03:54:11 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFo9bnT3lw+u0rNeSVTjqf38IlIxd+PuRARuXdd0Rgh5Jxzh7/l5x6dqs1W6xA9FWZSZDM8 X-Received: by 2002:a05:6871:813:b0:1e9:96c6:e04c with SMTP id q19-20020a056871081300b001e996c6e04cmr15370568oap.32.1698749651450; Tue, 31 Oct 2023 03:54:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698749651; cv=none; d=google.com; s=arc-20160816; b=Vo+Ad/+F/39jtXZuokdPyUg2XtH8MMmJByKIO9IGzBfhbk1NUeyDvi7R/l0H66MvN8 Owug4obPkYrc3HGDSkS24DQXNV7k5B+htAXXq9+elOCsSSPzWLd+HbHcF2YWhqNdnqbf CHoidz4GtAMMQwSVMKNevqrOsRpIlQClxQ9gLuo/UHD8aSvMJS17DD6AB0SjWpZkbGCC KmmHYafmCa4yGMR95KqSp50Cg9jFpsG+Wa+IBhxpdlPFL/FP0AgKaBaaveN45VMSO+BD Vqp1b16gl7Vp+MbeiGuOCWSMoyfLQL0N2makma/ZwnxFBiguVs86gpG3dAFMHzV/hXFO /peA== 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:autocrypt :from:references:cc:to:content-language:subject:user-agent :mime-version:date:message-id:dkim-signature; bh=ZjsZhNIXxDZClaKmo96FosQj0XSsDR5TTNCJxpts7WU=; fh=PetA0ehNEBps1XcPhuAokgJM2f+dAuh1Eq00CGbh8BU=; b=O0EbM4ztyaC42iHIc6Ixlwmri4U2S8HTEVewnBMkIrKMimDT1SBBXZ5g9vAPFATcnv lXRjZ6joNiNmz2PR/XPBnqQ9lJP47lbnhNWPcFZbkYQrkUqmEj0eraXcF4ZheXAs4f5H Ql4GgPMIEvtMqRGH87Jfy3DkkWqAzni51nf/S7GNaGNt0pqV+PdTbawDyIalopGu/nTU xL/xVCEEdp49CEyttoIN2upyOOnf/klll9db3T2JYVccvk6aPIwt9G8mmnZqG92CYO33 c9G0bQmPayeHLpXNsHxnBCQ4Zgs5ve7fDCXNu4Hq01N6w5hrvpVrNXs1oSMWisNObMFI z2Bg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=rJ5rwBhq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id s17-20020a632c11000000b005b929886d2bsi873202pgs.138.2023.10.31.03.54.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Oct 2023 03:54:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=rJ5rwBhq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 8DAF780246DA; Tue, 31 Oct 2023 03:54:08 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343996AbjJaKx7 (ORCPT + 99 others); Tue, 31 Oct 2023 06:53:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43590 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344016AbjJaKx5 (ORCPT ); Tue, 31 Oct 2023 06:53:57 -0400 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9BDC6A9 for ; Tue, 31 Oct 2023 03:53:54 -0700 (PDT) Received: from [192.168.88.20] (91-158-149-209.elisa-laajakaista.fi [91.158.149.209]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 627203D6; Tue, 31 Oct 2023 11:53:35 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1698749616; bh=DZZPLaWglZoIqGV1Xp+VII40hiGGolB8sQr47FvfpqY=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=rJ5rwBhq2hdd68ZSjKKHqb0pz4A7YkNGrT21fuAE+VKiK06jO+epT6SsvbBPkiAl9 E/PY2xWGd8f3XozGujWhT2tLOy9PG1/U2DrarpKVi8Me91XqlzoRy0VGnNxBpIvF8z imrDC29qlBUoDMlpXWAM9g9YYkBFSoijb7ffmP1c= Message-ID: <9e801f88-a15e-48f1-b103-0305c5807143@ideasonboard.com> Date: Tue, 31 Oct 2023 12:53:48 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] drm/bridge: tc358767: Support input format negotiation hook Content-Language: en-US To: Jan Kiszka , Aradhya Bhatia , Jyri Sarha , David Airlie , Daniel Vetter , Laurent Pinchart , Andrzej Hajda , Neil Armstrong , Robert Foss , Jonas Karlman , Jernej Skrabec , Maarten Lankhorst , Boris Brezillon , Maxime Ripard , Thomas Zimmermann , Francesco Dolcini , Sam Ravnborg Cc: DRI Development List , Linux Kernel List , Nishanth Menon , Vignesh Raghavendra , Devarsh Thakkar , Jayesh Choudhary , "Bajjuri, Praneeth" References: <20231030192846.27934-1-a-bhatia1@ti.com> From: Tomi Valkeinen Autocrypt: addr=tomi.valkeinen@ideasonboard.com; keydata= xsFNBE6ms0cBEACyizowecZqXfMZtnBniOieTuFdErHAUyxV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SIaQ6YMEs8WjBbpP81h7QxWIfWtp+VnwNGc6nq5IQDESH mvQcsFS7d3eGVI6eyjCFdcAO8eMAEQEAAcLBXwQYAQIACQUCTqazRwIbDAAKCRD6PaqMvJYe 9fA7EACS6exUedsBKmt4pT7nqXBcRsqm6YzT6DeCM8PWMTeaVGHiR4TnNFiT3otD5UpYQI7S suYxoTdHrrrBzdlKe5rUWpzoZkVK6p0s9OIvGzLT0lrb0HC9iNDWT3JgpYDnk4Z2mFi6tTbq xKMtpVFRA6FjviGDRsfkfoURZI51nf2RSAk/A8BEDDZ7lgJHskYoklSpwyrXhkp9FHGMaYII m9EKuUTX9JPDG2FTthCBrdsgWYPdJQvM+zscq09vFMQ9Fykbx5N8z/oFEUy3ACyPqW2oyfvU CH5WDpWBG0s5BALp1gBJPytIAd/pY/5ZdNoi0Cx3+Z7jaBFEyYJdWy1hGddpkgnMjyOfLI7B CFrdecTZbR5upjNSDvQ7RG85SnpYJTIin+SAUazAeA2nS6gTZzumgtdw8XmVXZwdBfF+ICof 92UkbYcYNbzWO/GHgsNT1WnM4sa9lwCSWH8Fw1o/3bX1VVPEsnESOfxkNdu+gAF5S6+I6n3a ueeIlwJl5CpT5l8RpoZXEOVtXYn8zzOJ7oGZYINRV9Pf8qKGLf3Dft7zKBP832I3PQjeok7F yjt+9S+KgSFSHP3Pa4E7lsSdWhSlHYNdG/czhoUkSCN09C0rEK93wxACx3vtxPLjXu6RptBw 3dRq7n+mQChEB1am0BueV1JZaBboIL0AGlSJkm23kw== In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Tue, 31 Oct 2023 03:54:08 -0700 (PDT) Hi Jan, On 31/10/2023 08:24, Jan Kiszka wrote: > On 30.10.23 20:28, Aradhya Bhatia wrote: >> With new connector model, tc358767 will not create the connector, when >> DRM_BRIDGE_ATTACH_NO_CONNECTOR is set and display-controller driver will >> rely on format negotiation to setup the encoder format. >> >> Add the missing input-format negotiation hook in the >> drm_bridge_funcs to complete DRM_BRIDGE_ATTACH_NO_CONNECTOR support. >> >> Input format is selected to MEDIA_BUS_FMT_RGB888_1X24 as default, as is >> the case with older model. >> >> Reported-by: Jan Kiszka >> Signed-off-by: Aradhya Bhatia >> --- >> >> Notes: >> >> * Since I do not have hardware with me, this was just build tested. I would >> appreciate it if someone could test and review it, especically somebody, who >> uses the bridge for DPI/DSI to eDP format conversion. >> >> * The Toshiba TC358767 bridge is not enabled in arm64 defconfig by default, >> when it should be. Hence, I sent a quick patch[0] earlier. >> >> [0]: https://lore.kernel.org/all/20231030152834.18450-1-a-bhatia1@ti.com/ >> >> drivers/gpu/drm/bridge/tc358767.c | 25 +++++++++++++++++++++++++ >> 1 file changed, 25 insertions(+) >> >> diff --git a/drivers/gpu/drm/bridge/tc358767.c b/drivers/gpu/drm/bridge/tc358767.c >> index ef2e373606ba..0affcefdeb1c 100644 >> --- a/drivers/gpu/drm/bridge/tc358767.c >> +++ b/drivers/gpu/drm/bridge/tc358767.c >> @@ -1751,6 +1751,30 @@ tc_dpi_atomic_get_input_bus_fmts(struct drm_bridge *bridge, >> return input_fmts; >> } >> >> +static u32 * >> +tc_edp_atomic_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; >> + >> + input_fmts = kcalloc(MAX_INPUT_SEL_FORMATS, sizeof(*input_fmts), >> + GFP_KERNEL); >> + if (!input_fmts) >> + return NULL; >> + >> + /* This is the DSI/DPI-end bus format */ >> + input_fmts[0] = MEDIA_BUS_FMT_RGB888_1X24; >> + *num_input_fmts = 1; >> + >> + return input_fmts; >> +} >> + >> static const struct drm_bridge_funcs tc_dpi_bridge_funcs = { >> .attach = tc_dpi_bridge_attach, >> .mode_valid = tc_dpi_mode_valid, >> @@ -1777,6 +1801,7 @@ static const struct drm_bridge_funcs tc_edp_bridge_funcs = { >> .atomic_duplicate_state = drm_atomic_helper_bridge_duplicate_state, >> .atomic_destroy_state = drm_atomic_helper_bridge_destroy_state, >> .atomic_reset = drm_atomic_helper_bridge_reset, >> + .atomic_get_input_bus_fmts = tc_edp_atomic_get_input_bus_fmts, >> }; >> >> static bool tc_readable_reg(struct device *dev, unsigned int reg) >> >> base-commit: c503e3eec382ac708ee7adf874add37b77c5d312 > > Doesn't help, callback is never invoked. There must be more missing. > > Regarding test setup: Maybe your colleague Preneeth can help to give you > access, he just received some devices from us. Otherwise, drop me > instrumentation patches. Can you try with this change: 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); } Tomi