Mon Aug 27 06:06:42 2018 UTC ()
match linux side loading of headers

more bring in OLD drm code to unbreak the build
matching netbsd types etc. to get the build going

Author: coypu <coypu@sdf.org>
Committer: Taylor R Campbell <riastradh@NetBSD.org>


(riastradh)
diff -r1.2 -r1.3 src/sys/external/bsd/drm2/dist/include/drm/drm_dp_mst_helper.h
diff -r1.2 -r1.3 src/sys/external/bsd/drm2/include/linux/fb.h
diff -r1.6 -r1.7 src/sys/external/bsd/drm2/include/linux/mm.h
diff -r1.7 -r1.8 src/sys/external/bsd/drm2/include/linux/mutex.h
diff -r1.4 -r1.5 src/sys/external/bsd/drm2/include/linux/types.h
diff -r1.11 -r1.12 src/sys/external/bsd/drm2/include/linux/ww_mutex.h
diff -r1.18 -r1.19 src/sys/external/bsd/drm2/pci/drm_pci.c

cvs diff -r1.2 -r1.3 src/sys/external/bsd/drm2/dist/include/drm/drm_dp_mst_helper.h (expand / switch to unified diff)

--- src/sys/external/bsd/drm2/dist/include/drm/drm_dp_mst_helper.h 2018/08/27 04:58:37 1.2
+++ src/sys/external/bsd/drm2/dist/include/drm/drm_dp_mst_helper.h 2018/08/27 06:06:41 1.3
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: drm_dp_mst_helper.h,v 1.2 2018/08/27 04:58:37 riastradh Exp $ */ 1/* $NetBSD: drm_dp_mst_helper.h,v 1.3 2018/08/27 06:06:41 riastradh Exp $ */
2 2
3/* 3/*
4 * Copyright © 2014 Red Hat. 4 * Copyright © 2014 Red Hat.
5 * 5 *
6 * Permission to use, copy, modify, distribute, and sell this software and its 6 * Permission to use, copy, modify, distribute, and sell this software and its
7 * documentation for any purpose is hereby granted without fee, provided that 7 * documentation for any purpose is hereby granted without fee, provided that
8 * the above copyright notice appear in all copies and that both that copyright 8 * the above copyright notice appear in all copies and that both that copyright
9 * notice and this permission notice appear in supporting documentation, and 9 * notice and this permission notice appear in supporting documentation, and
10 * that the name of the copyright holders not be used in advertising or 10 * that the name of the copyright holders not be used in advertising or
11 * publicity pertaining to distribution of the software without specific, 11 * publicity pertaining to distribution of the software without specific,
12 * written prior permission. The copyright holders make no representations 12 * written prior permission. The copyright holders make no representations
13 * about the suitability of this software for any purpose. It is provided "as 13 * about the suitability of this software for any purpose. It is provided "as
14 * is" without express or implied warranty. 14 * is" without express or implied warranty.
@@ -446,27 +446,29 @@ struct drm_dp_mst_topology_mgr { @@ -446,27 +446,29 @@ struct drm_dp_mst_topology_mgr {
446 /* qlock protects the upq/downq and in_progress, 446 /* qlock protects the upq/downq and in_progress,
447 the mstb tx_slots and txmsg->state once they are queued */ 447 the mstb tx_slots and txmsg->state once they are queued */
448 struct mutex qlock; 448 struct mutex qlock;
449 struct list_head tx_msg_downq; 449 struct list_head tx_msg_downq;
450 bool tx_down_in_progress; 450 bool tx_down_in_progress;
451 451
452 /* payload info + lock for it */ 452 /* payload info + lock for it */
453 struct mutex payload_lock; 453 struct mutex payload_lock;
454 struct drm_dp_vcpi **proposed_vcpis; 454 struct drm_dp_vcpi **proposed_vcpis;
455 struct drm_dp_payload *payloads; 455 struct drm_dp_payload *payloads;
456 unsigned long payload_mask; 456 unsigned long payload_mask;
457 unsigned long vcpi_mask; 457 unsigned long vcpi_mask;
458 458
 459#ifndef __NetBSD__
459 wait_queue_head_t tx_waitq; 460 wait_queue_head_t tx_waitq;
 461#endif
