This is wrong and I only just noticed it before getting ready to finish up work - whether we need to use the new or old state depends on if we're enabling or disabling - otherwise we'll end up with an unexpected !nv_crtc
Will send a respin of this tomorrow On Tue, 2026-08-18 at 19:48 -0400, Lyude Paul wrote: > 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 <[email protected]> > Reported-by: Marek Czernohous <[email protected]> > --- > 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) {
