[PATCH 4/6] drm/nouveau/kms/nv50-: Stop using nv_encoder->crtc in nv50_disp_atomic_commit_core()

From: Lyude Paul

Date: Tue Aug 18 2026 - 19:58:09 EST


Another leftover spot where we still use nv_encoder->crtc. Get rid of it
and do the right thing: get the currently assigned CRTC from the new atomic
state.

Signed-off-by: Lyude Paul <lyude@xxxxxxxxxx>
Reported-by: Marek Czernohous <marek@xxxxxxxxxxxxx>
---
drivers/gpu/drm/nouveau/dispnv50/disp.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)

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;

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) {
--
2.55.0