Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/external/bsd/drm2/dist/drm drm: Fix vblank locking.
details: https://anonhg.NetBSD.org/src/rev/b37e6d296e0c
branches: trunk
changeset: 1028475:b37e6d296e0c
user: riastradh <riastradh%NetBSD.org@localhost>
date: Sun Dec 19 11:08:02 2021 +0000
description:
drm: Fix vblank locking.
diffstat:
sys/external/bsd/drm2/dist/drm/drm_vblank.c | 13 +++++++++++--
1 files changed, 11 insertions(+), 2 deletions(-)
diffs (57 lines):
diff -r e8d3f65f0ff4 -r b37e6d296e0c sys/external/bsd/drm2/dist/drm/drm_vblank.c
--- a/sys/external/bsd/drm2/dist/drm/drm_vblank.c Sun Dec 19 11:07:55 2021 +0000
+++ b/sys/external/bsd/drm2/dist/drm/drm_vblank.c Sun Dec 19 11:08:02 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: drm_vblank.c,v 1.5 2021/12/19 09:52:34 riastradh Exp $ */
+/* $NetBSD: drm_vblank.c,v 1.6 2021/12/19 11:08:02 riastradh Exp $ */
/*
* drm_irq.c IRQ and vblank support
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: drm_vblank.c,v 1.5 2021/12/19 09:52:34 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: drm_vblank.c,v 1.6 2021/12/19 11:08:02 riastradh Exp $");
#include <linux/export.h>
#include <linux/moduleparam.h>
@@ -167,6 +167,8 @@
ktime_t t_vblank;
int count = DRM_TIMESTAMP_MAXRETRIES;
+ assert_spin_locked(&dev->vbl_lock);
+
spin_lock(&dev->vblank_time_lock);
/*
@@ -218,6 +220,8 @@
int framedur_ns = vblank->framedur_ns;
u32 max_vblank_count = drm_max_vblank_count(dev, pipe);
+ assert_spin_locked(&dev->vbl_lock);
+
/*
* Interrupts were disabled prior to this call, so deal with counter
* wrap if needed.
@@ -1832,8 +1836,11 @@
*/
spin_lock(&dev->vblank_time_lock);
+ spin_lock(&dev->vbl_lock);
+
/* Vblank irq handling disabled. Nothing to do. */
if (!vblank->enabled) {
+ spin_unlock(&dev->vbl_lock);
spin_unlock(&dev->vblank_time_lock);
spin_unlock_irqrestore(&dev->event_lock, irqflags);
return false;
@@ -1858,6 +1865,8 @@
drm_vblank_offdelay > 0 &&
!atomic_read(&vblank->refcount));
+ spin_unlock(&dev->vbl_lock);
+
drm_handle_vblank_events(dev, pipe);
spin_unlock_irqrestore(&dev->event_lock, irqflags);
Home |
Main Index |
Thread Index |
Old Index