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]>

---
V2:
* Only grab the new CRTC for an outp if we're enabling it, which guarantees
  that we have the CRTC's atomic state present in the current atomic
  commit (also removing the need for a NULL check).

 drivers/gpu/drm/nouveau/dispnv50/disp.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/nouveau/dispnv50/disp.c 
b/drivers/gpu/drm/nouveau/dispnv50/disp.c
index f19820dc055ae..d038743d1382a 100644
--- a/drivers/gpu/drm/nouveau/dispnv50/disp.c
+++ b/drivers/gpu/drm/nouveau/dispnv50/disp.c
@@ -2173,7 +2173,8 @@ nv50_disp_atomic_commit_core(struct drm_atomic_commit 
*state, u32 *interlock)
                        struct nouveau_encoder *nv_encoder = 
nouveau_encoder(outp->encoder);
 
                        if (outp->enabled) {
-                               nv50_audio_enable(outp->encoder, 
nouveau_crtc(nv_encoder->crtc),
+                               nv50_audio_enable(outp->encoder,
+                                                 nv50_outp_get_new_crtc(state, 
nv_encoder),
                                                  nv_encoder->conn, NULL, NULL);
                                outp->enabled = outp->disabled = false;
                        } else {
-- 
2.55.0

Reply via email to