Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/nouveau/kms/nv50-: Assert we hold nv50_disp->lock in nv50_head_flush_*

Now that we've had one bug that occurred in nouveau as the result of
nv50_head_flush_* being called without the appropriate locks, let's add
some lockdep asserts to make sure this doesn't happen in the future.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Lyude Paul <lyude@redhat.com>
Link: https://patch.msgid.link/20251219215344.170852-3-lyude@redhat.com

+5
+5
drivers/gpu/drm/nouveau/dispnv50/head.c
··· 43 43 union nv50_head_atom_mask clr = { 44 44 .mask = asyh->clr.mask & ~(flush ? 0 : asyh->set.mask), 45 45 }; 46 + 47 + lockdep_assert_held(&head->disp->mutex); 48 + 46 49 if (clr.crc) nv50_crc_atomic_clr(head); 47 50 if (clr.olut) head->func->olut_clr(head); 48 51 if (clr.core) head->func->core_clr(head); ··· 68 65 void 69 66 nv50_head_flush_set(struct nv50_head *head, struct nv50_head_atom *asyh) 70 67 { 68 + lockdep_assert_held(&head->disp->mutex); 69 + 71 70 if (asyh->set.view ) head->func->view (head, asyh); 72 71 if (asyh->set.mode ) head->func->mode (head, asyh); 73 72 if (asyh->set.core ) head->func->core_set(head, asyh);