lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <3d8af1e1-e969-4489-90dd-59de1050f39e@siemens.com>
Date:   Tue, 31 Oct 2023 13:18:52 +0100
From:   Jan Kiszka <jan.kiszka@...mens.com>
To:     Tomi Valkeinen <tomi.valkeinen@...asonboard.com>,
        Aradhya Bhatia <a-bhatia1@...com>,
        Jyri Sarha <jyri.sarha@....fi>,
        David Airlie <airlied@...il.com>,
        Daniel Vetter <daniel@...ll.ch>,
        Laurent Pinchart <laurent.pinchart@...asonboard.com>,
        Andrzej Hajda <andrzej.hajda@...el.com>,
        Neil Armstrong <neil.armstrong@...aro.org>,
        Robert Foss <rfoss@...nel.org>,
        Jonas Karlman <jonas@...boo.se>,
        Jernej Skrabec <jernej.skrabec@...il.com>,
        Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
        Boris Brezillon <boris.brezillon@...labora.com>,
        Maxime Ripard <mripard@...nel.org>,
        Thomas Zimmermann <tzimmermann@...e.de>,
        Francesco Dolcini <francesco@...cini.it>,
        Sam Ravnborg <sam@...nborg.org>
Cc:     DRI Development List <dri-devel@...ts.freedesktop.org>,
        Linux Kernel List <linux-kernel@...r.kernel.org>,
        Nishanth Menon <nm@...com>,
        Vignesh Raghavendra <vigneshr@...com>,
        Devarsh Thakkar <devarsht@...com>,
        Jayesh Choudhary <j-choudhary@...com>,
        "Bajjuri, Praneeth" <praneeth@...com>
Subject: Re: [PATCH] drm/bridge: tc358767: Support input format negotiation
 hook

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 <jan.kiszka@...mens.com>
>>> Signed-off-by: Aradhya Bhatia <a-bhatia1@...com>
>>> ---
>>>
>>> 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.

Thanks,
Jan

PS: Your mail client is mangling tabs - was already suspecting our
server would reformat again.

-- 
Siemens AG, Technology
Linux Expert Center

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