All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Krzysztof Kozlowski" <krzysztof.kozlowski@oss.qualcomm.com>
Cc: vkoul@kernel.org, dri-devel@lists.freedesktop.org,
	devicetree@vger.kernel.org, neil.armstrong@linaro.org,
	linux-phy@lists.infradead.org, olteanv@gmail.com,
	robh@kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH RFC/DO NOT MERGE 09/12] drm/msm/hdmi: Add HDMI for Eliza SoC
Date: Fri, 28 Aug 2026 14:22:20 +0000	[thread overview]
Message-ID: <20260828142220.AB61C1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260828-drm-msm-hdmi-eliza-v1-9-67843277de17@oss.qualcomm.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] The TMDS rate validation for platforms with OPP tables accepts inexact pixel clocks by skipping clock synthesizability checks.
--

commit e2e2d112c3fa04206001b8a9cc56acdda995a731
Author: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>

drm/msm/hdmi: Add HDMI for Eliza SoC
    
This commit adds HDMI support for the Qualcomm Eliza SoC (DPU v12.4). It
introduces configuration for INTF_11 with new interrupt registers and handles
Eliza's distinct clock and power requirements.

> diff --git a/drivers/gpu/drm/msm/hdmi/hdmi_bridge.c b/drivers/gpu/drm/msm/hdmi/hdmi_bridge.c
> index 17e81628525a9..b5353a1688ddf 100644
> --- a/drivers/gpu/drm/msm/hdmi/hdmi_bridge.c
> +++ b/drivers/gpu/drm/msm/hdmi/hdmi_bridge.c

[ ... ]

> @@ -459,21 +490,47 @@ static enum drm_mode_status msm_hdmi_bridge_tmds_char_rate_valid(const struct dr
>  	 * mdp4/dtv stuff where pixel clk is assigned to mdp/encoder
>  	 * instead):
>  	 */
> -	if (kms->funcs->round_pixclk)
> +	if (kms->funcs->round_pixclk) {
>  		actual = kms->funcs->round_pixclk(kms,
>  						  tmds_rate,
>  						  hdmi_bridge->hdmi->encoder);
> -	else if (hdmi->extp_clk)
> -		actual = clk_round_rate(hdmi->extp_clk, tmds_rate);
> -	else
> -		actual = tmds_rate;
> -
> -	DBG("requested=%lld, actual=%ld", tmds_rate, actual);
> -
> -	if (actual != tmds_rate)
> -		return MODE_CLOCK_RANGE;
> -
> -	return 0;
> +		DBG("requested=%lld, actual=%ld", tmds_rate, actual);
> +
> +		if (actual != tmds_rate)
> +			return MODE_CLOCK_RANGE;
> +		return MODE_OK;
> +	} else if (!dev_pm_opp_get_opp_count(&hdmi->pdev->dev)) {
> +		if (hdmi->extp_clk)
> +			actual = clk_round_rate(hdmi->extp_clk, tmds_rate);
> +		else
> +			actual = tmds_rate;
> +
> +		if (actual != tmds_rate)
> +			return MODE_CLOCK_RANGE;
> +		return MODE_OK;
> +	} else {
> +		struct dev_pm_opp *opp;
> +		unsigned long pclk_rate = tmds_rate;
> +
> +		if (mode->clock > 600000)
> +			return MODE_CLOCK_HIGH;
> +
> +		opp = dev_pm_opp_find_freq_ceil(&hdmi->pdev->dev, &pclk_rate);
> +		if (!IS_ERR(opp)) {
> +			dev_pm_opp_put(opp);
> +		} else if (PTR_ERR(opp) == -ERANGE) {
> +			/*
> +			 * An empty table is created by devm_pm_opp_set_clkname() even
> +			 * if there is none. Thus find_freq_ceil will still return
> +			 * -ERANGE in such case.
> +			 */
> +			return MODE_CLOCK_RANGE;
> +		} else {
> +			return MODE_ERROR;
> +		}
> +
> +		return MODE_OK;

[Severity: High]
Does this bypass clock synthesizability checks for platforms with OPP tables?

The TMDS rate validation here accepts inexact pixel clocks because it skips
the exact match check that is enforced in the non-OPP path:

	if (hdmi->extp_clk)
		actual = clk_round_rate(hdmi->extp_clk, tmds_rate);
	...
	if (actual != tmds_rate)
		return MODE_CLOCK_RANGE;

When msm_hdmi_bridge_tmds_char_rate_valid() searches for an OPP entry, it
uses dev_pm_opp_find_freq_ceil() which finds a ceiling rather than an exact
match. Because it returns MODE_OK unconditionally upon finding a ceiling,
it can accept display modes that the hardware clock generator cannot
exactly synthesize.

Could this result in configuring an inaccurate pixel clock for the display,
leading to Out of Range errors or visual corruption?

> +	}
>  }

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260828-drm-msm-hdmi-eliza-v1-0-67843277de17@oss.qualcomm.com?part=9

-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

WARNING: multiple messages have this Message-ID (diff)
From: sashiko-bot@kernel.org
To: "Krzysztof Kozlowski" <krzysztof.kozlowski@oss.qualcomm.com>
Cc: vkoul@kernel.org, dri-devel@lists.freedesktop.org,
	devicetree@vger.kernel.org, neil.armstrong@linaro.org,
	linux-phy@lists.infradead.org, olteanv@gmail.com,
	robh@kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH RFC/DO NOT MERGE 09/12] drm/msm/hdmi: Add HDMI for Eliza SoC
Date: Fri, 28 Aug 2026 14:22:20 +0000	[thread overview]
Message-ID: <20260828142220.AB61C1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260828-drm-msm-hdmi-eliza-v1-9-67843277de17@oss.qualcomm.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] The TMDS rate validation for platforms with OPP tables accepts inexact pixel clocks by skipping clock synthesizability checks.
--

commit e2e2d112c3fa04206001b8a9cc56acdda995a731
Author: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>

drm/msm/hdmi: Add HDMI for Eliza SoC
    
This commit adds HDMI support for the Qualcomm Eliza SoC (DPU v12.4). It
introduces configuration for INTF_11 with new interrupt registers and handles
Eliza's distinct clock and power requirements.

> diff --git a/drivers/gpu/drm/msm/hdmi/hdmi_bridge.c b/drivers/gpu/drm/msm/hdmi/hdmi_bridge.c
> index 17e81628525a9..b5353a1688ddf 100644
> --- a/drivers/gpu/drm/msm/hdmi/hdmi_bridge.c
> +++ b/drivers/gpu/drm/msm/hdmi/hdmi_bridge.c

[ ... ]

> @@ -459,21 +490,47 @@ static enum drm_mode_status msm_hdmi_bridge_tmds_char_rate_valid(const struct dr
>  	 * mdp4/dtv stuff where pixel clk is assigned to mdp/encoder
>  	 * instead):
>  	 */
> -	if (kms->funcs->round_pixclk)
> +	if (kms->funcs->round_pixclk) {
>  		actual = kms->funcs->round_pixclk(kms,
>  						  tmds_rate,
>  						  hdmi_bridge->hdmi->encoder);
> -	else if (hdmi->extp_clk)
> -		actual = clk_round_rate(hdmi->extp_clk, tmds_rate);
> -	else
> -		actual = tmds_rate;
> -
> -	DBG("requested=%lld, actual=%ld", tmds_rate, actual);
> -
> -	if (actual != tmds_rate)
> -		return MODE_CLOCK_RANGE;
> -
> -	return 0;
> +		DBG("requested=%lld, actual=%ld", tmds_rate, actual);
> +
> +		if (actual != tmds_rate)
> +			return MODE_CLOCK_RANGE;
> +		return MODE_OK;
> +	} else if (!dev_pm_opp_get_opp_count(&hdmi->pdev->dev)) {
> +		if (hdmi->extp_clk)
> +			actual = clk_round_rate(hdmi->extp_clk, tmds_rate);
> +		else
> +			actual = tmds_rate;
> +
> +		if (actual != tmds_rate)
> +			return MODE_CLOCK_RANGE;
> +		return MODE_OK;
> +	} else {
> +		struct dev_pm_opp *opp;
> +		unsigned long pclk_rate = tmds_rate;
> +
> +		if (mode->clock > 600000)
> +			return MODE_CLOCK_HIGH;
> +
> +		opp = dev_pm_opp_find_freq_ceil(&hdmi->pdev->dev, &pclk_rate);
> +		if (!IS_ERR(opp)) {
> +			dev_pm_opp_put(opp);
> +		} else if (PTR_ERR(opp) == -ERANGE) {
> +			/*
> +			 * An empty table is created by devm_pm_opp_set_clkname() even
> +			 * if there is none. Thus find_freq_ceil will still return
> +			 * -ERANGE in such case.
> +			 */
> +			return MODE_CLOCK_RANGE;
> +		} else {
> +			return MODE_ERROR;
> +		}
> +
> +		return MODE_OK;

[Severity: High]
Does this bypass clock synthesizability checks for platforms with OPP tables?

The TMDS rate validation here accepts inexact pixel clocks because it skips
the exact match check that is enforced in the non-OPP path:

	if (hdmi->extp_clk)
		actual = clk_round_rate(hdmi->extp_clk, tmds_rate);
	...
	if (actual != tmds_rate)
		return MODE_CLOCK_RANGE;

When msm_hdmi_bridge_tmds_char_rate_valid() searches for an OPP entry, it
uses dev_pm_opp_find_freq_ceil() which finds a ceiling rather than an exact
match. Because it returns MODE_OK unconditionally upon finding a ceiling,
it can accept display modes that the hardware clock generator cannot
exactly synthesize.

Could this result in configuring an inaccurate pixel clock for the display,
leading to Out of Range errors or visual corruption?

> +	}
>  }

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260828-drm-msm-hdmi-eliza-v1-0-67843277de17@oss.qualcomm.com?part=9

  reply	other threads:[~2026-08-28 14:22 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-28 14:04 [PATCH RFC/DO NOT MERGE 00/12] drm/msm/hdmi: Add Eliza HDMI and HDMI PHY Krzysztof Kozlowski
2026-08-28 14:04 ` Krzysztof Kozlowski
2026-08-28 14:04 ` [PATCH RFC/DO NOT MERGE 01/12] drm/msm/hdmi_bridge: Drop redundant initialization in msm_hdmi_bridge_init() Krzysztof Kozlowski
2026-08-28 14:04   ` Krzysztof Kozlowski
2026-08-28 14:05 ` [PATCH RFC/DO NOT MERGE 02/12] drm/msm: Properly handle msm_ioremap() without name Krzysztof Kozlowski
2026-08-28 14:05   ` Krzysztof Kozlowski
2026-08-28 14:05 ` [PATCH RFC/DO NOT MERGE 03/12] drm/msm/dsi: Fix indentation of if block in dsi_mgr_bridge_mode_valid() Krzysztof Kozlowski
2026-08-28 14:05   ` Krzysztof Kozlowski
2026-08-28 14:05 ` [PATCH RFC/DO NOT MERGE 04/12] dt-bindings: display/msm: hdmi: Correct name of disallowed supplies Krzysztof Kozlowski
2026-08-28 14:05   ` Krzysztof Kozlowski
2026-08-28 14:05 ` [PATCH RFC/DO NOT MERGE 05/12] dt-bindings: display/msm: hdmi: Add Eliza HDMI TX Krzysztof Kozlowski
2026-08-28 14:05   ` Krzysztof Kozlowski
2026-08-28 14:12   ` sashiko-bot
2026-08-28 14:12     ` sashiko-bot
2026-08-28 14:05 ` [PATCH RFC/DO NOT MERGE 06/12] dt-bindings: display/msm: eliza-hdmi-phy: Add Eliza HDMI PHY Krzysztof Kozlowski
2026-08-28 14:05   ` Krzysztof Kozlowski
2026-08-28 14:10   ` sashiko-bot
2026-08-28 14:10     ` sashiko-bot
2026-08-28 14:05 ` [PATCH RFC/DO NOT MERGE 07/12] drm/msm/hdmi: Split PHY init from power up Krzysztof Kozlowski
2026-08-28 14:05   ` Krzysztof Kozlowski
2026-08-28 14:22   ` sashiko-bot
2026-08-28 14:22     ` sashiko-bot
2026-08-28 14:05 ` [PATCH RFC/DO NOT MERGE 08/12] drm/msm/hdmi: Add support for PM OPP table Krzysztof Kozlowski
2026-08-28 14:05   ` Krzysztof Kozlowski
2026-08-28 14:16   ` sashiko-bot
2026-08-28 14:16     ` sashiko-bot
2026-08-28 14:05 ` [PATCH RFC/DO NOT MERGE 09/12] drm/msm/hdmi: Add HDMI for Eliza SoC Krzysztof Kozlowski
2026-08-28 14:05   ` Krzysztof Kozlowski
2026-08-28 14:22   ` sashiko-bot [this message]
2026-08-28 14:22     ` sashiko-bot
2026-08-28 14:05 ` [PATCH RFC/DO NOT MERGE 10/12] drm/msm/hdmi_phy_eliza: Add support for Synopsys-based HDMI phy on Eliza Krzysztof Kozlowski
2026-08-28 14:05   ` Krzysztof Kozlowski
2026-08-28 14:19   ` sashiko-bot
2026-08-28 14:19     ` sashiko-bot
2026-08-28 14:05 ` [PATCH RFC/DO NOT MERGE 11/12] arm64: dts: qcom: eliza: Add HDMI display with HDMI PHY Krzysztof Kozlowski
2026-08-28 14:05   ` Krzysztof Kozlowski
2026-08-28 14:05 ` [PATCH RFC/DO NOT MERGE 12/12] arm64: dts: qcom: eliza-evk: Add native HDMI Krzysztof Kozlowski
2026-08-28 14:05   ` Krzysztof Kozlowski

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=20260828142220.AB61C1F000E9@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=krzysztof.kozlowski@oss.qualcomm.com \
    --cc=linux-phy@lists.infradead.org \
    --cc=neil.armstrong@linaro.org \
    --cc=olteanv@gmail.com \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=vkoul@kernel.org \
    /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.