460 struct work_struct work; 462 struct work_struct work;
461 463
462 struct work_struct tx_work; 464 struct work_struct tx_work;
463 465
464 struct list_head destroy_connector_list; 466 struct list_head destroy_connector_list;
465 struct mutex destroy_connector_lock; 467 struct mutex destroy_connector_lock;
466 struct work_struct destroy_connector_work; 468 struct work_struct destroy_connector_work;
467}; 469};
468 470
469int drm_dp_mst_topology_mgr_init(struct drm_dp_mst_topology_mgr *mgr, struct device *dev, struct drm_dp_aux *aux, int max_dpcd_transaction_bytes, int max_payloads, int conn_base_id); 471int drm_dp_mst_topology_mgr_init(struct drm_dp_mst_topology_mgr *mgr, struct device *dev, struct drm_dp_aux *aux, int max_dpcd_transaction_bytes, int max_payloads, int conn_base_id);
470 472
471void drm_dp_mst_topology_mgr_destroy(struct drm_dp_mst_topology_mgr *mgr); 473void drm_dp_mst_topology_mgr_destroy(struct drm_dp_mst_topology_mgr *mgr);
472 474

cvs diff -r1.2 -r1.3 src/sys/external/bsd/drm2/include/linux/fb.h (expand / switch to unified diff)

--- src/sys/external/bsd/drm2/include/linux/fb.h 2014/03/18 18:20:43 1.2
+++ src/sys/external/bsd/drm2/include/linux/fb.h 2018/08/27 06:06:41 1.3
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: fb.h,v 1.2 2014/03/18 18:20:43 riastradh Exp $ */ 1/* $NetBSD: fb.h,v 1.3 2018/08/27 06:06:41 riastradh Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2013 The NetBSD Foundation, Inc. 4 * Copyright (c) 2013 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Taylor R. Campbell. 8 * by Taylor R. Campbell.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -22,17 +22,20 @@ @@ -22,17 +22,20 @@
22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE. 29 * POSSIBILITY OF SUCH DAMAGE.
30 */ 30 */
31 31
32#ifndef _LINUX_FB_H_ 32#ifndef _LINUX_FB_H_
33#define _LINUX_FB_H_ 33#define _LINUX_FB_H_
34 34
 35#include <linux/kgdb.h>
 36#include <linux/notifier.h>
 37
35#define PICOS2KHZ(PICOS) (1000000000ul / (PICOS)) 38#define PICOS2KHZ(PICOS) (1000000000ul / (PICOS))
36#define KHZ2PICOS(KHZ) (1000000000ul / (KHZ)) 39#define KHZ2PICOS(KHZ) (1000000000ul / (KHZ))
37 40
38#endif /* _LINUX_FB_H_ */ 41#endif /* _LINUX_FB_H_ */

cvs diff -r1.6 -r1.7 src/sys/external/bsd/drm2/include/linux/mm.h (expand / switch to unified diff)

--- src/sys/external/bsd/drm2/include/linux/mm.h 2015/10/18 14:03:20 1.6
+++ src/sys/external/bsd/drm2/include/linux/mm.h 2018/08/27 06:06:41 1.7
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: mm.h,v 1.6 2015/10/18 14:03:20 jmcneill Exp $ */ 1/* $NetBSD: mm.h,v 1.7 2018/08/27 06:06:41 riastradh Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2013 The NetBSD Foundation, Inc. 4 * Copyright (c) 2013 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Taylor R. Campbell. 8 * by Taylor R. Campbell.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -25,26 +25,28 @@ @@ -25,26 +25,28 @@
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE. 29 * POSSIBILITY OF SUCH DAMAGE.
30 */ 30 */
31 31
32#ifndef _LINUX_MM_H_ 32#ifndef _LINUX_MM_H_
33#define _LINUX_MM_H_ 33#define _LINUX_MM_H_
34 34
35#include <uvm/uvm_extern.h> 35#include <uvm/uvm_extern.h>
36 36
37#include <asm/page.h> 37#include <asm/page.h>
 38#include <linux/shrinker.h>
 39
