All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Dmitry Baryshkov" <dmitry.baryshkov@oss.qualcomm.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 01/24] drm/msm/dp: reject YUV420-only modes without VSC SDP support
Date: Wed, 22 Jul 2026 07:03:33 +0000	[thread overview]
Message-ID: <20260722070333.7F02F1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260722-drm-msm-display-interface-v1-1-368c10fe62fd@oss.qualcomm.com>

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:

New issues:
- [High] The patch relies on mode filtering to replace explicit VSC SDP support checks, but fails to apply this filtering to eDP, causing a DPU/DP state mismatch.

Pre-existing issues:
- [High] msm_dp_wide_bus_available() incorrectly uses the currently active hardware state to determine if wide bus can be used for a proposed mode, potentially rejecting valid high-bandwidth modes.
--

--- Patch [1]: [PATCH 01/24] drm/msm/dp: reject YUV420-only modes without VSC SDP support ---
commit 978b7d550fcfcaed1db8ec32849e99ffcd2880a7
Author: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>

drm/msm/dp: reject YUV420-only modes without VSC SDP support

This patch updates DP mode validation to explicitly reject YUV420-only
modes if the panel lacks VSC SDP support. By filtering these out, the
DPU encoder logic is simplified to assume any validated 420-only mode
has VSC SDP support.

> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
> index 778e231d49677..1f20695f81e35 100644
> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
> @@ -710,8 +710,7 @@ void dpu_encoder_update_topology(struct drm_encoder *drm_enc,
>  		if (fb && MSM_FORMAT_IS_YUV(msm_framebuffer_format(fb)))
>  			topology->num_cdm++;
>  	} else if (disp_info->intf_type == INTF_DP) {
> -		if (msm_dp_is_yuv_420_enabled(priv->kms->dp[disp_info->h_tile_instance[0]],
> -					      adj_mode))
> +		if (drm_mode_is_420_only(&connector->display_info, adj_mode))
>  			topology->num_cdm++;

[Severity: High]
Does this change break mode validation for eDP displays by assuming VSC SDP
support is always present for 420-only modes?

This patch adds mode filtering to msm_dp_bridge_mode_valid() to reject modes
without VSC SDP, so that dpu_encoder_update_topology() can assume all
420-only modes are fully supported.

However, the eDP validation function, msm_edp_bridge_mode_valid(), does not
appear to have the same filtering logic applied.

If an eDP sink advertises a YUV420-only mode without VSC SDP support, will it
pass validation, causing dpu_encoder_update_topology() to allocate a CDM
block (expecting YUV420) while the DP controller is still configured for RGB?

>  	}
>  }
> diff --git a/drivers/gpu/drm/msm/dp/dp_display.c b/drivers/gpu/drm/msm/dp/dp_display.c
> index dc6f33809ca5f..e0c44eef3abab 100644
> --- a/drivers/gpu/drm/msm/dp/dp_display.c
> +++ b/drivers/gpu/drm/msm/dp/dp_display.c
[ ... ]
> @@ -709,9 +710,16 @@ enum drm_mode_status msm_dp_bridge_mode_valid(struct drm_bridge *bridge,
>  	msm_dp_display = container_of(dp, struct msm_dp_display_private, msm_dp_display);
>  	link_info = &msm_dp_display->panel->link_info;
>  
> -	if ((drm_mode_is_420_only(&dp->connector->display_info, mode) &&
> -	     msm_dp_display->panel->vsc_sdp_supported) ||
> -	     msm_dp_wide_bus_available(dp))
> +	is_yuv_420 = drm_mode_is_420_only(&dp->connector->display_info, mode);
> +
> +	/*
> +	 * YUV 420 is carried over DP by signalling the colorimetry through a
> +	 * VSC SDP, so a 420-only mode cannot be driven without VSC SDP support.
> +	 */
> +	if (is_yuv_420 && !msm_dp_display->panel->vsc_sdp_supported)
> +		return MODE_NO_420;
> +
> +	if (is_yuv_420 || msm_dp_wide_bus_available(dp))
>  		mode_pclk_khz /= 2;

[Severity: High]
This is a pre-existing issue, but does msm_dp_wide_bus_available() check
the active hardware state rather than the proposed mode?

During mode validation in msm_dp_bridge_mode_valid(), the code checks:
	if (is_yuv_420 || msm_dp_wide_bus_available(dp))

However, msm_dp_wide_bus_available() evaluates the currently active modeset
instead of the proposed mode:

drivers/gpu/drm/msm/dp/dp_display.c:msm_dp_wide_bus_available() {
	...
	if (dp->msm_dp_mode.out_fmt_is_yuv_420)
		return false;
	...
}

If userspace probes a high-bandwidth RGB mode while the current display state
is YUV420, could this incorrectly restrict hardware capability based on
the transient state and improperly reject valid modes?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260722-drm-msm-display-interface-v1-0-368c10fe62fd@oss.qualcomm.com?part=1

  reply	other threads:[~2026-07-22  7:03 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-22  6:36 [PATCH 00/24] drm/msm: introduce the struct msm_display interface Dmitry Baryshkov
2026-07-22  6:36 ` [PATCH 01/24] drm/msm/dp: reject YUV420-only modes without VSC SDP support Dmitry Baryshkov
2026-07-22  7:03   ` sashiko-bot [this message]
2026-07-22  6:36 ` [PATCH 02/24] drm/msm/dp: drop the always-true yuv_supported argument Dmitry Baryshkov
2026-07-22  6:36 ` [PATCH 03/24] drm/msm: create the display connectors from common code Dmitry Baryshkov
2026-07-22  7:04   ` sashiko-bot
2026-07-22  6:36 ` [PATCH 04/24] drm/msm: introduce the struct msm_display interface Dmitry Baryshkov
2026-07-22  6:36 ` [PATCH 05/24] drm/msm: route the display snapshot through the " Dmitry Baryshkov
2026-07-22  6:56   ` sashiko-bot
2026-07-22  6:36 ` [PATCH 06/24] drm/msm/hdmi: capture the HDMI registers in the display snapshot Dmitry Baryshkov
2026-07-22  6:59   ` sashiko-bot
2026-07-22  6:36 ` [PATCH 07/24] drm/msm: add the wide_bus_enabled callback to msm_display Dmitry Baryshkov
2026-07-22  6:36 ` [PATCH 08/24] drm/msm: add the needs_periph_flush " Dmitry Baryshkov
2026-07-22  6:36 ` [PATCH 09/24] drm/msm: add the is_cmd_mode " Dmitry Baryshkov
2026-07-22  6:36 ` [PATCH 10/24] drm/msm: add the get_dsc_config " Dmitry Baryshkov
2026-07-22  6:36 ` [PATCH 11/24] drm/msm: add the get_te_source " Dmitry Baryshkov
2026-07-22  6:36 ` [PATCH 12/24] drm/msm: add is_bonded and needs_encoder callbacks " Dmitry Baryshkov
2026-07-22  6:36 ` [PATCH 13/24] drm/msm/hdmi: use dev_get_drvdata() in msm_hdmi_unbind() Dmitry Baryshkov
2026-07-22  7:03   ` sashiko-bot
2026-07-22  6:36 ` [PATCH 14/24] drm/msm: store the display sub-blocks as struct msm_display Dmitry Baryshkov
2026-07-22  6:36 ` [PATCH 15/24] drm/msm/dp: do not reject wide-bus modes while a YUV420 mode is active Dmitry Baryshkov
2026-07-22  7:03   ` sashiko-bot
2026-07-22  6:36 ` [PATCH 16/24] drm/msm/dp: remove cached drm_edid from panel Dmitry Baryshkov
2026-07-22  7:08   ` sashiko-bot
2026-07-22  6:36 ` [PATCH 17/24] drm/msm/dp: drop deprecated .mode_set() and use .atomic_pre_enable Dmitry Baryshkov
2026-07-22  6:36 ` [PATCH 18/24] drm/msm/hdmi: cache is_hdmi instead of storing the connector Dmitry Baryshkov
2026-07-22  7:06   ` sashiko-bot
2026-07-22  6:36 ` [PATCH 19/24] drm/msm/dp: drop redundant panel->connector Dmitry Baryshkov
2026-07-22  6:36 ` [PATCH 20/24] drm/msm/dp: use drm_display_info in mode_valid callbacks Dmitry Baryshkov
2026-07-22  6:36 ` [PATCH 21/24] drm/msm/dp: guard subconnector setup on the connector type Dmitry Baryshkov
2026-07-22  6:36 ` [PATCH 22/24] drm/msm/dp: stop storing the connector in struct msm_dp Dmitry Baryshkov
2026-07-22  7:12   ` sashiko-bot
2026-07-22  6:36 ` [PATCH 23/24] drm/msm: create the bridge connectors from common code Dmitry Baryshkov
2026-07-22  7:04   ` sashiko-bot
2026-07-22  6:36 ` [PATCH 24/24] drm/bridge-connector: attach the DP subconnector property Dmitry Baryshkov
2026-07-22  7:05   ` 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=20260722070333.7F02F1F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=dmitry.baryshkov@oss.qualcomm.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.