Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Sebastian Reichel" <sebastian.reichel@collabora.com>
Cc: dri-devel@lists.freedesktop.org, conor+dt@kernel.org,
	robh@kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH v5 05/15] drm/bridge: synopsys: dw-dp: Support MEDIA_BUS_FMT_FIXED
Date: Thu, 23 Jul 2026 22:31:21 +0000	[thread overview]
Message-ID: <20260723223121.ED0AB1F0155C@smtp.kernel.org> (raw)
In-Reply-To: <20260724-synopsys-dw-dp-improvements-v5-5-9445c2e87441@collabora.com>

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [High] dw_dp_bridge_atomic_check ignores the negotiated input bus format when the output format is MEDIA_BUS_FMT_FIXED, forcing the highest-bandwidth format instead.
- [Low] OOM condition masked as -EINVAL instead of -ENOMEM in dw_dp_bridge_atomic_check.
--

--- Patch [5]: [PATCH v5 05/15] drm/bridge: synopsys: dw-dp: Support MEDIA_BUS_FMT_FIXED ---
commit 22a7a7c58c5ed8233a59740b01dc41f49ab3cdc8
Author: Sebastian Reichel <sebastian.reichel@collabora.com>

drm/bridge: synopsys: dw-dp: Support MEDIA_BUS_FMT_FIXED

This patch adds support for MEDIA_BUS_FMT_FIXED to the Synopsys DW-DP bridge.
It updates atomic_check to resolve MEDIA_BUS_FMT_FIXED by selecting the first
bandwidth-filtered output format, and implements a custom
atomic_get_input_bus_fmts hook to advertise all supported formats for upstream
negotiation.

> diff --git a/drivers/gpu/drm/bridge/synopsys/dw-dp.c b/drivers/gpu/drm/bridge/synopsys/dw-dp.c
> index 3dec7777fb285..812c67fdfb6b8 100644
> --- a/drivers/gpu/drm/bridge/synopsys/dw-dp.c
> +++ b/drivers/gpu/drm/bridge/synopsys/dw-dp.c
> @@ -1586,7 +1587,25 @@ static int dw_dp_bridge_atomic_check(struct drm_bridge *bridge,
>  	state = to_dw_dp_bridge_state(bridge_state);
>  	mode = &state->mode;
>  
> -	fmt = dw_dp_get_output_format(bridge_state->output_bus_cfg.format);
> +	if (out_bus_format == MEDIA_BUS_FMT_FIXED) {
> +		unsigned int num_fmts = 0;
> +		u32 *fmts;
> +
> +		fmts = dw_dp_bridge_atomic_get_output_bus_fmts(bridge,
> +							       bridge_state,
> +							       crtc_state,
> +							       conn_state,
> +							       &num_fmts);
> +		if (!num_fmts) {
> +			kfree(fmts);
> +			return -EINVAL;

[Severity: Low]
Does this mask an out-of-memory condition? 

If dw_dp_bridge_atomic_get_output_bus_fmts() fails to allocate memory via
kcalloc(), it returns NULL and sets num_fmts to 0. Returning -EINVAL here
obscures the actual -ENOMEM error.

> +		}
> +
> +		out_bus_format = fmts[0];

[Severity: High]
Does this unconditionally override the successfully negotiated input format?

If the upstream element negotiated a format other than fmts[0] (which would
be stored in bridge_state->input_bus_cfg.format), won't forcing fmts[0] here
cause a format mismatch between the hardware and the upstream encoder?

> +		kfree(fmts);
> +	}
> +
> +	fmt = dw_dp_get_output_format(out_bus_format);
>  	if (!fmt)
>  		return -EINVAL;

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260724-synopsys-dw-dp-improvements-v5-0-9445c2e87441@collabora.com?part=5

  reply	other threads:[~2026-07-23 22:31 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-23 22:17 [PATCH v5 00/15] Synopsys DisplayPort Controller improvements for Rockchip platforms Sebastian Reichel
2026-07-23 22:17 ` [PATCH v5 01/15] drm/bridge: synopsys: dw-dp: Fix incorrect resource lifetimes in bind callback Sebastian Reichel
2026-07-23 22:34   ` sashiko-bot
2026-07-23 22:17 ` [PATCH v5 02/15] drm/bridge: synopsys: dw-dp: Cancel pending HPD work on unbind Sebastian Reichel
2026-07-23 22:32   ` sashiko-bot
2026-07-23 22:17 ` [PATCH v5 03/15] drm/bridge: synopsys: dw-dp: Add missing mutex cleanups on module removal Sebastian Reichel
2026-07-23 22:48   ` sashiko-bot
2026-07-23 22:17 ` [PATCH v5 04/15] drm/bridge: synopsys: dw-dp: Move dw_dp_bridge_atomic_get_output_bus_fmts() Sebastian Reichel
2026-07-23 22:28   ` sashiko-bot
2026-07-23 22:17 ` [PATCH v5 05/15] drm/bridge: synopsys: dw-dp: Support MEDIA_BUS_FMT_FIXED Sebastian Reichel
2026-07-23 22:31   ` sashiko-bot [this message]
2026-07-23 22:17 ` [PATCH v5 06/15] drm/bridge: synopsys: dw-dp: Add follow-up bridge support Sebastian Reichel
2026-07-23 22:17 ` [PATCH v5 07/15] drm/bridge: Add out-of-band HPD notify handler Sebastian Reichel
2026-07-23 22:17 ` [PATCH v5 08/15] drm/bridge: synopsys: dw-dp: Support software triggered OOB HPD Sebastian Reichel
2026-07-23 22:17 ` [PATCH v5 09/15] drm/rockchip: dw_dp: Implement out-of-band HPD handling Sebastian Reichel
2026-07-23 22:34   ` sashiko-bot
2026-07-23 22:17 ` [PATCH v5 10/15] drm/bridge: synopsys: dw-dp: Add Runtime PM support Sebastian Reichel
2026-07-23 22:37   ` sashiko-bot
2026-07-23 22:17 ` [PATCH v5 11/15] drm/rockchip: dw_dp: Add runtime " Sebastian Reichel
2026-07-23 22:40   ` sashiko-bot
2026-07-23 22:17 ` [PATCH v5 12/15] drm/bridge: synopsys: dw-dp: Protect sdp_reg_bank from concurrent access Sebastian Reichel
2026-07-23 22:17 ` [PATCH v5 13/15] drm/bridge: synopsys: dw-dp: Use regmap_set_bits in dw_dp_send_sdp Sebastian Reichel
2026-07-23 22:17 ` [PATCH v5 14/15] dt-bindings: display: rockchip: dw-dp: Fix sound DAI cells Sebastian Reichel
2026-07-23 22:17 ` [PATCH v5 15/15] drm/bridge: synopsys: dw-dp: Add audio support Sebastian Reichel
2026-07-23 22:38   ` sashiko-bot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260723223121.ED0AB1F0155C@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=sebastian.reichel@collabora.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox