dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Cristian Ciocaltea" <cristian.ciocaltea@collabora.com>
Cc: linux-sunxi@lists.linux.dev, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v11 24/74] drm/display: hdmi-state-helper: Set HDMI scrambling requirement
Date: Tue, 01 Sep 2026 19:39:38 +0000	[thread overview]
Message-ID: <20260901193938.547E11F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260901-dw-hdmi-qp-scramb-v11-24-bc12954a0688@collabora.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Missing validation of sink SCDC scrambling capabilities during the atomic check phase when scrambling is required.
--

commit caf66f1de17a42fc5664100ac7127160f89c2866
Author: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>

drm/display: hdmi-state-helper: Set HDMI scrambling requirement

This commit sets the HDMI scrambling requirement in the HDMI state helper
when the computed TMDS character rate exceeds the HDMI 1.3 maximum limit.
Centralizing this clock-based requirement prevents drivers from needing
to open-code the threshold check.

> diff --git a/drivers/gpu/drm/display/drm_hdmi_state_helper.c b/drivers/gpu/drm/display/drm_hdmi_state_helper.c
> index 1e269b203b987..7cdb7ca3dc12f 100644
> --- a/drivers/gpu/drm/display/drm_hdmi_state_helper.c
> +++ b/drivers/gpu/drm/display/drm_hdmi_state_helper.c
> @@ -596,6 +596,9 @@ hdmi_compute_clock(const struct drm_connector *connector,
>  
>  	conn_state->hdmi.tmds_char_rate = clock;
>  
> +	/* TODO: also check drm_display_info.hdmi.scdc.scrambling.low_rates */
> +	conn_state->hdmi.scrambler_needed = (clock > HDMI_1_3_TMDS_CHAR_RATE_MAX_HZ);

[Severity: High]
Does this allow an unsupported configuration to pass the atomic check phase?

When a high TMDS clock is requested, this unconditionally sets
conn_state->hdmi.scrambler_needed to true without validating sink SCDC
capabilities. The configuration can pass hdmi_compute_clock() and
atomic_check because info->max_tmds_clock is permitted to exceed 340MHz
regardless of SCDC support.

Later during the hardware programming phase, it will fail:

drivers/gpu/drm/display/drm_hdmi_helper.c:drm_connector_hdmi_enable_scrambling() {
	...
	if (!drm_scdc_sink_supports_scrambling(connector)) {
		drm_dbg_kms(dev, "Sink doesn't support scrambling.\n");
		return -EINVAL;
	}
	...
}

Failing during atomic_enable violates KMS atomic guarantees. This sequence
can be triggered remotely if an untrusted or malformed EDID advertises a high
TMDS clock via HF-VSDB but clears the SCDC supported bit.

Should this validate drm_scdc_sink_supports_scrambling(connector) during the
atomic check phase and return an error if scrambling is required but SCDC is
unsupported by the sink?

> +
>  	return 0;
>  }
>

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260901-dw-hdmi-qp-scramb-v11-0-bc12954a0688@collabora.com?part=24

  reply	other threads:[~2026-09-01 19:39 UTC|newest]

