Received: by 2002:a05:7412:f589:b0:e2:908c:2ebd with SMTP id eh9csp227484rdb; Tue, 31 Oct 2023 06:06:48 -0700 (PDT) X-Google-Smtp-Source: AGHT+IELpEYWE7gpJflg/G7iVmjItBxdRzx7XwWwrTStbYT6tjhsKtrUiByXYNosv5YZ+Mb3uhnS X-Received: by 2002:a05:6a21:9997:b0:15a:3eaa:b7ea with SMTP id ve23-20020a056a21999700b0015a3eaab7eamr17316485pzb.5.1698757607917; Tue, 31 Oct 2023 06:06:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698757607; cv=none; d=google.com; s=arc-20160816; b=sQojrf9gQ0yNQESdjzFEono+omm/Drnjl0HiQesxcbwT5/EgVc8MWQguhd9Qsx997b VvO71UPMeJm3uOC+3qSiU+Cp7ctKqfxNRXaD0X+5dNW+kvUk0jJ+WDrCX8963uyw7ARS 9KrOm6GjF2GfIsoqLS9cUfqEhdVR3k/zl3qlOogD1oxE7yn4kTDVY74i7uYndLMnrOEC S21nkA76HPPvXx23qYjpGSdJUCIGXJadF8mkQ72KDipVrBx2NvPj0SpreD3FVUOjiL27 K40fAG0E9BgcHVNgXjA6wGmnWSDqigIGdQWr4xWJ9CePx2mvTCwZ8ARR6w+UF9kJdbdN d8SA== 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=n+d1MDgBvA75JJYpJVUNnPtwe2YsYYU8t/NnVp6+EWM=; fh=PetA0ehNEBps1XcPhuAokgJM2f+dAuh1Eq00CGbh8BU=; b=JTYOlpaKr0KwA2gCEFVmRaj1A9613gXWv3oQaSQtSU2kJoafliKCVEYOZDWeo72RKu xGxQsQ5782D8bKjml6uPh+efif/8xHpzw00+ZptqZx7/hKFlbAzLCH0EZwsL2EHzecPY WkeRJRHrJ5RUxZF6xxdkuSS8j8la5VkQflm00GcIaqmRxkF3kVk01Wgf0mmjKG2lAQDl yXRonK65BzPgMGxB4G7roe9c7vFkrWPG9k2he/ONO1Ab42La05Jf+kLY7XM4hXYhr6cA aXTqGsBb7XFEurvkdFrOXwZcj7uHppzthPDaJRrLM8gPLlX93QJVD8qdrt7kvNqPoByU n9vA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=bEpLntGX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id o14-20020aa7978e000000b006b905fe37b7si978043pfp.221.2023.10.31.06.06.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Oct 2023 06:06:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=bEpLntGX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 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 9C1E18021E16; Tue, 31 Oct 2023 06:06:44 -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 S1344450AbjJaNGe (ORCPT + 99 others); Tue, 31 Oct 2023 09:06:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55846 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344447AbjJaNGd (ORCPT ); Tue, 31 Oct 2023 09:06:33 -0400 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F3CB0DA for ; Tue, 31 Oct 2023 06:06:29 -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 36E772E4; Tue, 31 Oct 2023 14:06:10 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1698757571; bh=q+8H3mFinDmNoHJJOoT2NoeqoDMN1b5RjruSx3m9kQU=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=bEpLntGXyiT5QHaeAOwT3+PJh06alhz6HzL8suk1B5uBzIBbRKKU1zZxFBihvPjkQ ZFyWuupyWAQV0besxTVD387oxQ7qEO+SuIB3OD36dyBxMMA5ueuRsFODebOHGJOkdr S0ghxsDg5gE4s+hZuC56oPDWro4t8mbacu3t4KwM= Message-ID: <47cbdb30-cbf2-4148-ad14-6dc8a1d06ba3@ideasonboard.com> Date: Tue, 31 Oct 2023 15:06:23 +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> <9e801f88-a15e-48f1-b103-0305c5807143@ideasonboard.com> <3d8af1e1-e969-4489-90dd-59de1050f39e@siemens.com> From: Tomi Valkeinen Autocrypt: addr=tomi.valkeinen@ideasonboard.com; keydata=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tHz9KsBS0DaZb 4IkLmZwEXpZcIOQjQ71fqlpiXkXSIaQ6YMEs8WjBbpP81h7QxWIfWtp+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: <3d8af1e1-e969-4489-90dd-59de1050f39e@siemens.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit 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 06:06:44 -0700 (PDT) On 31/10/2023 14:18, Jan Kiszka wrote: > On 31.10.23 11:53, Tomi Valkeinen wrote: >> 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 >> > > Yep, that does the trick. Alright, good. I'll send a proper patch. > Thanks, > Jan > > PS: Your mail client is mangling tabs - was already suspecting our > server would reformat again. Nah, the above was just a quick copy paste from my terminal window, and when copying from the terminal it's always just spaces. Tomi