38 40
39struct file; 41struct file;
40 42
41/* XXX Ugh bletch! Whattakludge! Linux's sense is reversed... */ 43/* XXX Ugh bletch! Whattakludge! Linux's sense is reversed... */
42#undef PAGE_MASK 44#undef PAGE_MASK
43#define PAGE_MASK (~(PAGE_SIZE-1)) 45#define PAGE_MASK (~(PAGE_SIZE-1))
44 46
45#define PAGE_ALIGN(x) (((x) + (PAGE_SIZE-1)) & ~(PAGE_SIZE-1)) 47#define PAGE_ALIGN(x) (((x) + (PAGE_SIZE-1)) & ~(PAGE_SIZE-1))
46#define offset_in_page(x) ((x) & (PAGE_SIZE-1)) 48#define offset_in_page(x) ((x) & (PAGE_SIZE-1))
47 49
48struct sysinfo { 50struct sysinfo {
49 unsigned long totalram; 51 unsigned long totalram;
50 unsigned long totalhigh; 52 unsigned long totalhigh;
@@ -66,14 +68,20 @@ vm_mmap(struct file *file __unused, unsi @@ -66,14 +68,20 @@ vm_mmap(struct file *file __unused, unsi
66 unsigned long size __unused, unsigned long prot __unused, 68 unsigned long size __unused, unsigned long prot __unused,
67 unsigned long flags __unused, unsigned long token __unused) 69 unsigned long flags __unused, unsigned long token __unused)
68{ 70{
69 71
70 return -ENODEV; 72 return -ENODEV;
71} 73}
72 74
73static inline unsigned long 75static inline unsigned long
74get_num_physpages(void) 76get_num_physpages(void)
75{ 77{
76 return uvmexp.npages; 78 return uvmexp.npages;
77} 79}
78 80
 81static inline void
 82kvfree(void * ptr)
 83{
 84 panic("Unimplemented");
 85}
 86
79#endif /* _LINUX_MM_H_ */ 87#endif /* _LINUX_MM_H_ */

cvs diff -r1.7 -r1.8 src/sys/external/bsd/drm2/include/linux/mutex.h (expand / switch to unified diff)

--- src/sys/external/bsd/drm2/include/linux/mutex.h 2014/08/23 08:03:33 1.7
+++ src/sys/external/bsd/drm2/include/linux/mutex.h 2018/08/27 06:06:41 1.8
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: mutex.h,v 1.7 2014/08/23 08:03:33 riastradh Exp $ */ 1/* $NetBSD: mutex.h,v 1.8 2018/08/27 06:06:41 riastradh Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2013 The NetBSD Foundation, Inc. 4 * Copyright (c) 2013 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Taylor R. Campbell. 8 * by Taylor R. Campbell.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -25,26 +25,27 @@ @@ -25,26 +25,27 @@
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE. 29 * POSSIBILITY OF SUCH DAMAGE.
30 */ 30 */
31 31
32#ifndef _LINUX_MUTEX_H_ 32#ifndef _LINUX_MUTEX_H_
33#define _LINUX_MUTEX_H_ 33#define _LINUX_MUTEX_H_
34 34
35#include <sys/mutex.h> 35#include <sys/mutex.h>
36 36
37#include <lib/libkern/libkern.h> /* KASSERT */ 37#include <lib/libkern/libkern.h> /* KASSERT */
 38#include <linux/list.h>
38 39
39#define __acquires(lock) /* XXX lockdep stuff */ 40#define __acquires(lock) /* XXX lockdep stuff */
40#define __releases(lock) /* XXX lockdep stuff */ 41#define __releases(lock) /* XXX lockdep stuff */
41 42
42struct mutex { 43struct mutex {
43 kmutex_t mtx_lock; 44 kmutex_t mtx_lock;
44}; 45};
45 46
46struct lock_class_key { 47struct lock_class_key {
47}; 48};
48 49
49/* Name collision. Pooh. */ 50/* Name collision. Pooh. */
50static inline void 51static inline void

cvs diff -r1.4 -r1.5 src/sys/external/bsd/drm2/include/linux/Attic/types.h (expand / switch to unified diff)

--- src/sys/external/bsd/drm2/include/linux/Attic/types.h 2014/07/16 20:59:58 1.4
+++ src/sys/external/bsd/drm2/include/linux/Attic/types.h 2018/08/27 06:06:41 1.5
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: types.h,v 1.4 2014/07/16 20:59:58 riastradh Exp $ */ 1/* $NetBSD: types.h,v 1.5 2018/08/27 06:06:41 riastradh Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2013 The NetBSD Foundation, Inc. 4 * Copyright (c) 2013 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Taylor R. Campbell. 8 * by Taylor R. Campbell.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -67,14 +67,20 @@ typedef uint64_t __be64; @@ -67,14 +67,20 @@ typedef uint64_t __be64;
67 * This is used for absolute bus addresses, so it has to be bus_addr_t 67 * This is used for absolute bus addresses, so it has to be bus_addr_t
68 * and not bus_size_t; bus_addr_t is sometimes wider than bus_size_t. 68 * and not bus_size_t; bus_addr_t is sometimes wider than bus_size_t.
69 */ 69 */
70typedef bus_addr_t resource_size_t; 70typedef bus_addr_t resource_size_t;
71 71
72typedef paddr_t phys_addr_t; 72typedef paddr_t phys_addr_t;
73 73
74/* XXX Is this the right type? */ 74/* XXX Is this the right type? */
75typedef unsigned long long cycles_t; 75typedef unsigned long long cycles_t;
76 76
77/* XXX Not sure this is correct. */ 77/* XXX Not sure this is correct. */
78typedef off_t loff_t; 78typedef off_t loff_t;
79 79
 80struct rcu_head {
 81
 82};
 83
 84#define DECLARE_BITMAP(name,size) size_t name[size/sizeof(size_t)]
 85
80#endif /* _LINUX_TYPES_H_ */ 86#endif /* _LINUX_TYPES_H_ */

cvs diff -r1.11 -r1.12 src/sys/external/bsd/drm2/include/linux/ww_mutex.h (expand / switch to unified diff)

--- src/sys/external/bsd/drm2/include/linux/ww_mutex.h 2015/05/21 21:55:55 1.11
+++ src/sys/external/bsd/drm2/include/linux/ww_mutex.h 2018/08/27 06:06:41 1.12
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: ww_mutex.h,v 1.11 2015/05/21 21:55:55 riastradh Exp $ */ 1/* $NetBSD: ww_mutex.h,v 1.12 2018/08/27 06:06:41 riastradh Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2014 The NetBSD Foundation, Inc. 4 * Copyright (c) 2014 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Taylor R. Campbell. 8 * by Taylor R. Campbell.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -27,26 +27,28 @@ @@ -27,26 +27,28 @@
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE. 29 * POSSIBILITY OF SUCH DAMAGE.
30 */ 30 */
31 31
32#ifndef _ASM_WW_MUTEX_H_ 32#ifndef _ASM_WW_MUTEX_H_
33#define _ASM_WW_MUTEX_H_ 33#define _ASM_WW_MUTEX_H_
34 34
35#include <sys/types.h> 35#include <sys/types.h>
36#include <sys/condvar.h> 36#include <sys/condvar.h>
37#include <sys/mutex.h> 37#include <sys/mutex.h>
38#include <sys/rbtree.h> 38#include <sys/rbtree.h>
39 39
 40#include <linux/mutex.h>
 41
40struct ww_class { 42struct ww_class {
41 volatile uint64_t wwc_ticket; 43 volatile uint64_t wwc_ticket;
42}; 44};
43 45
44#define DEFINE_WW_CLASS(CLASS) \ 46#define DEFINE_WW_CLASS(CLASS) \
45 struct ww_class CLASS = { \ 47 struct ww_class CLASS = { \
46 .wwc_ticket = 0, \ 48 .wwc_ticket = 0, \
47 } 49 }
48 50
49struct ww_acquire_ctx { 51struct ww_acquire_ctx {
50 struct ww_class *wwx_class __diagused; 52 struct ww_class *wwx_class __diagused;
51 struct lwp *wwx_owner __diagused; 53 struct lwp *wwx_owner __diagused;
52 uint64_t wwx_ticket; 54 uint64_t wwx_ticket;

cvs diff -r1.18 -r1.19 src/sys/external/bsd/drm2/pci/drm_pci.c (expand / switch to unified diff)

--- src/sys/external/bsd/drm2/pci/drm_pci.c 2017/07/27 02:11:24 1.18
+++ src/sys/external/bsd/drm2/pci/drm_pci.c 2018/08/27 06:06:42 1.19
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: drm_pci.c,v 1.18 2017/07/27 02:11:24 nonaka Exp $ */ 1/* $NetBSD: drm_pci.c,v 1.19 2018/08/27 06:06:42 riastradh Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2013 The NetBSD Foundation, Inc. 4 * Copyright (c) 2013 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Taylor R. Campbell. 8 * by Taylor R. Campbell.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -20,50 +20,49 @@ @@ -20,50 +20,49 @@
20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE. 29 * POSSIBILITY OF SUCH DAMAGE.
30 */ 30 */
31 31
32#include <sys/cdefs.h> 32#include <sys/cdefs.h>
33__KERNEL_RCSID(0, "$NetBSD: drm_pci.c,v 1.18 2017/07/27 02:11:24 nonaka Exp $"); 33__KERNEL_RCSID(0, "$NetBSD: drm_pci.c,v 1.19 2018/08/27 06:06:42 riastradh Exp $");
34 34
35#include <sys/types.h> 35#include <sys/types.h>
36#include <sys/errno.h> 36#include <sys/errno.h>
37#include <sys/systm.h> 37#include <sys/systm.h>
38 38
39#include <dev/pci/pcivar.h> 39#include <dev/pci/pcivar.h>
40 40
41#include <drm/drmP.h> 41#include <drm/drmP.h>
42 42
43struct drm_bus_irq_cookie { 43struct drm_bus_irq_cookie {
44 pci_intr_handle_t *intr_handles; 44 pci_intr_handle_t *intr_handles;
45 void *ih_cookie; 45 void *ih_cookie;
46}; 46};
47 47
48static int drm_pci_get_irq(struct drm_device *); 48static int drm_pci_get_irq(struct drm_device *);
49static int drm_pci_irq_install(struct drm_device *, 49static int drm_pci_irq_install(struct drm_device *,
50 irqreturn_t (*)(void *), int, const char *, void *, 50 irqreturn_t (*)(void *), int, const char *, void *,
51 struct drm_bus_irq_cookie **); 51 struct drm_bus_irq_cookie **);
52static void drm_pci_irq_uninstall(struct drm_device *, 52static void drm_pci_irq_uninstall(struct drm_device *,
53 struct drm_bus_irq_cookie *); 53 struct drm_bus_irq_cookie *);
54static const char * 54static const char *
55 drm_pci_get_name(struct drm_device *); 55 drm_pci_get_name(struct drm_device *);
56static int drm_pci_set_busid(struct drm_device *, struct drm_master *); 
57static int drm_pci_set_unique(struct drm_device *, struct drm_master *, 56static int drm_pci_set_unique(struct drm_device *, struct drm_master *,
58 struct drm_unique *); 57 struct drm_unique *);
59static int drm_pci_irq_by_busid(struct drm_device *, 58static int drm_pci_irq_by_busid(struct drm_device *,
60 struct drm_irq_busid *); 59 struct drm_irq_busid *);
61 60
62const struct drm_bus drm_pci_bus = { 61const struct drm_bus drm_pci_bus = {
63 .bus_type = DRIVER_BUS_PCI, 62 .bus_type = DRIVER_BUS_PCI,
64 .get_irq = drm_pci_get_irq, 63 .get_irq = drm_pci_get_irq,
65 .irq_install = drm_pci_irq_install, 64 .irq_install = drm_pci_irq_install,
66 .irq_uninstall = drm_pci_irq_uninstall, 65 .irq_uninstall = drm_pci_irq_uninstall,
67 .get_name = drm_pci_get_name, 66 .get_name = drm_pci_get_name,
68 .set_busid = drm_pci_set_busid, 67 .set_busid = drm_pci_set_busid,
69 .set_unique = drm_pci_set_unique, 68 .set_unique = drm_pci_set_unique,
@@ -310,27 +309,27 @@ drm_pci_format_unique(struct drm_device  @@ -310,27 +309,27 @@ drm_pci_format_unique(struct drm_device
310 domain, bus, device, function); 309 domain, bus, device, function);
311} 310}
312 311
313static int 312static int
314drm_pci_format_devname(struct drm_device *dev, const char *unique, 313drm_pci_format_devname(struct drm_device *dev, const char *unique,
315 char *buf, size_t size) 314 char *buf, size_t size)
316{ 315{
317 316
318 return snprintf(buf, size, "%s@%s", 317 return snprintf(buf, size, "%s@%s",
319 device_xname(device_parent(dev->dev)), 318 device_xname(device_parent(dev->dev)),
320 unique); 319 unique);
321} 320}
322 321
323static int 322int
324drm_pci_set_busid(struct drm_device *dev, struct drm_master *master) 323drm_pci_set_busid(struct drm_device *dev, struct drm_master *master)
325{ 324{
326 int n; 325 int n;
327 char *buf; 326 char *buf;
328 327
329 n = drm_pci_format_unique(dev, NULL, 0); 328 n = drm_pci_format_unique(dev, NULL, 0);
330 if (n < 0) 329 if (n < 0)
331 return -ENOSPC; /* XXX */ 330 return -ENOSPC; /* XXX */
332 if (0xff < n) 331 if (0xff < n)
333 n = 0xff; 332 n = 0xff;
334 333
335 buf = kzalloc(n + 1, GFP_KERNEL); 334 buf = kzalloc(n + 1, GFP_KERNEL);
336 (void)drm_pci_format_unique(dev, buf, n + 1); 335 (void)drm_pci_format_unique(dev, buf, n + 1);