Skip to content

Commit 456c4f5

Browse files
committed
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
1 parent 9e9bc6b commit 456c4f5

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

  • drivers/gpu/drm/nouveau/dispnv50

drivers/gpu/drm/nouveau/dispnv50/head.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ nv50_head_flush_clr(struct nv50_head *head,
4343
union nv50_head_atom_mask clr = {
4444
.mask = asyh->clr.mask & ~(flush ? 0 : asyh->set.mask),
4545
};
46+
47+
lockdep_assert_held(&head->disp->mutex);
48+
4649
if (clr.crc) nv50_crc_atomic_clr(head);
4750
if (clr.olut) head->func->olut_clr(head);
4851
if (clr.core) head->func->core_clr(head);
@@ -65,6 +68,8 @@ nv50_head_flush_set_wndw(struct nv50_head *head, struct nv50_head_atom *asyh)
6568
void
6669
nv50_head_flush_set(struct nv50_head *head, struct nv50_head_atom *asyh)
6770
{
71+
lockdep_assert_held(&head->disp->mutex);
72+
6873
if (asyh->set.view ) head->func->view (head, asyh);
6974
if (asyh->set.mode ) head->func->mode (head, asyh);
7075
if (asyh->set.core ) head->func->core_set(head, asyh);

0 commit comments

Comments
 (0)