From: sashiko-bot@kernel.org
To: "Cristian Ciocaltea" <cristian.ciocaltea@collabora.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v3 6/9] drm/vc4: hdmi: Convert to common HDMI 2.0 scrambling infrastructure
Date: Wed, 14 Oct 2026 01:19:18 +0000 [thread overview]
Message-ID: <sashiko-outbox-170670@kernel.org> (raw)
In-Reply-To: <20261014-vc4-common-scramb-v3-6-c68d58d959a2@collabora.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] drm/vc4: spurious CRTC reset on hotplug due to stale scrambler_enabled flag
--
commit b54514a951277541ceb5327bc2186f46057b3bd2
Author: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
drm/vc4: hdmi: Convert to common HDMI 2.0 scrambling infrastructure
This commit replaces the local VC4 scrambling logic with the common HDMI 2.0
scrambling support in the DRM core. It delegates sink-side SCDC programming
and monitoring to the core, drops local state tracking for scrambling, and
switches to the core hotplug helpers.
> diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c
> index a03e50e8afcb3..2451ff85e7597 100644
> --- a/drivers/gpu/drm/vc4/vc4_hdmi.c
> +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c
[ ... ]
> @@ -535,6 +410,14 @@ static int vc4_hdmi_connector_init(struct drm_device *dev,
>
> drm_connector_helper_add(connector, &vc4_hdmi_connector_helper_funcs);
>
> + /*
> + * Since we don't know the state of the controller and its
> + * display (if any), let's assume it's always enabled.
> + * drm_connector_hdmi_disable_scrambling() will thus run at boot,
> + * make sure it's disabled, and avoid any inconsistency.
> + */
> + connector->hdmi.scrambler_enabled = drm_connector_hdmi_scrambler_supported(connector);
> +
[Severity: Medium]
Will this lead to spurious CRTC resets on hotplug events or EDID polls?
If the display starts disconnected, its initial atomic state has crtc set to
NULL. When a display is plugged in and a mode not requiring scrambling is set
(e.g. 1080p), the encoder disable hook is skipped by
drm_atomic_helper_commit_modeset_disables() because old_conn_state->crtc is
NULL.
Then drm_connector_hdmi_enable_scrambling() in the core returns early without
clearing the scrambler_enabled flag:
drivers/gpu/drm/display/drm_hdmi_helper.c:drm_connector_hdmi_enable_scrambling() {
...
if (!conn_state->hdmi.scrambler_needed)
return 0;
...
}
The flag remains true.
Subsequently, when drm_kms_helper_poll_worker() runs or an HPD event occurs,
drm_connector_hdmi_sync_scdc() sees the stale true flag:
drivers/gpu/drm/display/drm_hdmi_helper.c:drm_connector_hdmi_sync_scdc() {
...
if (!drm_connector_hdmi_scrambler_supported(connector) ||
!READ_ONCE(hdmi->scrambler_enabled))
return 0;
...
}
This reads the SCDC register (where scrambling is actually disabled) and
triggers a spurious drm_atomic_helper_reset_crtc(), causing the display to
flicker.
The previous local logic checked if scrambling was needed before reading SCDC,
but the new framework relies on this flag. How can we ensure the flag is
cleared when scrambling isn't needed on the first modeset?
> /*
> * Some of the properties below require access to state, like bpc.
> * Allocate some default initial connector state with our reset helper.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261014-vc4-common-scramb-v3-0-c68d58d959a2@collabora.com?part=6
next prev parent reply other threads:[~2026-10-14 1:19 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-14 1:03 [PATCH v3 0/9] drm/vc4: hdmi: Convert to common HDMI 2.0 scrambling infrastructure Cristian Ciocaltea
2026-10-14 1:03 ` [PATCH v3 1/9] drm/vc4: hdmi: Use common TMDS char rate constants Cristian Ciocaltea
2026-10-14 1:03 ` [PATCH v3 2/9] drm/vc4: hdmi: Switch to drm_hdmi_mode_needs_scrambling() Cristian Ciocaltea
2026-10-14 1:03 ` [PATCH v3 3/9] drm/vc4: hdmi: Switch to .force_ctx() connector helper Cristian Ciocaltea
2026-10-14 1:03 ` [PATCH v3 4/9] drm/vc4: hdmi: Propagate -EDEADLK to the top level Cristian Ciocaltea
2026-10-14 1:03 ` [PATCH v3 5/9] drm/vc4: hdmi: Convert to drmm_connector_hdmi_init() Cristian Ciocaltea
2026-10-14 1:03 ` [PATCH v3 6/9] drm/vc4: hdmi: Convert to common HDMI 2.0 scrambling infrastructure Cristian Ciocaltea
2026-10-14 1:19 ` sashiko-bot [this message]
2026-10-14 1:03 ` [PATCH v3 7/9] drm/vc4: hdmi: Clamp CEC clock divider to its register field width Cristian Ciocaltea
2026-10-14 1:03 ` [PATCH v3 8/9] drm/vc4: hdmi: Bump BCM2835 max pixel clock to 165 MHz Cristian Ciocaltea
2026-10-14 1:03 ` [PATCH v3 9/9] drm/vc4: hdmi: Defer pixel clock validation to HDMI helpers 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=sashiko-outbox-170670@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=cristian.ciocaltea@collabora.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.