From: sashiko-bot@kernel.org
To: "Lyude Paul" <lyude@redhat.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 4/6] drm/nouveau/kms/nv50-: Stop using nv_encoder->crtc in nv50_disp_atomic_commit_core()
Date: Wed, 19 Aug 2026 00:04:24 +0000 [thread overview]
Message-ID: <20260819000424.C885F1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260818235637.1738055-5-lyude@redhat.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Unconditional CRTC lookup and NULL check bypasses the output disable path, leaking hardware resources and causing spurious warnings.
--
--- Patch [4]: [PATCH 4/6] drm/nouveau/kms/nv50-: Stop using nv_encoder->crtc in nv50_disp_atomic_commit_core() ---
commit 3c40fb984475628cc9b548d32d5295add5289647
Author: Lyude Paul <lyude@redhat.com>
drm/nouveau/kms/nv50-: Stop using nv_encoder->crtc in nv50_disp_atomic_commit_core()
This commit replaces direct access to nv_encoder->crtc with a proper lookup
from the new atomic state in the core commit function. It adds a warning
and continues the loop if the new CRTC is not found.
> diff --git a/drivers/gpu/drm/nouveau/dispnv50/disp.c b/drivers/gpu/drm/nouveau/dispnv50/disp.c
> index f19820dc055ae..63d554e97fb62 100644
> --- a/drivers/gpu/drm/nouveau/dispnv50/disp.c
> +++ b/drivers/gpu/drm/nouveau/dispnv50/disp.c
> @@ -2171,10 +2171,14 @@ nv50_disp_atomic_commit_core(struct drm_atomic_commit *state, u32 *interlock)
> list_for_each_entry(outp, &atom->outp, head) {
> if (outp->encoder->encoder_type != DRM_MODE_ENCODER_DPMST) {
> struct nouveau_encoder *nv_encoder = nouveau_encoder(outp->encoder);
> + struct nouveau_crtc *nv_crtc = nv50_outp_get_new_crtc(state, nv_encoder);
> +
> + if (drm_WARN_ON(drm->dev, !nv_crtc))
> + continue;
[Severity: High]
When an output is being disabled (for instance, when a monitor is unplugged),
wouldn't nv50_outp_get_new_crtc() correctly return NULL here since the encoder
is no longer assigned to a CRTC?
If this unconditionally triggers the drm_WARN_ON and early return via the
continue statement, it appears it will completely bypass the cleanup path
below.
Could this skip the call to nvif_outp_release(&nv_encoder->outp), leaking the
hardware resource and generating a spurious warning every time a display is
disabled?
>
> if (outp->enabled) {
> - nv50_audio_enable(outp->encoder, nouveau_crtc(nv_encoder->crtc),
> - nv_encoder->conn, NULL, NULL);
> + nv50_audio_enable(outp->encoder, nv_crtc, nv_encoder->conn, NULL,
> + NULL);
> outp->enabled = outp->disabled = false;
> } else {
> if (outp->disabled) {
[ ... ]
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260818235637.1738055-1-lyude@redhat.com?part=4
next prev parent reply other threads:[~2026-08-19 0:04 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-18 23:48 [PATCH 0/6] drm/nouveau/kms/nv50-: Obliterate nv_encoder->crtc Lyude Paul
2026-08-18 23:48 ` [PATCH 1/6] drm/nouveau/kms/nv50-: Move DPCD backlight disable into its own function Lyude Paul
2026-08-19 0:07 ` sashiko-bot
2026-08-19 15:54 ` lyude
2026-08-18 23:48 ` [PATCH 2/6] drm/nouveau/kms/nv50-: Add nv50_outp_get_old_crtc() Lyude Paul
2026-08-18 23:48 ` [PATCH 3/6] drm/nouveau/kms/nv50-: Stop using nv_encoder->crtc in nv50_sor_atomic_disable() Lyude Paul
2026-08-18 23:48 ` [PATCH 4/6] drm/nouveau/kms/nv50-: Stop using nv_encoder->crtc in nv50_disp_atomic_commit_core() Lyude Paul
2026-08-19 0:04 ` sashiko-bot [this message]
2026-08-19 0:10 ` lyude
2026-08-18 23:48 ` [PATCH 5/6] drm/nouveau/kms/nv50-: Add nouveau_encoder->audio.crtc Lyude Paul
2026-08-19 0:10 ` sashiko-bot
2026-08-19 15:56 ` lyude
2026-08-18 23:48 ` [PATCH 6/6] drm/nouveau/kms/nv50-: Obliterate nouveau_encoder->crtc Lyude Paul
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=20260819000424.C885F1F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=lyude@redhat.com \
--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