Thread overview: 93+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-01 18:50 [PATCH v11 00/74] Add HDMI 2.0 support to DW HDMI QP TX Cristian Ciocaltea
2026-09-01 18:50 ` [PATCH v11 01/74] video/hdmi: Introduce HDMI version enum Cristian Ciocaltea
2026-09-01 18:50 ` [PATCH v11 02/74] drm/connector: hdmi: Handle reset() state allocation failure Cristian Ciocaltea
2026-09-01 19:07   ` sashiko-bot
2026-09-01 18:50 ` [PATCH v11 03/74] drm/display: hdmi: Rename drmm_connector_hdmi_init() to *_ini2() Cristian Ciocaltea
2026-09-01 18:50 ` [PATCH v11 04/74] drm/connector: Add drmm_connector_hdmi_init() with new signature Cristian Ciocaltea
2026-09-01 18:50 ` [PATCH v11 05/74] drm/display: bridge_connector: Convert to drmm_connector_hdmi_init() Cristian Ciocaltea
2026-09-01 18:50 ` [PATCH v11 06/74] drm/probe-helper: Introduce .force_ctx() connector callback Cristian Ciocaltea
2026-09-01 18:50 ` [PATCH v11 07/74] drm/connector: Add HDMI 2.0 scrambler infrastructure Cristian Ciocaltea
2026-09-01 18:50 ` [PATCH v11 08/74] drm/display: scdc-helper: Add macro for connector-prefixed debug messages Cristian Ciocaltea
2026-09-01 18:50 ` [PATCH v11 09/74] drm/display: scdc-helper: Add helper to set SCDC version information Cristian Ciocaltea
2026-09-01 18:50 ` [PATCH v11 10/74] drm/display: hdmi: Add HDMI 2.0 scrambling management helpers Cristian Ciocaltea
2026-09-01 19:18   ` sashiko-bot
2026-09-01 18:50 ` [PATCH v11 11/74] drm/display: hdmi: Advertise SCDC source version when scrambling Cristian Ciocaltea
2026-09-01 18:50 ` [PATCH v11 12/74] drm/bridge: Fix unlocked list_del in drm_bridge_add() Cristian Ciocaltea
2026-09-01 19:17   ` sashiko-bot
2026-09-01 18:50 ` [PATCH v11 13/74] drm/bridge: Fix NULL deref in drm_bridge_add() for legacy bridges Cristian Ciocaltea
2026-09-01 19:19   ` sashiko-bot
2026-09-01 18:50 ` [PATCH v11 14/74] drm/bridge: Fix unlocked list access in drm_bridge_attach() Cristian Ciocaltea
2026-09-01 19:16   ` sashiko-bot
2026-09-01 18:50 ` [PATCH v11 15/74] drm/bridge: Remove redundant error check in drm_bridge_helper_reset_crtc() Cristian Ciocaltea
2026-09-01 19:21   ` sashiko-bot
2026-09-01 18:50 ` [PATCH v11 16/74] drm/bridge: Add bridge ops for source-side HDMI 2.0 scrambling Cristian Ciocaltea
2026-09-01 18:50 ` [PATCH v11 17/74] drm/display: bridge_connector: Use cached connector status in .get_modes() Cristian Ciocaltea
2026-09-01 18:50 ` [PATCH v11 18/74] drm/display: bridge_connector: Switch to .detect_ctx() connector helper Cristian Ciocaltea
2026-09-01 18:50 ` [PATCH v11 19/74] drm/display: bridge_connector: Wire up HDMI 2.0 scrambler callbacks Cristian Ciocaltea
2026-09-01 18:50 ` [PATCH v11 20/74] drm/display: hdmi-state-helper: Add source TMDS rate validation Cristian Ciocaltea
2026-09-01 18:50 ` [PATCH v11 21/74] drm/display: hdmi-state-helper: Pass acquire ctx to hotplug helpers Cristian Ciocaltea
2026-09-01 18:50 ` [PATCH v11 22/74] drm/display: hdmi-state-helper: Add drm_atomic_helper_connector_hdmi_force_ctx() Cristian Ciocaltea
2026-09-01 18:50 ` [PATCH v11 23/74] drm/display: hdmi-state-helper: Sync SCDC state on hotplug Cristian Ciocaltea
2026-09-01 19:40   ` sashiko-bot
2026-09-01 18:50 ` [PATCH v11 24/74] drm/display: hdmi-state-helper: Set HDMI scrambling requirement Cristian Ciocaltea
2026-09-01 19:39   ` sashiko-bot [this message]
2026-09-01 18:50 ` [PATCH v11 25/74] drm/display: bridge_connector: Switch to .force_ctx() connector helper Cristian Ciocaltea
2026-09-01 18:50 ` [PATCH v11 26/74] drm/bridge: dw-hdmi-qp: Rate limit i2c read error messages Cristian Ciocaltea
2026-09-01 18:50 ` [PATCH v11 27/74] drm/bridge: dw-hdmi-qp: Provide .{enable,disable}_hpd() PHY ops Cristian Ciocaltea
2026-09-01 18:50 ` [PATCH v11 28/74] drm/bridge: dw-hdmi-qp: Remove unused workqueue include and define Cristian Ciocaltea
2026-09-01 18:50 ` [PATCH v11 29/74] drm/bridge: dw-hdmi-qp: Add HDMI 2.0 scrambling support Cristian Ciocaltea
2026-09-01 18:50 ` [PATCH v11 30/74] drm/bridge: dw-hdmi-qp: Provide dw_hdmi_qp_hpd_notify() helper Cristian Ciocaltea
2026-09-01 18:50 ` [PATCH v11 31/74] drm/rockchip: dw_hdmi_qp: Fix invalid drvdata access in PM ops Cristian Ciocaltea
2026-09-01 19:46   ` sashiko-bot
2026-09-01 18:50 ` [PATCH v11 32/74] drm/rockchip: dw_hdmi_qp: Cancel pending HPD work on suspend Cristian Ciocaltea
2026-09-01 18:50 ` [PATCH v11 33/74] drm/rockchip: dw_hdmi_qp: Add missing newlines in dev_err_probe() messages Cristian Ciocaltea
2026-09-01 19:52   ` sashiko-bot
2026-09-01 18:50 ` [PATCH v11 34/74] drm/rockchip: dw_hdmi_qp: Use local dev variable consistently in bind() Cristian Ciocaltea
2026-09-01 18:50 ` [PATCH v11 35/74] drm/rockchip: dw_hdmi_qp: Avoid spurious HPD IRQ thread wakeups Cristian Ciocaltea
2026-09-01 18:51 ` [PATCH v11 36/74] drm/rockchip: dw_hdmi_qp: Mask RK3576 HPD IRQ in io_init Cristian Ciocaltea
2026-09-01 19:50   ` sashiko-bot
2026-09-01 18:51 ` [PATCH v11 37/74] drm/rockchip: dw_hdmi_qp: Implement .{enable,disable}_hpd() PHY ops Cristian Ciocaltea
2026-09-01 18:51 ` [PATCH v11 38/74] drm/rockchip: dw_hdmi_qp: Factor out HPD interrupt (un)mask helpers Cristian Ciocaltea
2026-09-01 19:55   ` sashiko-bot
2026-09-01 18:51 ` [PATCH v11 39/74] drm/rockchip: dw_hdmi_qp: Control the HPD IRQ line via the bridge HPD ops Cristian Ciocaltea
2026-09-01 20:03   ` sashiko-bot
2026-09-01 18:51 ` [PATCH v11 40/74] drm/rockchip: dw_hdmi_qp: Use dw_hdmi_qp_hpd_notify() for HPD reports Cristian Ciocaltea
2026-09-01 20:05   ` sashiko-bot
2026-09-01 18:51 ` [PATCH v11 41/74] drm/bridge: dw-hdmi-qp: Drop unused .setup_hpd() phy op Cristian Ciocaltea
2026-09-01 18:51 ` [PATCH v11 42/74] drm/vc4: hdmi: Use common TMDS char rate constants Cristian Ciocaltea
2026-09-01 18:51 ` [PATCH v11 43/74] drm/vc4: hdmi: Switch to drm_hdmi_mode_needs_scrambling() Cristian Ciocaltea
2026-09-01 18:51 ` [PATCH v11 44/74] drm/vc4: hdmi: Switch to .force_ctx() connector helper Cristian Ciocaltea
2026-09-01 18:51 ` [PATCH v11 45/74] drm/vc4: hdmi: Propagate -EDEADLK to the top level Cristian Ciocaltea
2026-09-01 18:51 ` [PATCH v11 46/74] drm/vc4: hdmi: Convert to drmm_connector_hdmi_init() Cristian Ciocaltea
2026-09-01 18:51 ` [PATCH v11 47/74] drm/vc4: hdmi: Convert to common HDMI 2.0 scrambling infrastructure Cristian Ciocaltea
2026-09-01 18:51 ` [PATCH v11 48/74] drm/vc4: hdmi: Defer pixel clock validation to HDMI helpers Cristian Ciocaltea
2026-09-01 18:51 ` [PATCH v11 49/74] drm/display: hdmi-state-helper: Drop drm_atomic_helper_connector_hdmi_force() Cristian Ciocaltea
2026-09-01 18:51 ` [PATCH v11 50/74] drm/bridge: adv7511: Advertise HDMI 1.2 capabilities Cristian Ciocaltea
2026-09-01 20:17   ` sashiko-bot
2026-09-01 18:51 ` [PATCH v11 51/74] drm/bridge: inno-hdmi: " Cristian Ciocaltea
2026-09-01 18:51 ` [PATCH v11 52/74] drm/bridge: ite-it6263: Drop redundant .mode_valid hook Cristian Ciocaltea
2026-09-01 18:51 ` [PATCH v11 53/74] drm/bridge: ite-it6263: Advertise HDMI 1.3 capabilities Cristian Ciocaltea
2026-09-01 18:51 ` [PATCH v11 54/74] drm/bridge: ite-it66121: Advertise HDMI 1.2 capabilities Cristian Ciocaltea
2026-09-01 18:51 ` [PATCH v11 55/74] drm/bridge: lontium-lt9611: Advertise HDMI 1.4 capabilities Cristian Ciocaltea
2026-09-01 18:51 ` [PATCH v11 56/74] drm/rockchip: rk3066_hdmi: " Cristian Ciocaltea
2026-09-01 20:24   ` sashiko-bot
2026-09-01 18:51 ` [PATCH v11 57/74] drm/sun4i: hdmi: Convert to drmm_connector_hdmi_init() Cristian Ciocaltea
2026-09-01 18:51 ` [PATCH v11 58/74] drm/tests: edid: Add 4K@60Hz EDID with 600MHz TMDS Cristian Ciocaltea
2026-09-01 18:51 ` [PATCH v11 59/74] drm/tests: edid: Fix conformity for 1080p+4K YUV420 200MHz EDID Cristian Ciocaltea
2026-09-01 18:51 ` [PATCH v11 60/74] drm/tests: edid: Fix conformity for 4K RGB/YUV 340MHz EDID Cristian Ciocaltea
2026-09-01 18:51 ` [PATCH v11 61/74] drm/tests: bridge: Set supported HDMI version Cristian Ciocaltea
2026-09-01 18:51 ` [PATCH v11 62/74] drm/tests: connector: Convert to drmm_connector_hdmi_init() Cristian Ciocaltea
2026-09-01 18:51 ` [PATCH v11 63/74] drm/tests: connector: Add HDMI max_tmds_char_rate init coverage Cristian Ciocaltea
2026-09-01 18:51 ` [PATCH v11 64/74] drm/tests: connector: Add HDMI source-side scrambler coverage Cristian Ciocaltea
2026-09-01 18:51 ` [PATCH v11 65/74] drm/tests: hdmi_state_helper: Convert to drmm_connector_hdmi_init() Cristian Ciocaltea
2026-09-01 18:51 ` [PATCH v11 66/74] drm/tests: hdmi_state_helper: Add connector-provided max_tmds_char_rate coverage Cristian Ciocaltea
2026-09-01 18:51 ` [PATCH v11 67/74] drm/tests: hdmi_state_helper: Cover source-side scrambling decision Cristian Ciocaltea
2026-09-01 18:51 ` [PATCH v11 68/74] drm/connector: Remove drmm_connector_hdmi_ini2() Cristian Ciocaltea
2026-09-01 18:51 ` [PATCH v11 69/74] drm/connector: Drop redundant hdmi vendor/product fields Cristian Ciocaltea
2026-09-01 18:51 ` [PATCH v11 70/74] drm/connector: Drop redundant hdmi supported_formats field Cristian Ciocaltea
2026-09-01 18:51 ` [PATCH v11 71/74] drm/connector: Drop redundant max_bpc field Cristian Ciocaltea
2026-09-01 18:51 ` [PATCH v11 72/74] video/hdmi: Define SPD InfoFrame field lengths and use strtomem_pad() Cristian Ciocaltea
2026-09-01 18:51 ` [PATCH v11 73/74] drm/connector: Use the SPD InfoFrame field length defines Cristian Ciocaltea
2026-09-01 18:51 ` [PATCH v11 74/74] drm/tests: hdmi: Add SPD InfoFrame vendor/product coverage Cristian Ciocaltea
2026-09-02 15:28 ` [PATCH v11 00/74] Add HDMI 2.0 support to DW HDMI QP TX Igor Paunovic
2026-09-02 18:00   ` Cristian Ciocaltea

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=20260901193938.547E11F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=cristian.ciocaltea@collabora.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-sunxi@lists.linux.dev \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox