From 16c1a87580af89be02e7e6c1898f18b36829e007 Mon Sep 17 00:00:00 2001 From: Robert Noland Date: Wed, 13 Aug 2008 17:05:59 -0400 Subject: i915: Move spinlock init / destroy to load / unload time. This resolves the panic on FreeBSD during VT switch, without attempting any of the more lofty goals for the time being. --- shared-core/i915_dma.c | 6 ++++++ shared-core/i915_irq.c | 2 -- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'shared-core') diff --git a/shared-core/i915_dma.c b/shared-core/i915_dma.c index 5811fa3c..34d9355d 100644 --- a/shared-core/i915_dma.c +++ b/shared-core/i915_dma.c @@ -1073,6 +1073,9 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags) i915_gem_load(dev); + DRM_SPININIT(&dev_priv->swaps_lock, "swap"); + DRM_SPININIT(&dev_priv->user_irq_lock, "userirq"); + #ifdef __linux__ #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,25) intel_init_chipset_flush_compat(dev); @@ -1100,6 +1103,9 @@ int i915_driver_unload(struct drm_device *dev) drm_rmmap(dev, dev_priv->mmio_map); + DRM_SPINUNINIT(&dev_priv->swaps_lock); + DRM_SPINUNINIT(&dev_priv->user_irq_lock); + #ifdef __linux__ #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,25) intel_opregion_free(dev); diff --git a/shared-core/i915_irq.c b/shared-core/i915_irq.c index 418e0ae9..89264ae2 100644 --- a/shared-core/i915_irq.c +++ b/shared-core/i915_irq.c @@ -948,11 +948,9 @@ int i915_driver_irq_postinstall(struct drm_device * dev) drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; int ret, num_pipes = 2; - DRM_SPININIT(&dev_priv->swaps_lock, "swap"); INIT_LIST_HEAD(&dev_priv->vbl_swaps.head); dev_priv->swaps_pending = 0; - DRM_SPININIT(&dev_priv->user_irq_lock, "userirq"); dev_priv->user_irq_refcount = 0; dev_priv->irq_mask_reg = ~0; -- cgit v1.2.3