From 0cf1887139eb1ce18d09f7be0567aa93d802040d Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Sun, 19 Oct 2003 23:35:58 +0000 Subject: - SMPng lock the DRM. This is only partial -- there are a few code paths used by root (the X Server) which are not locked. However, it should deal with lost-IRQ issues on -current which I think people have been experiencing but I am unable to reproduce (though I understand why they would occur, because of a bug of mine). Note that most of the locking (DRM_LOCK()/UNLOCK()) is all covered by Giant still, so it doesn't matter yet. - Remove locking on FreeBSD-stable and NetBSD. These are covered by the fact that there is no reentrancy of the kernel except by interrupts, which are locked using spldrm()/splx() instead. --- bsd/drm_dma.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'bsd/drm_dma.h') diff --git a/bsd/drm_dma.h b/bsd/drm_dma.h index d5852403..8d87c38a 100644 --- a/bsd/drm_dma.h +++ b/bsd/drm_dma.h @@ -51,6 +51,8 @@ int DRM(dma_setup)( drm_device_t *dev ) if (dev->dma == NULL) return DRM_ERR(ENOMEM); + DRM_SPININIT(dev->dma_lock, "drmdma"); + return 0; } @@ -59,7 +61,8 @@ void DRM(dma_takedown)(drm_device_t *dev) drm_device_dma_t *dma = dev->dma; int i, j; - if (!dma) return; + if (dma == NULL) + return; /* Clear dma buffers */ for (i = 0; i <= DRM_MAX_ORDER; i++) { @@ -106,6 +109,7 @@ void DRM(dma_takedown)(drm_device_t *dev) DRM_MEM_PAGES); DRM(free)(dev->dma, sizeof(*dev->dma), DRM_MEM_DRIVER); dev->dma = NULL; + DRM_SPINUNINIT(dev->dma_lock); } -- cgit v1.2.3