Diff from blambert@, double ok@ kettenis.
-/* $OpenBSD: i915_drv.c,v 1.68 2014/10/25 14:20:09 kettenis Exp $ */
+/* $OpenBSD: i915_drv.c,v 1.69 2014/12/20 16:34:27 krw Exp $ */
/*
* Copyright (c) 2008-2009 Owain G. Ainsworth <oga@openbsd.org>
*
dev_priv->switchcb = cb;
dev_priv->switchcbarg = cbarg;
if (cb) {
- workq_queue_task(NULL, &dev_priv->switchwqt, 0,
- inteldrm_doswitch, v, cookie);
+ dev_priv->switchcookie = cookie;
+ task_add(systq, &dev_priv->switchtask);
return (EAGAIN);
}
}
void
-inteldrm_doswitch(void *v, void *cookie)
+inteldrm_doswitch(void *v, void *dummy)
{
struct inteldrm_softc *dev_priv = v;
struct rasops_info *ri = &dev_priv->ro;
struct drm_device *dev = (struct drm_device *)dev_priv->drmdev;
- rasops_show_screen(ri, cookie, 0, NULL, NULL);
+ rasops_show_screen(ri, dev_priv->switchcookie, 0, NULL, NULL);
intel_fb_restore_mode(dev);
if (dev_priv->switchcb)
mtx_init(&dev_priv->error_completion_lock, IPL_NONE);
rw_init(&dev_priv->rps.hw_lock, "rpshw");
+ task_set(&dev_priv->switchtask, inteldrm_doswitch, dev_priv, NULL);
+
/* we need to use this api for now due to sharing with intagp */
bar = vga_pci_bar_info(vga_sc, (IS_I9XX(dev) ? 0 : 1));
if (bar == NULL) {
-/* $OpenBSD: i915_drv.h,v 1.53 2014/11/06 05:48:42 jsg Exp $ */
+/* $OpenBSD: i915_drv.h,v 1.54 2014/12/20 16:34:27 krw Exp $ */
/* i915_drv.h -- Private header for the I915 driver -*- linux-c -*-
*/
/*
int nscreens;
void (*switchcb)(void *, int, int);
void *switchcbarg;
- struct workq_task switchwqt;
+ void *switchcookie;
+ struct task switchtask;
struct rasops_info ro;
int sc_offset;
-/* $OpenBSD: radeon.h,v 1.8 2014/04/07 06:43:11 jsg Exp $ */
+/* $OpenBSD: radeon.h,v 1.9 2014/12/20 16:34:27 krw Exp $ */
/*
* Copyright 2008 Advanced Micro Devices, Inc.
* Copyright 2008 Red Hat Inc.
void (*switchcb)(void *, int, int);
void *switchcbarg;
- struct workq_task switchwqt;
+ void *switchcookie;
+ struct task switchtask;
struct rasops_info ro;
int console;
-/* $OpenBSD: radeon_kms.c,v 1.30 2014/10/25 14:20:09 kettenis Exp $ */
+/* $OpenBSD: radeon_kms.c,v 1.31 2014/12/20 16:34:27 krw Exp $ */
/*
* Copyright 2008 Advanced Micro Devices, Inc.
* Copyright 2008 Red Hat Inc.
rdev->switchcb = cb;
rdev->switchcbarg = cbarg;
+ rdev->switchcookie = cookie;
if (cb) {
- workq_queue_task(NULL, &rdev->switchwqt, 0,
- radeondrm_doswitch, v, cookie);
+ task_add(systq, &rdev->switchtask);
return (EAGAIN);
}
}
void
-radeondrm_doswitch(void *v, void *cookie)
+radeondrm_doswitch(void *v, void *dummy)
{
struct rasops_info *ri = v;
struct radeon_device *rdev = ri->ri_hw;
struct radeon_crtc *radeon_crtc;
int i, crtc;
- rasops_show_screen(ri, cookie, 0, NULL, NULL);
+ rasops_show_screen(ri, rdev->switchcookie, 0, NULL, NULL);
for (crtc = 0; crtc < rdev->num_crtc; crtc++) {
for (i = 0; i < 256; i++) {
radeon_crtc = rdev->mode_info.crtcs[crtc];
struct wsemuldisplaydev_attach_args aa;
struct rasops_info *ri = &rdev->ro;
+ task_set(&rdev->switchtask, radeondrm_doswitch, ri, NULL);
+
if (ri->ri_bits == NULL)
return;