drm/nouveau/kms/nv50-: Fix locking for audio callbacks
authorLyude Paul <lyude@redhat.com>
Sat, 14 Nov 2020 00:14:17 +0000 (19:14 -0500)
committerBen Skeggs <bskeggs@redhat.com>
Fri, 29 Jan 2021 06:49:14 +0000 (16:49 +1000)
commit9125e2422c8bae372e21bd6e613767e4a0dd9b2e
treef31978e655f0e795e35f35e34b4ba2438bf1e81c
parentb2b402789bb7897e6defb7e63f1570d9de439a13
drm/nouveau/kms/nv50-: Fix locking for audio callbacks

Noticed that I wasn't paying close enough attention the last time I looked
at our audio callbacks, as I completely missed the fact that we were
figuring out which audio-enabled connector goes to each encoder by checking
it's state, but without grabbing any of the appropriate modesetting locks
to do so.

That being said however: trying to grab modesetting locks in our audio
callbacks would be very painful due to the potential for locking inversion
between HDA and DRM. So, let's instead just copy what i915 does again - add
our own audio lock to protect audio related state, and store each audio
enabled connector in each nouveau_encoder struct so that we don't need to
check any atomic states.

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