This commit is contained in:
bjs 2008-05-19 00:15:44 +00:00
parent ee9ac5c71f
commit f790bea856
7 changed files with 38 additions and 50 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: i915_irq.c,v 1.4 2008/05/18 02:45:17 bjs Exp $ */
/* $NetBSD: i915_irq.c,v 1.5 2008/05/19 00:15:44 bjs Exp $ */
/* i915_irq.c -- IRQ support for the I915 -*- linux-c -*-
*/
@ -29,7 +29,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: i915_irq.c,v 1.4 2008/05/18 02:45:17 bjs Exp $");
__KERNEL_RCSID(0, "$NetBSD: i915_irq.c,v 1.5 2008/05/19 00:15:44 bjs Exp $");
/*
__FBSDID("$FreeBSD: src/sys/dev/drm/i915_irq.c,v 1.4 2006/09/07 23:04:47 anholt Exp $");
*/
@ -67,11 +67,11 @@ irqreturn_t i915_driver_irq_handler(DRM_IRQ_ARGS)
dev_priv->sarea_priv->last_dispatch = READ_BREADCRUMB(dev_priv);
if (temp & USER_INT_FLAG)
DRM_WAKEUP(&(dev_priv->irq_queue));
DRM_WAKEUP(&dev_priv->irq_queue);
if (temp & (VSYNC_PIPEA_FLAG | VSYNC_PIPEB_FLAG)) {
atomic_inc(&dev->vbl_received);
DRM_WAKEUP(&(dev->vbl_queue));
DRM_WAKEUP(&dev->vbl_queue);
drm_vbl_send_signals(dev);
}
@ -121,7 +121,7 @@ static int i915_wait_irq(drm_device_t * dev, int irq_nr)
dev_priv->sarea_priv->perf_boxes |= I915_BOX_WAIT;
DRM_WAIT_ON(ret, &(dev_priv->irq_queue), 3 * DRM_HZ,
DRM_WAIT_ON(ret, dev_priv->irq_queue, 3 * DRM_HZ,
READ_BREADCRUMB(dev_priv) >= irq_nr);
if (ret == DRM_ERR(EBUSY)) {
@ -145,7 +145,7 @@ int i915_driver_vblank_wait(drm_device_t *dev, unsigned int *sequence)
return DRM_ERR(EINVAL);
}
DRM_WAIT_ON(ret, &(dev->vbl_queue), 3 * DRM_HZ,
DRM_WAIT_ON(ret, dev->vbl_queue, 3 * DRM_HZ,
(((cur_vblank = atomic_read(&dev->vbl_received))
- *sequence) <= (1<<23)));
@ -280,7 +280,7 @@ void i915_driver_irq_postinstall(drm_device_t * dev)
drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
i915_enable_interrupt(dev);
DRM_INIT_WAITQUEUE(&(dev_priv->irq_queue));
DRM_INIT_WAITQUEUE(&dev_priv->irq_queue);
}
void i915_driver_irq_uninstall(drm_device_t * dev)
@ -296,5 +296,4 @@ void i915_driver_irq_uninstall(drm_device_t * dev)
temp = I915_READ16(I915REG_INT_IDENTITY_R);
I915_WRITE16(I915REG_INT_IDENTITY_R, temp);
DRM_DESTROY_WAITQUEUE(&(dev_priv->irq_queue));
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: mach64_irq.c,v 1.4 2008/05/18 02:45:17 bjs Exp $ */
/* $NetBSD: mach64_irq.c,v 1.5 2008/05/19 00:15:44 bjs Exp $ */
/* mach64_irq.c -- IRQ handling for ATI Mach64 -*- linux-c -*-
* Created: Tue Feb 25, 2003 by Leif Delgass, based on radeon_irq.c/r128_irq.c
@ -38,7 +38,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: mach64_irq.c,v 1.4 2008/05/18 02:45:17 bjs Exp $");
__KERNEL_RCSID(0, "$NetBSD: mach64_irq.c,v 1.5 2008/05/19 00:15:44 bjs Exp $");
/*
__FBSDID("$FreeBSD: src/sys/dev/drm/mach64_irq.c,v 1.2 2005/11/28 23:13:53 anholt Exp $");
*/
@ -71,7 +71,7 @@ irqreturn_t mach64_driver_irq_handler(DRM_IRQ_ARGS)
| MACH64_CRTC_VBLANK_INT);
atomic_inc(&dev->vbl_received);
DRM_WAKEUP(&(dev->vbl_queue));
DRM_WAKEUP(&dev->vbl_queue);
drm_vbl_send_signals(dev);
return IRQ_HANDLED;
}
@ -87,7 +87,7 @@ int mach64_driver_vblank_wait(drm_device_t * dev, unsigned int *sequence)
* by about a day rather than she wants to wait for years
* using vertical blanks...
*/
DRM_WAIT_ON(ret, &(dev->vbl_queue), 3 * DRM_HZ,
DRM_WAIT_ON(ret, dev->vbl_queue, 3 * DRM_HZ,
(((cur_vblank = atomic_read(&dev->vbl_received))
- *sequence) <= (1 << 23)));

View File

@ -1,4 +1,4 @@
/* $NetBSD: mga_irq.c,v 1.4 2008/05/18 02:45:17 bjs Exp $ */
/* $NetBSD: mga_irq.c,v 1.5 2008/05/19 00:15:44 bjs Exp $ */
/* mga_irq.c -- IRQ handling for radeon -*- linux-c -*-
*/
@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: mga_irq.c,v 1.4 2008/05/18 02:45:17 bjs Exp $");
__KERNEL_RCSID(0, "$NetBSD: mga_irq.c,v 1.5 2008/05/19 00:15:44 bjs Exp $");
/*
__FBSDID("$FreeBSD: src/sys/dev/drm/mga_irq.c,v 1.6 2005/11/28 23:13:53 anholt Exp $");
*/
@ -57,7 +57,7 @@ irqreturn_t mga_driver_irq_handler(DRM_IRQ_ARGS)
if (status & MGA_VLINEPEN) {
MGA_WRITE(MGA_ICLEAR, MGA_VLINEICLR);
atomic_inc(&dev->vbl_received);
DRM_WAKEUP(&(dev->vbl_queue));
DRM_WAKEUP(&dev->vbl_queue);
drm_vbl_send_signals(dev);
handled = 1;
}
@ -78,7 +78,7 @@ irqreturn_t mga_driver_irq_handler(DRM_IRQ_ARGS)
}
atomic_inc(&dev_priv->last_fence_retired);
DRM_WAKEUP(&(dev_priv->fence_queue));
DRM_WAKEUP(&dev_priv->fence_queue);
handled = 1;
}
@ -97,7 +97,7 @@ int mga_driver_vblank_wait(drm_device_t * dev, unsigned int *sequence)
* by about a day rather than she wants to wait for years
* using vertical blanks...
*/
DRM_WAIT_ON(ret, &(dev->vbl_queue), 3 * DRM_HZ,
DRM_WAIT_ON(ret, dev->vbl_queue, 3 * DRM_HZ,
(((cur_vblank = atomic_read(&dev->vbl_received))
- *sequence) <= (1 << 23)));
@ -116,7 +116,7 @@ int mga_driver_fence_wait(drm_device_t * dev, unsigned int *sequence)
* by about a day rather than she wants to wait for years
* using fences.
*/
DRM_WAIT_ON(ret, &(dev_priv->fence_queue), 3 * DRM_HZ,
DRM_WAIT_ON(ret, dev_priv->fence_queue, 3 * DRM_HZ,
(((cur_fence = atomic_read(&dev_priv->last_fence_retired))
- *sequence) <= (1 << 23)));
@ -139,7 +139,7 @@ void mga_driver_irq_postinstall(drm_device_t * dev)
{
drm_mga_private_t *dev_priv = (drm_mga_private_t *) dev->dev_private;
DRM_INIT_WAITQUEUE( &(dev_priv->fence_queue) );
DRM_INIT_WAITQUEUE( &dev_priv->fence_queue );
/* Turn on vertical blank interrupt and soft trap interrupt. */
MGA_WRITE(MGA_IEN, MGA_VLINEIEN | MGA_SOFTRAPEN);
@ -153,7 +153,6 @@ void mga_driver_irq_uninstall(drm_device_t * dev)
/* Disable *all* interrupts */
MGA_WRITE(MGA_IEN, 0);
DRM_DESTROY_WAITQUEUE(&(dev_priv->fence_queue));
dev->irq_enabled = 0;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: r128_irq.c,v 1.4 2008/05/18 02:45:17 bjs Exp $ */
/* $NetBSD: r128_irq.c,v 1.5 2008/05/19 00:15:44 bjs Exp $ */
/* r128_irq.c -- IRQ handling for radeon -*- linux-c -*-
*/
@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: r128_irq.c,v 1.4 2008/05/18 02:45:17 bjs Exp $");
__KERNEL_RCSID(0, "$NetBSD: r128_irq.c,v 1.5 2008/05/19 00:15:44 bjs Exp $");
/*
__FBSDID("$FreeBSD: src/sys/dev/drm/r128_irq.c,v 1.6 2005/11/28 23:13:53 anholt Exp $");
*/
@ -72,7 +72,7 @@ int r128_driver_vblank_wait(drm_device_t * dev, unsigned int *sequence)
* by about a day rather than she wants to wait for years
* using vertical blanks...
*/
DRM_WAIT_ON(ret, &(dev->vbl_queue), 3 * DRM_HZ,
DRM_WAIT_ON(ret, dev->vbl_queue, 3 * DRM_HZ,
(((cur_vblank = atomic_read(&dev->vbl_received))
- *sequence) <= (1 << 23)));

View File

@ -1,4 +1,4 @@
/* $NetBSD: radeon_irq.c,v 1.5 2008/05/18 02:45:17 bjs Exp $ */
/* $NetBSD: radeon_irq.c,v 1.6 2008/05/19 00:15:44 bjs Exp $ */
/* radeon_irq.c -- IRQ handling for radeon -*- linux-c -*- */
/*-
@ -33,7 +33,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: radeon_irq.c,v 1.5 2008/05/18 02:45:17 bjs Exp $");
__KERNEL_RCSID(0, "$NetBSD: radeon_irq.c,v 1.6 2008/05/19 00:15:44 bjs Exp $");
/*
__FBSDID("$FreeBSD: src/sys/dev/drm/radeon_irq.c,v 1.7 2005/11/28 23:13:54 anholt Exp $");
*/
@ -87,13 +87,13 @@ irqreturn_t radeon_driver_irq_handler(DRM_IRQ_ARGS)
/* SW interrupt */
if (stat & RADEON_SW_INT_TEST) {
DRM_WAKEUP(&(dev_priv->swi_queue));
DRM_WAKEUP(&dev_priv->swi_queue);
}
/* VBLANK interrupt */
if (stat & RADEON_CRTC_VBLANK_STAT) {
atomic_inc(&dev->vbl_received);
DRM_WAKEUP(&(dev->vbl_queue));
DRM_WAKEUP(&dev->vbl_queue);
drm_vbl_send_signals(dev);
}
@ -129,7 +129,7 @@ static int radeon_wait_irq(drm_device_t * dev, int swi_nr)
dev_priv->stats.boxes |= RADEON_BOX_WAIT_IDLE;
DRM_WAIT_ON(ret, &(dev_priv->swi_queue), 3 * DRM_HZ,
DRM_WAIT_ON(ret, dev_priv->swi_queue, 3 * DRM_HZ,
RADEON_READ(RADEON_LAST_SWI_REG) >= swi_nr);
return ret;
@ -155,7 +155,7 @@ int radeon_driver_vblank_wait(drm_device_t * dev, unsigned int *sequence)
* by about a day rather than she wants to wait for years
* using vertical blanks...
*/
DRM_WAIT_ON(ret, &(dev->vbl_queue), 3 * DRM_HZ,
DRM_WAIT_ON(ret, dev->vbl_queue, 3 * DRM_HZ,
(((cur_vblank = atomic_read(&dev->vbl_received))
- *sequence) <= (1 << 23)));
@ -233,7 +233,7 @@ void radeon_driver_irq_postinstall(drm_device_t * dev)
(drm_radeon_private_t *) dev->dev_private;
atomic_set(&dev_priv->swi_emitted, 0);
DRM_INIT_WAITQUEUE(&(dev_priv->swi_queue));
DRM_INIT_WAITQUEUE(&dev_priv->swi_queue);
/* Turn on SW and VBL ints */
RADEON_WRITE(RADEON_GEN_INT_CNTL,
@ -249,5 +249,4 @@ void radeon_driver_irq_uninstall(drm_device_t * dev)
/* Disable *all* interrupts */
RADEON_WRITE(RADEON_GEN_INT_CNTL, 0);
DRM_DESTROY_WAITQUEUE(&(dev_priv->swi_queue));
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: via_irq.c,v 1.4 2008/05/18 02:45:17 bjs Exp $ */
/* $NetBSD: via_irq.c,v 1.5 2008/05/19 00:15:44 bjs Exp $ */
/* via_irq.c
*
@ -38,7 +38,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: via_irq.c,v 1.4 2008/05/18 02:45:17 bjs Exp $");
__KERNEL_RCSID(0, "$NetBSD: via_irq.c,v 1.5 2008/05/19 00:15:44 bjs Exp $");
#include <dev/drm/drmP.h>
#include <dev/drm/drm.h>
@ -142,7 +142,7 @@ irqreturn_t via_driver_irq_handler(DRM_IRQ_ARGS)
for (i=0; i<dev_priv->num_irqs; ++i) {
if (status & cur_irq->pending_mask) {
atomic_inc( &cur_irq->irq_received );
DRM_WAKEUP( &(cur_irq->irq_queue) );
DRM_WAKEUP( &cur_irq->irq_queue );
handled = 1;
#ifdef VIA_HAVE_DMABLIT
if (dev_priv->irq_map[drm_via_irq_dma0_td] == i) {
@ -196,7 +196,7 @@ int via_driver_vblank_wait(drm_device_t * dev, unsigned int *sequence)
* using vertical blanks...
*/
DRM_WAIT_ON(ret, &(dev->vbl_queue), 3 * DRM_HZ,
DRM_WAIT_ON(ret, dev->vbl_queue, 3 * DRM_HZ,
(((cur_vblank = atomic_read(&dev->vbl_received)) -
*sequence) <= (1 << 23)));
@ -240,12 +240,12 @@ via_driver_irq_wait(drm_device_t * dev, unsigned int irq, int force_sequence,
cur_irq = dev_priv->via_irqs + real_irq;
if (masks[real_irq][2] && !force_sequence) {
DRM_WAIT_ON(ret, &(cur_irq->irq_queue), 3 * DRM_HZ,
DRM_WAIT_ON(ret, cur_irq->irq_queue, 3 * DRM_HZ,
((VIA_READ(masks[irq][2]) & masks[irq][3]) ==
masks[irq][4]));
cur_irq_sequence = atomic_read(&cur_irq->irq_received);
} else {
DRM_WAIT_ON(ret, &(cur_irq->irq_queue), 3 * DRM_HZ,
DRM_WAIT_ON(ret, cur_irq->irq_queue, 3 * DRM_HZ,
(((cur_irq_sequence =
atomic_read(&cur_irq->irq_received)) -
*sequence) <= (1 << 23)));
@ -288,7 +288,7 @@ void via_driver_irq_preinstall(drm_device_t * dev)
atomic_set(&cur_irq->irq_received, 0);
cur_irq->enable_mask = dev_priv->irq_masks[i][0];
cur_irq->pending_mask = dev_priv->irq_masks[i][1];
DRM_INIT_WAITQUEUE( &(cur_irq->irq_queue) );
DRM_INIT_WAITQUEUE( &cur_irq->irq_queue );
dev_priv->irq_enable_mask |= cur_irq->enable_mask;
dev_priv->irq_pending_mask |= cur_irq->pending_mask;
cur_irq++;
@ -330,9 +330,7 @@ void via_driver_irq_postinstall(drm_device_t * dev)
void via_driver_irq_uninstall(drm_device_t * dev)
{
drm_via_private_t *dev_priv = (drm_via_private_t *) dev->dev_private;
drm_via_irq_t *cur_irq;
u32 status;
int i;
DRM_DEBUG("driver_irq_uninstall)\n");
if (dev_priv) {
@ -345,12 +343,6 @@ void via_driver_irq_uninstall(drm_device_t * dev)
status = VIA_READ(VIA_REG_INTERRUPT);
VIA_WRITE(VIA_REG_INTERRUPT, status &
~(VIA_IRQ_VBLANK_ENABLE | dev_priv->irq_enable_mask));
cur_irq = dev_priv->via_irqs;
for(i = 0; i < dev_priv->num_irqs; ++i) {
DRM_DESTROY_WAITQUEUE(&(cur_irq->irq_queue));
cur_irq++;
}
}
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: via_video.c,v 1.4 2008/05/18 02:45:17 bjs Exp $ */
/* $NetBSD: via_video.c,v 1.5 2008/05/19 00:15:44 bjs Exp $ */
/*
* Copyright 2005 Thomas Hellstrom. All Rights Reserved.
@ -28,7 +28,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: via_video.c,v 1.4 2008/05/18 02:45:17 bjs Exp $");
__KERNEL_RCSID(0, "$NetBSD: via_video.c,v 1.5 2008/05/19 00:15:44 bjs Exp $");
#include <dev/drm/drmP.h>
#include <dev/pci/drm/via_drm.h>
@ -67,7 +67,6 @@ void via_release_futex(drm_via_private_t * dev_priv, int context)
}
*lock = 0;
}
DRM_DESTROY_WAITQUEUE(&(dev_priv->decoder_queue[i]));
}
}
@ -92,7 +91,7 @@ int via_decoder_futex(DRM_IOCTL_ARGS)
switch (fx.func) {
case VIA_FUTEX_WAIT:
DRM_WAIT_ON(ret, &(dev_priv->decoder_queue[fx.lock]),
DRM_WAIT_ON(ret, dev_priv->decoder_queue[fx.lock],
(fx.ms / 10) * (DRM_HZ / 100), *lock != fx.val);
return ret;
case VIA_FUTEX_WAKE: