summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2020-11-17 10:01:42 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2020-11-17 10:01:42 +0000
commita1cc3c4a1d2b95c5f3db31af65488224c4830684 (patch)
tree35b170abd0e7248e8a8a0c9ddbee6704b0bcc54b /sys/dev
parent87c16c992d34427618bbcc3a708d3382559fdc3a (diff)
remove setup_timer() interface linux removed in 2017
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/pci/drm/drm_vblank.c15
-rw-r--r--sys/dev/pci/drm/include/linux/timer.h3
2 files changed, 10 insertions, 8 deletions
diff --git a/sys/dev/pci/drm/drm_vblank.c b/sys/dev/pci/drm/drm_vblank.c
index d7312d42db7..72f4e2696c6 100644
--- a/sys/dev/pci/drm/drm_vblank.c
+++ b/sys/dev/pci/drm/drm_vblank.c
@@ -410,9 +410,9 @@ out:
spin_unlock_irqrestore(&dev->vblank_time_lock, irqflags);
}
-static void vblank_disable_fn(unsigned long arg)
+static void vblank_disable_fn(void *arg)
{
- struct drm_vblank_crtc *vblank = (void *)arg;
+ struct drm_vblank_crtc *vblank = arg;
struct drm_device *dev = vblank->dev;
unsigned int pipe = vblank->pipe;
unsigned long irqflags;
@@ -479,8 +479,11 @@ int drm_vblank_init(struct drm_device *dev, unsigned int num_crtcs)
vblank->dev = dev;
vblank->pipe = i;
init_waitqueue_head(&vblank->queue);
- setup_timer(&vblank->disable_timer, vblank_disable_fn,
- (unsigned long)vblank);
+#ifdef __linux__
+ timer_setup(&vblank->disable_timer, vblank_disable_fn, 0);
+#else
+ timeout_set(&vblank->disable_timer, vblank_disable_fn, vblank);
+#endif
seqlock_init(&vblank->seqlock, IPL_TTY);
}
@@ -1135,7 +1138,7 @@ static void drm_vblank_put(struct drm_device *dev, unsigned int pipe)
if (drm_vblank_offdelay == 0)
return;
else if (drm_vblank_offdelay < 0)
- vblank_disable_fn((unsigned long)vblank);
+ vblank_disable_fn(vblank);
else if (!dev->vblank_disable_immediate)
mod_timer(&vblank->disable_timer,
jiffies + ((drm_vblank_offdelay * HZ)/1000));
@@ -1896,7 +1899,7 @@ bool drm_handle_vblank(struct drm_device *dev, unsigned int pipe)
spin_unlock_irqrestore(&dev->event_lock, irqflags);
if (disable_irq)
- vblank_disable_fn((unsigned long)vblank);
+ vblank_disable_fn(vblank);
return true;
}
diff --git a/sys/dev/pci/drm/include/linux/timer.h b/sys/dev/pci/drm/include/linux/timer.h
index 70e5fb945fe..5fcd73ac696 100644
--- a/sys/dev/pci/drm/include/linux/timer.h
+++ b/sys/dev/pci/drm/include/linux/timer.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: timer.h,v 1.3 2020/07/20 03:15:56 jsg Exp $ */
+/* $OpenBSD: timer.h,v 1.4 2020/11/17 10:01:41 jsg Exp $ */
/*
* Copyright (c) 2013, 2014, 2015 Mark Kettenis
*
@@ -24,7 +24,6 @@
#include <sys/kernel.h>
#include <linux/ktime.h>
-#define setup_timer(x, y, z) timeout_set((x), (void (*)(void *))(y), (void *)(z))
#define mod_timer(x, y) timeout_add((x), (y - jiffies))
#define mod_timer_pinned(x, y) timeout_add((x), (y - jiffies))
#define del_timer_sync(x) timeout_del_barrier((x))