Move initialisation of the irq spinlock into the device handling code,

at least the Intel driver depends on it whether the IRQ is currently
enabled or not.
This commit is contained in:
joerg 2009-04-17 19:02:33 +00:00
parent 6655a8f4e6
commit 95021059eb
2 changed files with 7 additions and 7 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: drm_drv.c,v 1.22 2009/01/31 13:49:29 bouyer Exp $ */
/* $NetBSD: drm_drv.c,v 1.23 2009/04/17 19:02:33 joerg Exp $ */
/* drm_drv.h -- Generic driver template -*- linux-c -*-
* Created: Thu Nov 23 03:10:50 2000 by gareth@valinux.com
@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: drm_drv.c,v 1.22 2009/01/31 13:49:29 bouyer Exp $");
__KERNEL_RCSID(0, "$NetBSD: drm_drv.c,v 1.23 2009/04/17 19:02:33 joerg Exp $");
/*
__FBSDID("$FreeBSD: src/sys/dev/drm/drm_drv.c,v 1.6 2006/09/07 23:04:47 anholt Exp $");
*/
@ -302,6 +302,7 @@ static int drm_firstopen(drm_device_t *dev)
int i;
DRM_SPINLOCK_ASSERT(&dev->dev_lock);
DRM_SPININIT(&dev->irq_lock, "DRM IRQ lock");
/* prebuild the SAREA */
i = drm_addmap(dev, 0, SAREA_MAX, _DRM_SHM,
@ -436,6 +437,8 @@ static int drm_lastclose(drm_device_t *dev)
free(filep, M_DRM);
}
DRM_SPINUNINIT(&dev->irq_lock);
return 0;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: drm_irq.c,v 1.16 2008/07/07 00:33:23 mrg Exp $ */
/* $NetBSD: drm_irq.c,v 1.17 2009/04/17 19:02:33 joerg Exp $ */
/* drm_irq.c -- IRQ IOCTL and function support
* Created: Fri Oct 18 2003 by anholt@FreeBSD.org
@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: drm_irq.c,v 1.16 2008/07/07 00:33:23 mrg Exp $");
__KERNEL_RCSID(0, "$NetBSD: drm_irq.c,v 1.17 2009/04/17 19:02:33 joerg Exp $");
/*
__FBSDID("$FreeBSD: src/sys/dev/drm/drm_irq.c,v 1.2 2005/11/28 23:13:52 anholt Exp $");
*/
@ -94,8 +94,6 @@ int drm_irq_install(drm_device_t *dev)
dev->context_flag = 0;
DRM_SPININIT(&dev->irq_lock, "DRM IRQ lock");
/* Before installing handler */
dev->driver.irq_preinstall(dev);
@ -141,7 +139,6 @@ int drm_irq_uninstall(drm_device_t *dev)
dev->driver.irq_uninstall(dev);
pci_intr_disestablish(dev->pa.pa_pc, dev->irqh);
DRM_SPINUNINIT(&dev->irq_lock);
return 0;
}