xref: /netbsd-src/sys/external/bsd/drm2/i915drm/i915_pci.h (revision a53f11173ae5a0eb82547dc88b62c4e22a581dd4)
1*a53f1117Sriastradh /*	$NetBSD: i915_pci.h,v 1.2 2022/07/18 23:34:02 riastradh Exp $	*/
232189458Sriastradh 
332189458Sriastradh /*-
432189458Sriastradh  * Copyright (c) 2014 The NetBSD Foundation, Inc.
532189458Sriastradh  * All rights reserved.
632189458Sriastradh  *
732189458Sriastradh  * This code is derived from software contributed to The NetBSD Foundation
832189458Sriastradh  * by Taylor R. Campbell.
932189458Sriastradh  *
1032189458Sriastradh  * Redistribution and use in source and binary forms, with or without
1132189458Sriastradh  * modification, are permitted provided that the following conditions
1232189458Sriastradh  * are met:
1332189458Sriastradh  * 1. Redistributions of source code must retain the above copyright
1432189458Sriastradh  *    notice, this list of conditions and the following disclaimer.
1532189458Sriastradh  * 2. Redistributions in binary form must reproduce the above copyright
1632189458Sriastradh  *    notice, this list of conditions and the following disclaimer in the
1732189458Sriastradh  *    documentation and/or other materials provided with the distribution.
1832189458Sriastradh  *
1932189458Sriastradh  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
2032189458Sriastradh  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
2132189458Sriastradh  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
2232189458Sriastradh  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
2332189458Sriastradh  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
2432189458Sriastradh  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
2532189458Sriastradh  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
2632189458Sriastradh  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
2732189458Sriastradh  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
2832189458Sriastradh  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
2932189458Sriastradh  * POSSIBILITY OF SUCH DAMAGE.
3032189458Sriastradh  */
3132189458Sriastradh 
3232189458Sriastradh #ifndef	_I915DRM_I915_PCI_H_
3332189458Sriastradh #define	_I915DRM_I915_PCI_H_
3432189458Sriastradh 
3532189458Sriastradh #include <sys/queue.h>
3632189458Sriastradh #include <sys/workqueue.h>
3732189458Sriastradh 
3832189458Sriastradh struct i915drmkms_task {
3932189458Sriastradh 	union {
4032189458Sriastradh 		SIMPLEQ_ENTRY(i915drmkms_task)	queue;
4132189458Sriastradh 		struct work			work;
4232189458Sriastradh 	}			ift_u;
4332189458Sriastradh 	void			(*ift_fn)(struct i915drmkms_task *);
4432189458Sriastradh };
4532189458Sriastradh 
4632189458Sriastradh static inline void
i915drmkms_task_init(struct i915drmkms_task * task,void (* fn)(struct i915drmkms_task *))4732189458Sriastradh i915drmkms_task_init(struct i915drmkms_task *task,
4832189458Sriastradh     void (*fn)(struct i915drmkms_task *))
4932189458Sriastradh {
5032189458Sriastradh 
5132189458Sriastradh 	task->ift_fn = fn;
5232189458Sriastradh }
5332189458Sriastradh 
54*a53f1117Sriastradh void	i915drmkms_task_schedule(device_t, struct i915drmkms_task *);
5532189458Sriastradh 
5632189458Sriastradh #endif	/* _I915DRM_I915_PCI_H_ */
57