OSDN Git Service

drm/nouveau/kms/nv50-: Lookup current encoder/crtc from atomic state
authorLyude Paul <lyude@redhat.com>
Sat, 14 Nov 2020 00:14:15 +0000 (19:14 -0500)
committerBen Skeggs <bskeggs@redhat.com>
Fri, 29 Jan 2021 06:49:14 +0000 (16:49 +1000)
commit1b38cf6b03e92eac993f49419904a3e441d647e4
treeaa33091e3827b79a7ece3b40986dd01352a25457
parentcd5609f715aa3a02c800097f50e83cc79346add8
drm/nouveau/kms/nv50-: Lookup current encoder/crtc from atomic state

Despite being an atomic driver, nouveau has a lot of leftover code that
relies on retrieving information regarding the new atomic state from
members of drm_encoder and drm_crtc. The first field being used,
drm_encoder.crtc, is deprecated for atomic drivers. The second field being
used is drm_crtc.state, which is only really sensible to use outside of an
atomic modeset.

So, add some helpers to lookup the current crtc for a given outp from the
atomic state. Then, convert most of the code in dispnv50/disp.c to use said
new helper, along with the relevant DRM atomic helpers for retrieving the
new encoder/crtc combinations for a new atomic state.

Note that we don't get rid of the nouveau_encoder.crtc field entirely for
three reasons:

- Legacy modesetting for pre-nv50 still uses it
- It doesn't cause any locking issues
- We need it for the HDA callbacks, as grabbing atomic modesetting locks in
  those would be a mess.

Signed-off-by: Lyude Paul <lyude@redhat.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/dispnv50/disp.c