xref: /dflybsd-src/sys/dev/drm/linux_workqueue.c (revision df8db29531d9069464f2126cbc993d5a66445c6e)
1*df8db295SFrançois Tigeot /*
2*df8db295SFrançois Tigeot  * Copyright (c) 2015 François Tigeot
3*df8db295SFrançois Tigeot  * All rights reserved.
4*df8db295SFrançois Tigeot  *
5*df8db295SFrançois Tigeot  * Redistribution and use in source and binary forms, with or without
6*df8db295SFrançois Tigeot  * modification, are permitted provided that the following conditions
7*df8db295SFrançois Tigeot  * are met:
8*df8db295SFrançois Tigeot  * 1. Redistributions of source code must retain the above copyright
9*df8db295SFrançois Tigeot  *    notice unmodified, this list of conditions, and the following
10*df8db295SFrançois Tigeot  *    disclaimer.
11*df8db295SFrançois Tigeot  * 2. Redistributions in binary form must reproduce the above copyright
12*df8db295SFrançois Tigeot  *    notice, this list of conditions and the following disclaimer in the
13*df8db295SFrançois Tigeot  *    documentation and/or other materials provided with the distribution.
14*df8db295SFrançois Tigeot  *
15*df8db295SFrançois Tigeot  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
16*df8db295SFrançois Tigeot  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
17*df8db295SFrançois Tigeot  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
18*df8db295SFrançois Tigeot  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19*df8db295SFrançois Tigeot  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20*df8db295SFrançois Tigeot  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21*df8db295SFrançois Tigeot  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22*df8db295SFrançois Tigeot  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23*df8db295SFrançois Tigeot  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24*df8db295SFrançois Tigeot  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25*df8db295SFrançois Tigeot  */
26*df8db295SFrançois Tigeot 
27*df8db295SFrançois Tigeot #include <drm/drmP.h>
28*df8db295SFrançois Tigeot #include <linux/workqueue.h>
29*df8db295SFrançois Tigeot 
30*df8db295SFrançois Tigeot struct workqueue_struct *system_wq;
31*df8db295SFrançois Tigeot struct workqueue_struct *system_long_wq;
32*df8db295SFrançois Tigeot 
33*df8db295SFrançois Tigeot static int init_workqueues(void *arg)
34*df8db295SFrançois Tigeot {
35*df8db295SFrançois Tigeot 	system_wq = alloc_workqueue("system_wq", 0, 1);
36*df8db295SFrançois Tigeot 	system_long_wq = alloc_workqueue("system_long_wq", 0, 1);
37*df8db295SFrançois Tigeot 
38*df8db295SFrançois Tigeot 	return 0;
39*df8db295SFrançois Tigeot }
40*df8db295SFrançois Tigeot SYSINIT(linux_workqueue, SI_SUB_DRIVERS, SI_ORDER_MIDDLE, init_workqueues, NULL);
41