summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorOwain Ainsworth <oga@cvs.openbsd.org>2008-05-27 19:39:53 +0000
committerOwain Ainsworth <oga@cvs.openbsd.org>2008-05-27 19:39:53 +0000
commit4693825cfdff47538bcc0abb60cb0cbce68079a3 (patch)
tree79fcf6fb5325be45a3c51b137e215b2c0f5dbb2d /sys
parentecd873ee1ede63593afa42b0bc60c2fb9cddd692 (diff)
When i first ported the drm, i completely misunderstood the FreeBSD taskqueue
api. So drm_locked_tasklet() is wrong. Fix this up to be at least mostly correct.
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/pci/drm/drmP.h14
-rw-r--r--sys/dev/pci/drm/drm_irq.c27
-rw-r--r--sys/dev/pci/drm/i915_irq.c6
3 files changed, 13 insertions, 34 deletions
diff --git a/sys/dev/pci/drm/drmP.h b/sys/dev/pci/drm/drmP.h
index d421372a735..0d951fb9fb4 100644
--- a/sys/dev/pci/drm/drmP.h
+++ b/sys/dev/pci/drm/drmP.h
@@ -931,12 +931,8 @@ struct drm_device {
#if defined(__FreeBSD__)
struct task locked_task;
- void (*locked_task_call)(drm_device_t *dev);
-#elif defined(__OpenBSD__)
- void (*locked_task_call)(void*, void*);
-#else
- /* add for other OSen */
#endif
+ void (*locked_task_call)(drm_device_t *dev);
};
extern int drm_debug_flag;
@@ -1121,13 +1117,7 @@ int drm_dma(drm_device_t *dev, void *data, struct drm_file *file_priv);
/* IRQ support (drm_irq.c) */
int drm_control(drm_device_t *dev, void *data, struct drm_file *file_priv);
int drm_wait_vblank(drm_device_t *dev, void *data, struct drm_file *file_priv);
-#ifdef __FreeBSD__
-void drm_locked_tasklet(drm_device_t *dev,
- void (*tasklet)(drm_device_t *dev));
-#else
-void drm_locked_tasklet(drm_device_t *dev,
- void (*tasklet)(void *dev, void*));
-#endif
+void drm_locked_tasklet(drm_device_t *dev, void (*tasklet)(drm_device_t *dev));
/* AGP/GART support (drm_agpsupport.c) */
int drm_agp_acquire_ioctl(drm_device_t *dev, void *data, struct drm_file *file_priv);
diff --git a/sys/dev/pci/drm/drm_irq.c b/sys/dev/pci/drm/drm_irq.c
index a1573c723a3..251c67af4c1 100644
--- a/sys/dev/pci/drm/drm_irq.c
+++ b/sys/dev/pci/drm/drm_irq.c
@@ -37,9 +37,11 @@
irqreturn_t drm_irq_handler_wrap(DRM_IRQ_ARGS);
-#if 0
-void drm_locked_task(void *context, int pending __unused);
-#endif /* 0 */
+#ifdef __OpenBSD__
+void drm_locked_task(void *context, void *pending);
+#else
+void drm_locked_task(void *context, int pending __unused);
+#endif
int
drm_irq_by_busid(drm_device_t *dev, void *data, struct drm_file *file_priv)
@@ -344,9 +346,12 @@ drm_vbl_send_signals( drm_device_t *dev )
}
#endif
-#if 0 /* disabled while it's unused anywhere */
void
+#ifdef __OpenBSD__
+drm_locked_task(void *context, void *pending)
+#else
drm_locked_task(void *context, int pending __unused)
+#endif
{
drm_device_t *dev = context;
@@ -373,29 +378,19 @@ drm_locked_task(void *context, int pending __unused)
}
DRM_UNLOCK();
-#ifdef __FreeBSD__
dev->locked_task_call(dev);
-#elif defined (__OpenBSD__)
- dev->locked_task_call(dev,NULL);
-#endif
drm_lock_free(dev, &dev->lock.hw_lock->lock, DRM_KERNEL_CONTEXT);
}
-#endif /* disabled due to lack of use */
-
void
-#ifdef __FreeBSD__
drm_locked_tasklet(drm_device_t *dev, void (*tasklet)(drm_device_t *dev))
-#else
-drm_locked_tasklet(drm_device_t *dev, void (*tasklet)(void* dev, void*))
-#endif
{
dev->locked_task_call = tasklet;
#ifdef __FreeBSD__
taskqueue_enqueue(taskqueue_swi, &dev->locked_task);
#else
- workq_add_task(NULL, WQ_WAITOK, dev->locked_task_call,
- dev, NULL);
+ if (workq_add_task(NULL, 0, drm_locked_task, dev, NULL) == ENOMEM)
+ DRM_ERROR("error adding task to workq\n");
#endif
}
diff --git a/sys/dev/pci/drm/i915_irq.c b/sys/dev/pci/drm/i915_irq.c
index 27c25d5bb4d..2c699ecd34c 100644
--- a/sys/dev/pci/drm/i915_irq.c
+++ b/sys/dev/pci/drm/i915_irq.c
@@ -109,14 +109,8 @@ i915_dispatch_vsync_flip(struct drm_device *dev, struct drm_drawable_info *drw,
*
* This function will be called with the HW lock held.
*/
-#ifdef __OpenBSD__
-static void i915_vblank_tasklet(void * kdev, void * unused)
-{
- struct drm_device *dev = (struct drm_device *)kdev;
-#else
static void i915_vblank_tasklet(struct drm_device *dev)
{
-#endif
drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
struct list_head *list, *tmp, hits, *hit;
int nhits, nrects, slice[2], upper[2], lower[2], i, num_pages;