From 92db308cca1dc8968eaf6ae4fc41dd62b95a8931 Mon Sep 17 00:00:00 2001 From: Owain Ainsworth Date: Tue, 12 May 2009 19:47:55 +0000 Subject: hold the mutex in drm_handle_vblank(). Ideally we could avoid this and still be mpsafe using atomic increment/decrement operators, but for now best be correct. --- sys/dev/pci/drm/drm_irq.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sys/dev/pci/drm/drm_irq.c b/sys/dev/pci/drm/drm_irq.c index 7ba4bf0da4d..8f0e3cd7ea9 100644 --- a/sys/dev/pci/drm/drm_irq.c +++ b/sys/dev/pci/drm/drm_irq.c @@ -368,6 +368,12 @@ drm_wait_vblank(struct drm_device *dev, void *data, struct drm_file *file_priv) void drm_handle_vblank(struct drm_device *dev, int crtc) { + /* + * XXX if we had proper atomic operations this mutex wouldn't + * XXX need to be held. + */ + mtx_enter(&dev->vblank->vb_lock); dev->vblank->vb_crtcs[crtc].vbl_count++; wakeup(&dev->vblank->vb_crtcs[crtc]); + mtx_leave(&dev->vblank->vb_lock); } -- cgit v1.2.3