CVS commit: src/sys/external/bsd/drm2/linux

2021-08-02 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon Aug  2 23:14:15 UTC 2021

Modified Files:
src/sys/external/bsd/drm2/linux: linux_reservation.c

Log Message:
drm: Plug another fence leak.

XXX pullup-9


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 \
src/sys/external/bsd/drm2/linux/linux_reservation.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/linux/linux_reservation.c
diff -u src/sys/external/bsd/drm2/linux/linux_reservation.c:1.13 src/sys/external/bsd/drm2/linux/linux_reservation.c:1.14
--- src/sys/external/bsd/drm2/linux/linux_reservation.c:1.13	Mon Aug  2 20:20:54 2021
+++ src/sys/external/bsd/drm2/linux/linux_reservation.c	Mon Aug  2 23:14:15 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux_reservation.c,v 1.13 2021/08/02 20:20:54 riastradh Exp $	*/
+/*	$NetBSD: linux_reservation.c,v 1.14 2021/08/02 23:14:15 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: linux_reservation.c,v 1.13 2021/08/02 20:20:54 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_reservation.c,v 1.14 2021/08/02 23:14:15 riastradh Exp $");
 
 #include 
 #include 
@@ -1003,6 +1003,7 @@ top:
 		 * assume the event is not ready.
 		 */
 		if (!claimed || callback) {
+			fence_put(fence);
 			revents = 0;
 			break;
 		}



CVS commit: src/sys/external/bsd/drm2/linux

2021-08-02 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon Aug  2 20:20:54 UTC 2021

Modified Files:
src/sys/external/bsd/drm2/linux: linux_reservation.c

Log Message:
drm: Release fence if we're about to return too.

Should fix another fence leak.

XXX pullup-9


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 \
src/sys/external/bsd/drm2/linux/linux_reservation.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/linux/linux_reservation.c
diff -u src/sys/external/bsd/drm2/linux/linux_reservation.c:1.12 src/sys/external/bsd/drm2/linux/linux_reservation.c:1.13
--- src/sys/external/bsd/drm2/linux/linux_reservation.c:1.12	Sun Jun 27 08:10:36 2021
+++ src/sys/external/bsd/drm2/linux/linux_reservation.c	Mon Aug  2 20:20:54 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux_reservation.c,v 1.12 2021/06/27 08:10:36 riastradh Exp $	*/
+/*	$NetBSD: linux_reservation.c,v 1.13 2021/08/02 20:20:54 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: linux_reservation.c,v 1.12 2021/06/27 08:10:36 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_reservation.c,v 1.13 2021/08/02 20:20:54 riastradh Exp $");
 
 #include 
 #include 
@@ -794,9 +794,9 @@ wait:
 	KASSERT(fence != NULL);
 	rcu_read_unlock();
 	ret = fence_wait_timeout(fence, intr, timeout);
+	fence_put(fence);
 	if (ret <= 0)
 		return ret;
-	fence_put(fence);
 	KASSERT(ret <= timeout);
 	timeout = ret;
 	goto top;



CVS commit: src/sys/external/bsd/drm2/linux

2021-07-20 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Jul 21 06:34:52 UTC 2021

Modified Files:
src/sys/external/bsd/drm2/linux: linux_rcu.c

Log Message:
need  for COHERENCY_UNIT


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/external/bsd/drm2/linux/linux_rcu.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/linux/linux_rcu.c
diff -u src/sys/external/bsd/drm2/linux/linux_rcu.c:1.4 src/sys/external/bsd/drm2/linux/linux_rcu.c:1.5
--- src/sys/external/bsd/drm2/linux/linux_rcu.c:1.4	Mon Aug 27 15:07:59 2018
+++ src/sys/external/bsd/drm2/linux/linux_rcu.c	Wed Jul 21 06:34:52 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux_rcu.c,v 1.4 2018/08/27 15:07:59 riastradh Exp $	*/
+/*	$NetBSD: linux_rcu.c,v 1.5 2021/07/21 06:34:52 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -30,8 +30,9 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: linux_rcu.c,v 1.4 2018/08/27 15:07:59 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_rcu.c,v 1.5 2021/07/21 06:34:52 skrll Exp $");
 
+#include 
 #include 
 #include 
 #include 



CVS commit: src/sys/external/bsd/drm2/linux

2021-06-27 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Jun 27 08:10:36 UTC 2021

Modified Files:
src/sys/external/bsd/drm2/linux: linux_reservation.c

Log Message:
drm: Release fence after use.

May plug the dreaded radeon kmem memory leak.

XXX pullup-9


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 \
src/sys/external/bsd/drm2/linux/linux_reservation.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/linux/linux_reservation.c
diff -u src/sys/external/bsd/drm2/linux/linux_reservation.c:1.11 src/sys/external/bsd/drm2/linux/linux_reservation.c:1.12
--- src/sys/external/bsd/drm2/linux/linux_reservation.c:1.11	Mon Sep  3 18:02:11 2018
+++ src/sys/external/bsd/drm2/linux/linux_reservation.c	Sun Jun 27 08:10:36 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux_reservation.c,v 1.11 2018/09/03 18:02:11 riastradh Exp $	*/
+/*	$NetBSD: linux_reservation.c,v 1.12 2021/06/27 08:10:36 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: linux_reservation.c,v 1.11 2018/09/03 18:02:11 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_reservation.c,v 1.12 2021/06/27 08:10:36 riastradh Exp $");
 
 #include 
 #include 
@@ -796,6 +796,7 @@ wait:
 	ret = fence_wait_timeout(fence, intr, timeout);
 	if (ret <= 0)
 		return ret;
+	fence_put(fence);
 	KASSERT(ret <= timeout);
 	timeout = ret;
 	goto top;



CVS commit: src/sys/external/bsd/drm2/include

2021-05-31 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon May 31 10:33:04 UTC 2021

Modified Files:
src/sys/external/bsd/drm2/include/asm: processor.h
src/sys/external/bsd/drm2/include/linux: delay.h

Log Message:
drm: sys/param.h, not machine/param.h, for DELAY.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/external/bsd/drm2/include/asm/processor.h
cvs rdiff -u -r1.6 -r1.7 src/sys/external/bsd/drm2/include/linux/delay.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/include/asm/processor.h
diff -u src/sys/external/bsd/drm2/include/asm/processor.h:1.3 src/sys/external/bsd/drm2/include/asm/processor.h:1.4
--- src/sys/external/bsd/drm2/include/asm/processor.h:1.3	Wed Sep 17 15:46:57 2014
+++ src/sys/external/bsd/drm2/include/asm/processor.h	Mon May 31 10:33:04 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: processor.h,v 1.3 2014/09/17 15:46:57 riastradh Exp $	*/
+/*	$NetBSD: processor.h,v 1.4 2021/05/31 10:33:04 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
 #ifndef _ASM_PROCESSOR_H_
 #define _ASM_PROCESSOR_H_
 
-#include 
+#include 
 
 #define	cpu_relax()	DELAY(1)	/* XXX */
 

Index: src/sys/external/bsd/drm2/include/linux/delay.h
diff -u src/sys/external/bsd/drm2/include/linux/delay.h:1.6 src/sys/external/bsd/drm2/include/linux/delay.h:1.7
--- src/sys/external/bsd/drm2/include/linux/delay.h:1.6	Fri Feb 14 09:35:40 2020
+++ src/sys/external/bsd/drm2/include/linux/delay.h	Mon May 31 10:33:04 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: delay.h,v 1.6 2020/02/14 09:35:40 riastradh Exp $	*/
+/*	$NetBSD: delay.h,v 1.7 2021/05/31 10:33:04 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -36,8 +36,6 @@
 #include 
 #include 
 
-#include 
-
 #define	MAX_UDELAY_MS	5
 
 static inline void



CVS commit: src/sys/external/bsd/drm2/dist/drm/i915

2021-05-29 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat May 29 08:45:38 UTC 2021

Modified Files:
src/sys/external/bsd/drm2/dist/drm/i915: i915_drv.h

Log Message:
i915drmkms: Fix LOCKDEBUG panic and potential deadlock.

This path is taken with a spin lock held, and possibly even in
interrupt context, where taking vmobjlock is not kosher, but we are
guaranteed to have the queue populated and unchanging.

XXX pullup-9


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/sys/external/bsd/drm2/dist/drm/i915/i915_drv.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/dist/drm/i915/i915_drv.h
diff -u src/sys/external/bsd/drm2/dist/drm/i915/i915_drv.h:1.32 src/sys/external/bsd/drm2/dist/drm/i915/i915_drv.h:1.33
--- src/sys/external/bsd/drm2/dist/drm/i915/i915_drv.h:1.32	Sun Feb 23 15:46:40 2020
+++ src/sys/external/bsd/drm2/dist/drm/i915/i915_drv.h	Sat May 29 08:45:38 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: i915_drv.h,v 1.32 2020/02/23 15:46:40 ad Exp $	*/
+/*	$NetBSD: i915_drv.h,v 1.33 2021/05/29 08:45:38 riastradh Exp $	*/
 
 /* i915_drv.h -- Private header for the I915 driver -*- linux-c -*-
  */
@@ -3021,9 +3021,10 @@ i915_gem_object_get_page(struct drm_i915
 		 * lock to prevent them from disappearing.
 		 */
 		KASSERT(obj->pages != NULL);
-		rw_enter(obj->base.filp->vmobjlock, RW_WRITER);
-		page = uvm_pagelookup(obj->base.filp, ptoa(n));
-		rw_exit(obj->base.filp->vmobjlock);
+		TAILQ_FOREACH(page, &obj->pageq, pageq.queue) {
+			if (n-- == 0)
+break;
+		}
 	}
 	KASSERT(page != NULL);
 	return container_of(page, struct page, p_vmp);



CVS commit: src/sys/external/bsd/drm2/via

2021-02-13 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Sat Feb 13 15:42:15 UTC 2021

Modified Files:
src/sys/external/bsd/drm2/via: via_pci.c

Log Message:
Add aprint_*() newlines for viadrmums(4) attach

>From Andrius V in kern/55884


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/external/bsd/drm2/via/via_pci.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/via/via_pci.c
diff -u src/sys/external/bsd/drm2/via/via_pci.c:1.4 src/sys/external/bsd/drm2/via/via_pci.c:1.5
--- src/sys/external/bsd/drm2/via/via_pci.c:1.4	Mon Jul 20 21:29:38 2020
+++ src/sys/external/bsd/drm2/via/via_pci.c	Sat Feb 13 15:42:15 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: via_pci.c,v 1.4 2020/07/20 21:29:38 riastradh Exp $	*/
+/*	$NetBSD: via_pci.c,v 1.5 2021/02/13 15:42:15 jakllsch Exp $	*/
 
 /*-
  * Copyright (c) 2015 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: via_pci.c,v 1.4 2020/07/20 21:29:38 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: via_pci.c,v 1.5 2021/02/13 15:42:15 jakllsch Exp $");
 
 #include 
 #include 
@@ -116,6 +116,9 @@ viadrm_attach(device_t parent, device_t 
 
 	KASSERT(cookiep != NULL);
 
+	aprint_naive("\n");
+	aprint_normal("\n");
+
 	if (!pmf_device_register(self, NULL, NULL))
 		aprint_error_dev(self, "couldn't establish power handler\n");
 



CVS commit: src/sys/external/bsd/drm2/dist/drm/i915

2020-10-30 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Sat Oct 31 04:05:42 UTC 2020

Modified Files:
src/sys/external/bsd/drm2/dist/drm/i915: intel_sprite.c

Log Message:
Match linux here and wait without interrupts.

>From David H. Gutteridge in PR port-amd64/5
There's a second part to the patch, but "make our code behave the way
the upstream code does" is very welcome.
Also PR kern/54515 and possibly others.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 \
src/sys/external/bsd/drm2/dist/drm/i915/intel_sprite.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/dist/drm/i915/intel_sprite.c
diff -u src/sys/external/bsd/drm2/dist/drm/i915/intel_sprite.c:1.10 src/sys/external/bsd/drm2/dist/drm/i915/intel_sprite.c:1.11
--- src/sys/external/bsd/drm2/dist/drm/i915/intel_sprite.c:1.10	Fri Feb 14 04:36:12 2020
+++ src/sys/external/bsd/drm2/dist/drm/i915/intel_sprite.c	Sat Oct 31 04:05:42 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: intel_sprite.c,v 1.10 2020/02/14 04:36:12 riastradh Exp $	*/
+/*	$NetBSD: intel_sprite.c,v 1.11 2020/10/31 04:05:42 maya Exp $	*/
 
 /*
  * Copyright © 2011 Intel Corporation
@@ -32,7 +32,7 @@
  * support.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: intel_sprite.c,v 1.10 2020/02/14 04:36:12 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: intel_sprite.c,v 1.11 2020/10/31 04:05:42 maya Exp $");
 
 #include 
 #include 
@@ -124,7 +124,7 @@ void intel_pipe_update_start(struct inte
 	trace_i915_pipe_update_start(crtc);
 
 #ifdef __NetBSD__
-	DRM_SPIN_TIMED_WAIT_UNTIL(ret, wq, &dev->vbl_lock, timeout,
+	DRM_SPIN_TIMED_WAIT_NOINTR_UNTIL(ret, wq, &dev->vbl_lock, timeout,
 	(scanline = intel_get_crtc_scanline(crtc),
 		scanline < min || scanline > max));
 	if (ret <= 0)



CVS commit: src/sys/external/bsd/drm2/dist/drm/radeon

2020-10-20 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Tue Oct 20 09:53:59 UTC 2020

Modified Files:
src/sys/external/bsd/drm2/dist/drm/radeon: radeon_atombios_dp.c

Log Message:
add header file hack to resolve conflict of ALIGN macro. (on __BIG_ENDIAN)


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 \
src/sys/external/bsd/drm2/dist/drm/radeon/radeon_atombios_dp.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/dist/drm/radeon/radeon_atombios_dp.c
diff -u src/sys/external/bsd/drm2/dist/drm/radeon/radeon_atombios_dp.c:1.2 src/sys/external/bsd/drm2/dist/drm/radeon/radeon_atombios_dp.c:1.3
--- src/sys/external/bsd/drm2/dist/drm/radeon/radeon_atombios_dp.c:1.2	Tue Jan  7 13:51:38 2020
+++ src/sys/external/bsd/drm2/dist/drm/radeon/radeon_atombios_dp.c	Tue Oct 20 09:53:59 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: radeon_atombios_dp.c,v 1.2 2020/01/07 13:51:38 msaitoh Exp $	*/
+/*	$NetBSD: radeon_atombios_dp.c,v 1.3 2020/10/20 09:53:59 ryo Exp $	*/
 
 /*
  * Copyright 2007-8 Advanced Micro Devices, Inc.
@@ -27,7 +27,7 @@
  *  Jerome Glisse
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: radeon_atombios_dp.c,v 1.2 2020/01/07 13:51:38 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: radeon_atombios_dp.c,v 1.3 2020/10/20 09:53:59 ryo Exp $");
 
 #include 
 #include 
@@ -37,6 +37,8 @@ __KERNEL_RCSID(0, "$NetBSD: radeon_atomb
 #include "atom-bits.h"
 #include 
 
+#include 
+
 /* move these to drm_dp_helper.c/h */
 #define DP_LINK_CONFIGURATION_SIZE 9
 #define DP_DPCD_SIZE DP_RECEIVER_CAP_SIZE



CVS commit: src/sys/external/bsd/drm2/dist/drm/amd/amdgpu

2020-10-17 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Oct 17 10:47:28 UTC 2020

Modified Files:
src/sys/external/bsd/drm2/dist/drm/amd/amdgpu: amdgpu_gart.c

Log Message:
mb (dsb sy) is not the same as membar_sync (dmb sy) on aarch64


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 \
src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_gart.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_gart.c
diff -u src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_gart.c:1.3 src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_gart.c:1.4
--- src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_gart.c:1.3	Mon Aug 27 14:04:50 2018
+++ src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_gart.c	Sat Oct 17 10:47:28 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: amdgpu_gart.c,v 1.3 2018/08/27 14:04:50 riastradh Exp $	*/
+/*	$NetBSD: amdgpu_gart.c,v 1.4 2020/10/17 10:47:28 jmcneill Exp $	*/
 
 /*
  * Copyright 2008 Advanced Micro Devices, Inc.
@@ -28,7 +28,7 @@
  *  Jerome Glisse
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: amdgpu_gart.c,v 1.3 2018/08/27 14:04:50 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: amdgpu_gart.c,v 1.4 2020/10/17 10:47:28 jmcneill Exp $");
 
 #include 
 #include 
@@ -289,7 +289,7 @@ amdgpu_gart_post_update(struct amdgpu_de
 		gpu_pgstart*entsize, gpu_npages*entsize,
 		BUS_DMASYNC_PREWRITE);
 	}
-	membar_sync();		/* XXX overkill */
+	mb();
 	amdgpu_gart_flush_gpu_tlb(adev, 0);
 }
 #endif



CVS commit: src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/devinit

2020-10-17 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Oct 17 10:47:10 UTC 2020

Modified Files:
src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/devinit: fbmem.h

Log Message:
wmb (dsb ishst) is not the same as membar_producer (dmb ishst) on aarch64


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 \
src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/devinit/fbmem.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/devinit/fbmem.h
diff -u src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/devinit/fbmem.h:1.3 src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/devinit/fbmem.h:1.4
--- src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/devinit/fbmem.h:1.3	Mon Aug 27 14:51:33 2018
+++ src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/devinit/fbmem.h	Sat Oct 17 10:47:10 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: fbmem.h,v 1.3 2018/08/27 14:51:33 riastradh Exp $	*/
+/*	$NetBSD: fbmem.h,v 1.4 2020/10/17 10:47:10 jmcneill Exp $	*/
 
 /*
  * Copyright (C) 2010 Francisco Jerez.
@@ -112,11 +112,10 @@ fbmem_poke(struct io_mapping *fb, u32 of
 {
 	u8 __iomem *p = io_mapping_map_atomic_wc(fb, off & PAGE_MASK);
 	iowrite32(val, p + (off & ~PAGE_MASK));
+	wmb();
 #ifdef __NetBSD__
-	membar_producer();
 	io_mapping_unmap_atomic(fb, __UNVOLATILE(p));
 #else
-	wmb();
 	io_mapping_unmap_atomic(p);
 #endif
 }



CVS commit: src/sys/external/bsd/drm2/dist/drm/radeon

2020-10-17 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Oct 17 10:46:39 UTC 2020

Modified Files:
src/sys/external/bsd/drm2/dist/drm/radeon: radeon_gart.c

Log Message:
mb (dsb sy) is not the same as membar_sync (dmb sy) on aarch64


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 \
src/sys/external/bsd/drm2/dist/drm/radeon/radeon_gart.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/dist/drm/radeon/radeon_gart.c
diff -u src/sys/external/bsd/drm2/dist/drm/radeon/radeon_gart.c:1.11 src/sys/external/bsd/drm2/dist/drm/radeon/radeon_gart.c:1.12
--- src/sys/external/bsd/drm2/dist/drm/radeon/radeon_gart.c:1.11	Mon Jan 20 23:22:09 2020
+++ src/sys/external/bsd/drm2/dist/drm/radeon/radeon_gart.c	Sat Oct 17 10:46:39 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: radeon_gart.c,v 1.11 2020/01/20 23:22:09 jmcneill Exp $	*/
+/*	$NetBSD: radeon_gart.c,v 1.12 2020/10/17 10:46:39 jmcneill Exp $	*/
 
 /*
  * Copyright 2008 Advanced Micro Devices, Inc.
@@ -28,7 +28,7 @@
  *  Jerome Glisse
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: radeon_gart.c,v 1.11 2020/01/20 23:22:09 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: radeon_gart.c,v 1.12 2020/10/17 10:46:39 jmcneill Exp $");
 
 #include 
 #include 
@@ -306,7 +306,7 @@ radeon_gart_post_update(struct radeon_de
 		BUS_DMASYNC_PREWRITE);
 	}
 	if (rdev->gart.ptr != NULL) {
-		membar_sync();		/* XXX overkill */
+		mb();
 		radeon_gart_tlb_flush(rdev);
 	}
 }



CVS commit: src/sys/external/bsd/drm2/via

2020-07-20 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon Jul 20 21:29:38 UTC 2020

Modified Files:
src/sys/external/bsd/drm2/via: via_pci.c

Log Message:
viadrmums: Stop gracefully at the end of the PCI id list.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/external/bsd/drm2/via/via_pci.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/via/via_pci.c
diff -u src/sys/external/bsd/drm2/via/via_pci.c:1.3 src/sys/external/bsd/drm2/via/via_pci.c:1.4
--- src/sys/external/bsd/drm2/via/via_pci.c:1.3	Mon Aug 27 14:12:44 2018
+++ src/sys/external/bsd/drm2/via/via_pci.c	Mon Jul 20 21:29:38 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: via_pci.c,v 1.3 2018/08/27 14:12:44 riastradh Exp $	*/
+/*	$NetBSD: via_pci.c,v 1.4 2020/07/20 21:29:38 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2015 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: via_pci.c,v 1.3 2018/08/27 14:12:44 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: via_pci.c,v 1.4 2020/07/20 21:29:38 riastradh Exp $");
 
 #include 
 #include 
@@ -70,6 +70,9 @@ viadrm_lookup(const struct pci_attach_ar
 	unsigned i;
 
 	for (i = 0; i < __arraycount(viadrm_pci_ids); i++) {
+		if (viadrm_pci_ids[i].vendor == 0 &&
+		viadrm_pci_ids[i].device == 0)
+			break;
 		KASSERT(viadrm_pci_ids[i].subvendor == PCI_ANY_ID);
 		KASSERT(viadrm_pci_ids[i].subdevice == PCI_ANY_ID);
 		KASSERT(viadrm_pci_ids[i].class == 0);



CVS commit: src/sys/external/bsd/drm2/drm

2020-06-27 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Jun 27 13:41:44 UTC 2020

Modified Files:
src/sys/external/bsd/drm2/drm: drmfb.c

Log Message:
prop_data_create_data+prop_dictionary_set+prop_object_release -> 
prop_dictionary_set_data


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/external/bsd/drm2/drm/drmfb.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/drm/drmfb.c
diff -u src/sys/external/bsd/drm2/drm/drmfb.c:1.7 src/sys/external/bsd/drm2/drm/drmfb.c:1.8
--- src/sys/external/bsd/drm2/drm/drmfb.c:1.7	Fri May 31 20:25:58 2019
+++ src/sys/external/bsd/drm2/drm/drmfb.c	Sat Jun 27 13:41:44 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: drmfb.c,v 1.7 2019/05/31 20:25:58 jmcneill Exp $	*/
+/*	$NetBSD: drmfb.c,v 1.8 2020/06/27 13:41:44 jmcneill Exp $	*/
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -39,7 +39,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: drmfb.c,v 1.7 2019/05/31 20:25:58 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: drmfb.c,v 1.8 2020/06/27 13:41:44 jmcneill Exp $");
 
 #ifdef _KERNEL_OPT
 #include "vga.h"
@@ -141,10 +141,8 @@ drmfb_attach(struct drmfb_softc *sc, con
 		da->da_fb_helper->connector_info[n]->connector;
 		struct drm_property_blob *edid = connector->edid_blob_ptr;
 		if (edid && edid->length) {
-			prop_data_t edid_data =
-			prop_data_create_data(edid->data, edid->length);
-			prop_dictionary_set(dict, "EDID", edid_data);
-			prop_object_release(edid_data);
+			prop_dictionary_set_data(dict, "EDID", edid->data,
+			edid->length);
 			break;
 		}
 	}



CVS commit: src/sys/external/bsd/drm2/dist/drm

2020-06-27 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Jun 27 13:39:06 UTC 2020

Modified Files:
src/sys/external/bsd/drm2/dist/drm: drm_crtc.c

Log Message:
prop_dictionary_get_cstring -> prop_dictionary_get_string


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/external/bsd/drm2/dist/drm/drm_crtc.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/dist/drm/drm_crtc.c
diff -u src/sys/external/bsd/drm2/dist/drm/drm_crtc.c:1.16 src/sys/external/bsd/drm2/dist/drm/drm_crtc.c:1.17
--- src/sys/external/bsd/drm2/dist/drm/drm_crtc.c:1.16	Fri Feb 14 14:34:57 2020
+++ src/sys/external/bsd/drm2/dist/drm/drm_crtc.c	Sat Jun 27 13:39:05 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: drm_crtc.c,v 1.16 2020/02/14 14:34:57 maya Exp $	*/
+/*	$NetBSD: drm_crtc.c,v 1.17 2020/06/27 13:39:05 jmcneill Exp $	*/
 
 /*
  * Copyright (c) 2006-2008 Intel Corporation
@@ -32,7 +32,7 @@
  *  Jesse Barnes 
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: drm_crtc.c,v 1.16 2020/02/14 14:34:57 maya Exp $");
+__KERNEL_RCSID(0, "$NetBSD: drm_crtc.c,v 1.17 2020/06/27 13:39:05 jmcneill Exp $");
 
 #include 
 #include 
@@ -825,13 +825,14 @@ EXPORT_SYMBOL(drm_display_info_set_bus_f
 static void drm_connector_get_cmdline_mode(struct drm_connector *connector)
 {
 	struct drm_cmdline_mode *mode = &connector->cmdline_mode;
-	char *option = NULL;
 
 #ifdef __NetBSD__
+	const char *option;
 	prop_dictionary_t prop = device_properties(connector->dev->dev);
-	if (!prop_dictionary_get_cstring(prop, connector->name, &option))
+	if (!prop_dictionary_get_string(prop, connector->name, &option))
 		return;
 #else
+	char *option = NULL;
 	if (fb_get_options(connector->name, &option))
 		return;
 #endif



CVS commit: src/sys/external/bsd/drm2/dist/drm/i915

2020-05-03 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Sun May  3 13:34:38 UTC 2020

Modified Files:
src/sys/external/bsd/drm2/dist/drm/i915: intel_i2c.c

Log Message:
drm/i915: There's no real reason the user should care that we're about to
fall back to bitbanging, so let's change the message from DRM_INFO to
DRM_DEBUG_KMS.

https://lists.freedesktop.org/archives/intel-gfx/2016-March/089133.html


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 \
src/sys/external/bsd/drm2/dist/drm/i915/intel_i2c.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/dist/drm/i915/intel_i2c.c
diff -u src/sys/external/bsd/drm2/dist/drm/i915/intel_i2c.c:1.19 src/sys/external/bsd/drm2/dist/drm/i915/intel_i2c.c:1.20
--- src/sys/external/bsd/drm2/dist/drm/i915/intel_i2c.c:1.19	Fri Feb 14 14:34:58 2020
+++ src/sys/external/bsd/drm2/dist/drm/i915/intel_i2c.c	Sun May  3 13:34:38 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: intel_i2c.c,v 1.19 2020/02/14 14:34:58 maya Exp $	*/
+/*	$NetBSD: intel_i2c.c,v 1.20 2020/05/03 13:34:38 nia Exp $	*/
 
 /*
  * Copyright (c) 2006 Dave Airlie 
@@ -29,7 +29,7 @@
  *	Chris Wilson 
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: intel_i2c.c,v 1.19 2020/02/14 14:34:58 maya Exp $");
+__KERNEL_RCSID(0, "$NetBSD: intel_i2c.c,v 1.20 2020/05/03 13:34:38 nia Exp $");
 
 #include 
 #include 
@@ -643,8 +643,8 @@ clear_err:
 	goto out;
 
 timeout:
-	DRM_INFO("GMBUS [%s] timed out, falling back to bit banging on pin %d\n",
-		 bus->adapter.name, bus->reg0 & 0xff);
+	DRM_DEBUG_KMS("GMBUS [%s] timed out, falling back to bit banging on pin %d\n",
+		 bus->adapter.name, bus->reg0 & 0xff);
 	I915_WRITE(GMBUS0, 0);
 
 	/* Hardware may not support GMBUS over these pins? Try GPIO bitbanging instead. */



CVS commit: src/sys/external/bsd/drm2/dist/drm/radeon

2020-04-27 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Mon Apr 27 16:57:31 UTC 2020

Modified Files:
src/sys/external/bsd/drm2/dist/drm/radeon: radeon_ttm.c

Log Message:
Fix possible bus_dmamap_load(9) leak.  PR/55127

"Looks good to me" from riastradh@.
Note it was also commented "that code path is likely to be reached"
so maybe pullups are not necessary.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 \
src/sys/external/bsd/drm2/dist/drm/radeon/radeon_ttm.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/dist/drm/radeon/radeon_ttm.c
diff -u src/sys/external/bsd/drm2/dist/drm/radeon/radeon_ttm.c:1.16 src/sys/external/bsd/drm2/dist/drm/radeon/radeon_ttm.c:1.17
--- src/sys/external/bsd/drm2/dist/drm/radeon/radeon_ttm.c:1.16	Fri Feb 14 04:38:24 2020
+++ src/sys/external/bsd/drm2/dist/drm/radeon/radeon_ttm.c	Mon Apr 27 16:57:31 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: radeon_ttm.c,v 1.16 2020/02/14 04:38:24 riastradh Exp $	*/
+/*	$NetBSD: radeon_ttm.c,v 1.17 2020/04/27 16:57:31 tsutsui Exp $	*/
 
 /*
  * Copyright 2009 Jerome Glisse.
@@ -32,7 +32,7 @@
  *Dave Airlie
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: radeon_ttm.c,v 1.16 2020/02/14 04:38:24 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: radeon_ttm.c,v 1.17 2020/04/27 16:57:31 tsutsui Exp $");
 
 #include 
 #include 
@@ -923,6 +923,11 @@ static void radeon_ttm_tt_unpopulate(str
 #endif
 	bool slave = !!(ttm->page_flags & TTM_PAGE_FLAG_SG);
 
+#ifdef __NetBSD__
+	if (slave && ttm->sg) {
+		bus_dmamap_unload(ttm->bdev->dmat, gtt->ttm.dma_address);
+	}
+#endif
 	if (gtt && gtt->userptr) {
 		kfree(ttm->sg);
 		ttm->page_flags &= ~TTM_PAGE_FLAG_SG;



CVS commit: src/sys/external/bsd/drm2/dist/drm/amd/amdgpu

2020-04-25 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Sat Apr 25 12:39:15 UTC 2020

Modified Files:
src/sys/external/bsd/drm2/dist/drm/amd/amdgpu: amdgpu_display.c

Log Message:
Fix gcc uninitialised variable warning.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 \
src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_display.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_display.c
diff -u src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_display.c:1.6 src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_display.c:1.7
--- src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_display.c:1.6	Fri Feb 14 04:38:13 2020
+++ src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_display.c	Sat Apr 25 12:39:15 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: amdgpu_display.c,v 1.6 2020/02/14 04:38:13 riastradh Exp $	*/
+/*	$NetBSD: amdgpu_display.c,v 1.7 2020/04/25 12:39:15 simonb Exp $	*/
 
 /*
  * Copyright 2007-8 Advanced Micro Devices, Inc.
@@ -26,7 +26,7 @@
  *  Alex Deucher
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: amdgpu_display.c,v 1.6 2020/02/14 04:38:13 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: amdgpu_display.c,v 1.7 2020/04/25 12:39:15 simonb Exp $");
 
 #include 
 #include 
@@ -78,7 +78,7 @@ static void amdgpu_flip_work_func(struct
 	struct drm_crtc *crtc = &amdgpuCrtc->base;
 	unsigned long flags;
 	unsigned i, repcnt = 4;
-	int vpos, hpos, stat, min_udelay = 0;
+	int vpos, hpos, stat = 0, min_udelay = 0;
 	struct drm_vblank_crtc *vblank = &crtc->dev->vblank[work->crtc_id];
 
 	amdgpu_flip_wait_fence(adev, &work->excl);



CVS commit: src/sys/external/bsd/drm2/dist/drm/nouveau

2020-04-19 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Apr 19 19:12:38 UTC 2020

Modified Files:
src/sys/external/bsd/drm2/dist/drm/nouveau: nouveau_nv50_display.c
src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/mmu:
nouveau_nvkm_subdev_mmu_nv44.c

Log Message:
Add missing BUS_DMA_COHERENT hints


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 \
src/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_nv50_display.c
cvs rdiff -u -r1.3 -r1.4 \

src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/mmu/nouveau_nvkm_subdev_mmu_nv44.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_nv50_display.c
diff -u src/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_nv50_display.c:1.11 src/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_nv50_display.c:1.12
--- src/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_nv50_display.c:1.11	Fri Feb 14 14:34:58 2020
+++ src/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_nv50_display.c	Sun Apr 19 19:12:37 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: nouveau_nv50_display.c,v 1.11 2020/02/14 14:34:58 maya Exp $	*/
+/*	$NetBSD: nouveau_nv50_display.c,v 1.12 2020/04/19 19:12:37 jmcneill Exp $	*/
 
 /*
  * Copyright 2011 Red Hat Inc.
@@ -25,7 +25,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: nouveau_nv50_display.c,v 1.11 2020/02/14 14:34:58 maya Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nouveau_nv50_display.c,v 1.12 2020/04/19 19:12:37 jmcneill Exp $");
 
 #include 
 
@@ -297,7 +297,7 @@ nv50_dmac_create(struct nvif_device *dev
 	}
 	/* XXX errno NetBSD->Linux */
 	ret = -bus_dmamem_map(dmat, &dmac->dmaseg, 1, PAGE_SIZE, &dmac->dmakva,
-	BUS_DMA_WAITOK);
+	BUS_DMA_WAITOK | BUS_DMA_COHERENT);
 	if (ret) {
 		bus_dmamap_destroy(dmat, dmac->dmamap);
 		bus_dmamem_free(dmat, &dmac->dmaseg, 1);

Index: src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/mmu/nouveau_nvkm_subdev_mmu_nv44.c
diff -u src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/mmu/nouveau_nvkm_subdev_mmu_nv44.c:1.3 src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/mmu/nouveau_nvkm_subdev_mmu_nv44.c:1.4
--- src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/mmu/nouveau_nvkm_subdev_mmu_nv44.c:1.3	Mon Aug 27 07:41:09 2018
+++ src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/mmu/nouveau_nvkm_subdev_mmu_nv44.c	Sun Apr 19 19:12:37 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: nouveau_nvkm_subdev_mmu_nv44.c,v 1.3 2018/08/27 07:41:09 riastradh Exp $	*/
+/*	$NetBSD: nouveau_nvkm_subdev_mmu_nv44.c,v 1.4 2020/04/19 19:12:37 jmcneill Exp $	*/
 
 /*
  * Copyright 2012 Red Hat Inc.
@@ -24,7 +24,7 @@
  * Authors: Ben Skeggs
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: nouveau_nvkm_subdev_mmu_nv44.c,v 1.3 2018/08/27 07:41:09 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nouveau_nvkm_subdev_mmu_nv44.c,v 1.4 2020/04/19 19:12:37 jmcneill Exp $");
 
 #include "nv04.h"
 
@@ -193,7 +193,7 @@ fail1:		bus_dmamem_free(dmat, &mmu->null
 
 	/* XXX errno NetBSD->Linux */
 	ret = -bus_dmamem_map(dmat, &mmu->nullseg, 1, nullsz,
-	&mmu->nullp, BUS_DMA_WAITOK);
+	&mmu->nullp, BUS_DMA_WAITOK | BUS_DMA_COHERENT);
 	if (ret) {
 fail2:		bus_dmamap_destroy(dmat, mmu->nullmap);
 		goto fail1;



CVS commit: src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/engine/device

2020-04-19 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Apr 19 18:02:36 UTC 2020

Modified Files:
src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/engine/device:
nouveau_nvkm_engine_device_base.c

Log Message:
Match Linux's criterion for byte-swapping on big-endian CPUs.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 \

src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/engine/device/nouveau_nvkm_engine_device_base.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/engine/device/nouveau_nvkm_engine_device_base.c
diff -u src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/engine/device/nouveau_nvkm_engine_device_base.c:1.9 src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/engine/device/nouveau_nvkm_engine_device_base.c:1.10
--- src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/engine/device/nouveau_nvkm_engine_device_base.c:1.9	Fri Feb 14 04:35:20 2020
+++ src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/engine/device/nouveau_nvkm_engine_device_base.c	Sun Apr 19 18:02:36 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: nouveau_nvkm_engine_device_base.c,v 1.9 2020/02/14 04:35:20 riastradh Exp $	*/
+/*	$NetBSD: nouveau_nvkm_engine_device_base.c,v 1.10 2020/04/19 18:02:36 riastradh Exp $	*/
 
 /*
  * Copyright 2012 Red Hat Inc.
@@ -24,7 +24,7 @@
  * Authors: Ben Skeggs
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: nouveau_nvkm_engine_device_base.c,v 1.9 2020/02/14 04:35:20 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nouveau_nvkm_engine_device_base.c,v 1.10 2020/04/19 18:02:36 riastradh Exp $");
 
 #include "priv.h"
 #include "acpi.h"
@@ -2386,7 +2386,7 @@ nvkm_device_ctor(const struct nvkm_devic
 #ifndef __BIG_ENDIAN
 		if (bus_space_read_stream_4(mmiot, mmioh, 4) != 0)
 #else
-		if (bus_space_read_stream_4(mmiot, mmioh, 4) != 1)
+		if (bus_space_read_stream_4(mmiot, mmioh, 4) == 0)
 #endif
 		{
 			bus_space_write_stream_4(mmiot, mmioh, 4, 0x0101);



CVS commit: src/sys/external/bsd/drm2/dist/include/drm

2020-04-19 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Sun Apr 19 17:49:42 UTC 2020

Modified Files:
src/sys/external/bsd/drm2/dist/include/drm: drmP.h

Log Message:
Include dev/sysmon/sysmonvar.h for sysmon_pswitch.

Somehow only triggered by the compat build (which shouldn't have been
enabled!)


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.41 src/sys/external/bsd/drm2/dist/include/drm/drmP.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/dist/include/drm/drmP.h
diff -u src/sys/external/bsd/drm2/dist/include/drm/drmP.h:1.40 src/sys/external/bsd/drm2/dist/include/drm/drmP.h:1.41
--- src/sys/external/bsd/drm2/dist/include/drm/drmP.h:1.40	Sun Apr 19 17:19:13 2020
+++ src/sys/external/bsd/drm2/dist/include/drm/drmP.h	Sun Apr 19 17:49:41 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: drmP.h,v 1.40 2020/04/19 17:19:13 maya Exp $	*/
+/*	$NetBSD: drmP.h,v 1.41 2020/04/19 17:49:41 maya Exp $	*/
 
 /*
  * Internal Header for the Direct Rendering Manager
@@ -67,6 +67,7 @@
 #include 
 
 #ifdef __NetBSD__
+#include 
 #include 
 #include 
 #include 



CVS commit: src/sys/external/bsd/drm2/dist

2020-04-19 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Sun Apr 19 17:19:13 UTC 2020

Modified Files:
src/sys/external/bsd/drm2/dist/drm: drm_drv.c drm_probe_helper.c
src/sys/external/bsd/drm2/dist/include/drm: drmP.h

Log Message:
For drm drivers and on monitor hotplug, report a 'display-cycle' hotkey click

If powerd is running, it will invoke the script
/etc/powerd/actions/display-cycle


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/external/bsd/drm2/dist/drm/drm_drv.c
cvs rdiff -u -r1.4 -r1.5 \
src/sys/external/bsd/drm2/dist/drm/drm_probe_helper.c
cvs rdiff -u -r1.39 -r1.40 src/sys/external/bsd/drm2/dist/include/drm/drmP.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/dist/drm/drm_drv.c
diff -u src/sys/external/bsd/drm2/dist/drm/drm_drv.c:1.13 src/sys/external/bsd/drm2/dist/drm/drm_drv.c:1.14
--- src/sys/external/bsd/drm2/dist/drm/drm_drv.c:1.13	Thu Mar  5 07:46:59 2020
+++ src/sys/external/bsd/drm2/dist/drm/drm_drv.c	Sun Apr 19 17:19:13 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: drm_drv.c,v 1.13 2020/03/05 07:46:59 riastradh Exp $	*/
+/*	$NetBSD: drm_drv.c,v 1.14 2020/04/19 17:19:13 maya Exp $	*/
 
 /*
  * Created: Fri Jan 19 10:48:35 2001 by fa...@acm.org
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: drm_drv.c,v 1.13 2020/03/05 07:46:59 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: drm_drv.c,v 1.14 2020/04/19 17:19:13 maya Exp $");
 
 #include 
 #include 
@@ -660,6 +660,14 @@ struct drm_device *drm_dev_alloc(struct 
 	kref_init(&dev->ref);
 	dev->dev = parent;
 	dev->driver = driver;
+#ifdef __NetBSD__
+	dev->sc_monitor_hotplug.smpsw_name = PSWITCH_HK_DISPLAY_CYCLE;
+	dev->sc_monitor_hotplug.smpsw_type = PSWITCH_TYPE_HOTKEY;
+
+	ret = sysmon_pswitch_register(&dev->sc_monitor_hotplug);
+	if (ret)
+		goto err_pswitch;
+#endif
 
 	INIT_LIST_HEAD(&dev->filelist);
 	INIT_LIST_HEAD(&dev->ctxlist);
@@ -727,6 +735,10 @@ err_free:
 	mutex_destroy(&dev->master_mutex);
 	mutex_destroy(&dev->ctxlist_mutex);
 	mutex_destroy(&dev->struct_mutex);
+#ifdef __NetBSD__
+err_pswitch:
+	sysmon_pswitch_unregister(&dev->sc_monitor_hotplug);
+#endif
 	kfree(dev);
 	return NULL;
 }
@@ -739,6 +751,10 @@ static void drm_dev_release(struct kref 
 	if (drm_core_check_feature(dev, DRIVER_GEM))
 		drm_gem_destroy(dev);
 
+#ifdef __NetBSD__
+	sysmon_pswitch_unregister(&dev->sc_monitor_hotplug);
+#endif
+
 	drm_legacy_ctxbitmap_cleanup(dev);
 	drm_ht_remove(&dev->map_hash);
 	drm_fs_inode_free(dev->anon_inode);

Index: src/sys/external/bsd/drm2/dist/drm/drm_probe_helper.c
diff -u src/sys/external/bsd/drm2/dist/drm/drm_probe_helper.c:1.4 src/sys/external/bsd/drm2/dist/drm/drm_probe_helper.c:1.5
--- src/sys/external/bsd/drm2/dist/drm/drm_probe_helper.c:1.4	Fri Feb 14 14:34:57 2020
+++ src/sys/external/bsd/drm2/dist/drm/drm_probe_helper.c	Sun Apr 19 17:19:13 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: drm_probe_helper.c,v 1.4 2020/02/14 14:34:57 maya Exp $	*/
+/*	$NetBSD: drm_probe_helper.c,v 1.5 2020/04/19 17:19:13 maya Exp $	*/
 
 /*
  * Copyright (c) 2006-2008 Intel Corporation
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: drm_probe_helper.c,v 1.4 2020/02/14 14:34:57 maya Exp $");
+__KERNEL_RCSID(0, "$NetBSD: drm_probe_helper.c,v 1.5 2020/04/19 17:19:13 maya Exp $");
 
 #include 
 #include 
@@ -328,6 +328,9 @@ EXPORT_SYMBOL(drm_helper_probe_single_co
  */
 void drm_kms_helper_hotplug_event(struct drm_device *dev)
 {
+#ifdef __NetBSD__
+	sysmon_pswitch_event(&dev->sc_monitor_hotplug, PSWITCH_EVENT_PRESSED);
+#endif
 	/* send a uevent + call fbdev */
 	drm_sysfs_hotplug_event(dev);
 	if (dev->mode_config.funcs->output_poll_changed)

Index: src/sys/external/bsd/drm2/dist/include/drm/drmP.h
diff -u src/sys/external/bsd/drm2/dist/include/drm/drmP.h:1.39 src/sys/external/bsd/drm2/dist/include/drm/drmP.h:1.40
--- src/sys/external/bsd/drm2/dist/include/drm/drmP.h:1.39	Thu Mar  5 08:36:53 2020
+++ src/sys/external/bsd/drm2/dist/include/drm/drmP.h	Sun Apr 19 17:19:13 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: drmP.h,v 1.39 2020/03/05 08:36:53 riastradh Exp $	*/
+/*	$NetBSD: drmP.h,v 1.40 2020/04/19 17:19:13 maya Exp $	*/
 
 /*
  * Internal Header for the Direct Rendering Manager
@@ -903,6 +903,7 @@ struct drm_device {
 	int irq;
 #ifdef __NetBSD__
 	struct drm_bus_irq_cookie *irq_cookie;
+	struct sysmon_pswitch sc_monitor_hotplug;
 #endif
 
 	/*



CVS commit: src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/gpio

2020-04-01 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Apr  1 15:57:46 UTC 2020

Modified Files:
src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/gpio:
nouveau_nvkm_subdev_gpio_base.c

Log Message:
 Calculate mask correctly for bit 31 in nvkm_gpio_fini(). Found by kUBSan.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 \

src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/gpio/nouveau_nvkm_subdev_gpio_base.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/gpio/nouveau_nvkm_subdev_gpio_base.c
diff -u src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/gpio/nouveau_nvkm_subdev_gpio_base.c:1.2 src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/gpio/nouveau_nvkm_subdev_gpio_base.c:1.3
--- src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/gpio/nouveau_nvkm_subdev_gpio_base.c:1.2	Mon Aug 27 04:58:34 2018
+++ src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/gpio/nouveau_nvkm_subdev_gpio_base.c	Wed Apr  1 15:57:46 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: nouveau_nvkm_subdev_gpio_base.c,v 1.2 2018/08/27 04:58:34 riastradh Exp $	*/
+/*	$NetBSD: nouveau_nvkm_subdev_gpio_base.c,v 1.3 2020/04/01 15:57:46 msaitoh Exp $	*/
 
 /*
  * Copyright 2011 Red Hat Inc.
@@ -24,7 +24,7 @@
  * Authors: Ben Skeggs
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: nouveau_nvkm_subdev_gpio_base.c,v 1.2 2018/08/27 04:58:34 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nouveau_nvkm_subdev_gpio_base.c,v 1.3 2020/04/01 15:57:46 msaitoh Exp $");
 
 #include "priv.h"
 
@@ -169,7 +169,7 @@ static int
 nvkm_gpio_fini(struct nvkm_subdev *subdev, bool suspend)
 {
 	struct nvkm_gpio *gpio = nvkm_gpio(subdev);
-	u32 mask = (1 << gpio->func->lines) - 1;
+	u32 mask = (1ULL << gpio->func->lines) - 1;
 
 	gpio->func->intr_mask(gpio, NVKM_GPIO_TOGGLED, mask, 0);
 	gpio->func->intr_stat(gpio, &mask, &mask);



CVS commit: src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev

2020-04-01 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Apr  1 15:55:52 UTC 2020

Modified Files:
src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/gpio:
nouveau_nvkm_subdev_gpio_nv50.c
src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/i2c:
nouveau_nvkm_subdev_i2c_g94.c

Log Message:
 Use unsigned to avoid undefined behavior. Found by kUBSan.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 \

src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/gpio/nouveau_nvkm_subdev_gpio_nv50.c
cvs rdiff -u -r1.2 -r1.3 \

src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/i2c/nouveau_nvkm_subdev_i2c_g94.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/gpio/nouveau_nvkm_subdev_gpio_nv50.c
diff -u src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/gpio/nouveau_nvkm_subdev_gpio_nv50.c:1.2 src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/gpio/nouveau_nvkm_subdev_gpio_nv50.c:1.3
--- src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/gpio/nouveau_nvkm_subdev_gpio_nv50.c:1.2	Mon Aug 27 04:58:34 2018
+++ src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/gpio/nouveau_nvkm_subdev_gpio_nv50.c	Wed Apr  1 15:55:52 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: nouveau_nvkm_subdev_gpio_nv50.c,v 1.2 2018/08/27 04:58:34 riastradh Exp $	*/
+/*	$NetBSD: nouveau_nvkm_subdev_gpio_nv50.c,v 1.3 2020/04/01 15:55:52 msaitoh Exp $	*/
 
 /*
  * Copyright 2012 Red Hat Inc.
@@ -24,7 +24,7 @@
  * Authors: Ben Skeggs
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: nouveau_nvkm_subdev_gpio_nv50.c,v 1.2 2018/08/27 04:58:34 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nouveau_nvkm_subdev_gpio_nv50.c,v 1.3 2020/04/01 15:55:52 msaitoh Exp $");
 
 #include "priv.h"
 
@@ -55,7 +55,7 @@ nv50_gpio_reset(struct nvkm_gpio *gpio, 
 
 		nvkm_gpio_set(gpio, 0, func, line, defs);
 
-		nvkm_mask(device, reg, 0x00010001 << lsh, val << lsh);
+		nvkm_mask(device, reg, 0x00010001U << lsh, val << lsh);
 	}
 }
 

Index: src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/i2c/nouveau_nvkm_subdev_i2c_g94.c
diff -u src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/i2c/nouveau_nvkm_subdev_i2c_g94.c:1.2 src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/i2c/nouveau_nvkm_subdev_i2c_g94.c:1.3
--- src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/i2c/nouveau_nvkm_subdev_i2c_g94.c:1.2	Mon Aug 27 04:58:34 2018
+++ src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/i2c/nouveau_nvkm_subdev_i2c_g94.c	Wed Apr  1 15:55:52 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: nouveau_nvkm_subdev_i2c_g94.c,v 1.2 2018/08/27 04:58:34 riastradh Exp $	*/
+/*	$NetBSD: nouveau_nvkm_subdev_i2c_g94.c,v 1.3 2020/04/01 15:55:52 msaitoh Exp $	*/
 
 /*
  * Copyright 2012 Red Hat Inc.
@@ -24,7 +24,7 @@
  * Authors: Ben Skeggs
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: nouveau_nvkm_subdev_i2c_g94.c,v 1.2 2018/08/27 04:58:34 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nouveau_nvkm_subdev_i2c_g94.c,v 1.3 2020/04/01 15:55:52 msaitoh Exp $");
 
 #include "priv.h"
 #include "pad.h"
@@ -39,7 +39,7 @@ g94_aux_stat(struct nvkm_i2c *i2c, u32 *
 		if ((stat & (1 << (i * 4 *hi |= 1 << i;
 		if ((stat & (2 << (i * 4 *lo |= 1 << i;
 		if ((stat & (4 << (i * 4 *rq |= 1 << i;
-		if ((stat & (8 << (i * 4 *tx |= 1 << i;
+		if ((stat & (8U << (i * 4 *tx |= 1 << i;
 	}
 	nvkm_wr32(device, 0x00e06c, intr);
 }



CVS commit: src/sys/external/bsd/drm2/dist/include/drm

2020-03-05 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Thu Mar  5 08:36:54 UTC 2020

Modified Files:
src/sys/external/bsd/drm2/dist/include/drm: drmP.h

Log Message:
Hackily rename enum pipe for drm, without patching.

The patch we used to maintain to do this rename doubled the pain
of merging drm updates.  But ctf gets confused if we have a struct
and an enum both called `pipe', and it's technically against C99
to do so.  So #define it in all drm code for now to fix dtrace.


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/sys/external/bsd/drm2/dist/include/drm/drmP.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/dist/include/drm/drmP.h
diff -u src/sys/external/bsd/drm2/dist/include/drm/drmP.h:1.38 src/sys/external/bsd/drm2/dist/include/drm/drmP.h:1.39
--- src/sys/external/bsd/drm2/dist/include/drm/drmP.h:1.38	Thu Mar  5 07:46:59 2020
+++ src/sys/external/bsd/drm2/dist/include/drm/drmP.h	Thu Mar  5 08:36:53 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: drmP.h,v 1.38 2020/03/05 07:46:59 riastradh Exp $	*/
+/*	$NetBSD: drmP.h,v 1.39 2020/03/05 08:36:53 riastradh Exp $	*/
 
 /*
  * Internal Header for the Direct Rendering Manager
@@ -81,6 +81,28 @@
 #include 
 #include 
 #include 
+
+/*
+ * NetBSD already has struct pipe, and according to C99 6.2.3 there's
+ * only one namespace for struct, union, and enum tags, but the i915
+ * driver wants a type called enum pipe.
+ *
+ * So rename it to avoid conflicts which confuse tools like ctfmerge --
+ * but make sure we include  first to avoid having two
+ * different versions of struct file, one with a pointer to struct pipe
+ * and another with a pointer to struct i915_pipe.
+ *
+ * This will cause trouble if we ever have an API that involves `pipe'
+ * as a member which we need to reference from within drm code.  But
+ * for now that is not the case.
+ *
+ * XXX Yes, this is disgusting.  Sorry.
+ */
+#if defined(__i386__) || defined(__x86_64__)
+#include 
+#define	pipe	pipe_drmhack
+#endif
+
 #else
 #include 
 #endif



CVS commit: src/sys/external/bsd/drm2/dist

2020-03-04 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Thu Mar  5 07:46:59 UTC 2020

Modified Files:
src/sys/external/bsd/drm2/dist/drm: drm_drv.c
src/sys/external/bsd/drm2/dist/include/drm: drmP.h

Log Message:
Avoid struct inode.

This is an fs-independent structure in Linux.  We don't actually use
it as such; it's just a dummy struct tag.  But we do have an actual
struct inode in ufs and in lfs, and using the same struct tag here
confuses ctf leading to four copies of pretty much every drm data
structure.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/external/bsd/drm2/dist/drm/drm_drv.c
cvs rdiff -u -r1.37 -r1.38 src/sys/external/bsd/drm2/dist/include/drm/drmP.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/dist/drm/drm_drv.c
diff -u src/sys/external/bsd/drm2/dist/drm/drm_drv.c:1.12 src/sys/external/bsd/drm2/dist/drm/drm_drv.c:1.13
--- src/sys/external/bsd/drm2/dist/drm/drm_drv.c:1.12	Fri Feb 14 14:34:57 2020
+++ src/sys/external/bsd/drm2/dist/drm/drm_drv.c	Thu Mar  5 07:46:59 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: drm_drv.c,v 1.12 2020/02/14 14:34:57 maya Exp $	*/
+/*	$NetBSD: drm_drv.c,v 1.13 2020/03/05 07:46:59 riastradh Exp $	*/
 
 /*
  * Created: Fri Jan 19 10:48:35 2001 by fa...@acm.org
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: drm_drv.c,v 1.12 2020/02/14 14:34:57 maya Exp $");
+__KERNEL_RCSID(0, "$NetBSD: drm_drv.c,v 1.13 2020/03/05 07:46:59 riastradh Exp $");
 
 #include 
 #include 
@@ -540,16 +540,14 @@ EXPORT_SYMBOL(drm_unplug_dev);
 
 #ifdef __NetBSD__
 
-struct inode;
-
-static struct inode *
+static void *
 drm_fs_inode_new(void)
 {
 	return NULL;
 }
 
 static void
-drm_fs_inode_free(struct inode *inode)
+drm_fs_inode_free(void *inode)
 {
 	KASSERT(inode == NULL);
 }

Index: src/sys/external/bsd/drm2/dist/include/drm/drmP.h
diff -u src/sys/external/bsd/drm2/dist/include/drm/drmP.h:1.37 src/sys/external/bsd/drm2/dist/include/drm/drmP.h:1.38
--- src/sys/external/bsd/drm2/dist/include/drm/drmP.h:1.37	Fri Feb 14 14:34:59 2020
+++ src/sys/external/bsd/drm2/dist/include/drm/drmP.h	Thu Mar  5 07:46:59 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: drmP.h,v 1.37 2020/02/14 14:34:59 maya Exp $	*/
+/*	$NetBSD: drmP.h,v 1.38 2020/03/05 07:46:59 riastradh Exp $	*/
 
 /*
  * Internal Header for the Direct Rendering Manager
@@ -827,7 +827,7 @@ struct drm_device {
 	struct drm_minor *primary;		/**< Primary node */
 	struct drm_minor *render;		/**< Render node */
 	atomic_t unplugged;			/**< Flag whether dev is dead */
-	struct inode *anon_inode;		/**< inode for private address-space */
+	void *anon_inode;		/**< inode for private address-space */
 	char *unique;/**< unique name of the device */
 	/*@} */
 



CVS commit: src/sys/external/bsd/drm2/dist/drm/radeon

2020-02-27 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Thu Feb 27 15:41:47 UTC 2020

Modified Files:
src/sys/external/bsd/drm2/dist/drm/radeon: radeon_irq_kms.c

Log Message:
Take a mutex around mode config logic as the comment advises.

XXX pullup


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 \
src/sys/external/bsd/drm2/dist/drm/radeon/radeon_irq_kms.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/dist/drm/radeon/radeon_irq_kms.c
diff -u src/sys/external/bsd/drm2/dist/drm/radeon/radeon_irq_kms.c:1.4 src/sys/external/bsd/drm2/dist/drm/radeon/radeon_irq_kms.c:1.5
--- src/sys/external/bsd/drm2/dist/drm/radeon/radeon_irq_kms.c:1.4	Mon Aug 27 07:03:26 2018
+++ src/sys/external/bsd/drm2/dist/drm/radeon/radeon_irq_kms.c	Thu Feb 27 15:41:47 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: radeon_irq_kms.c,v 1.4 2018/08/27 07:03:26 riastradh Exp $	*/
+/*	$NetBSD: radeon_irq_kms.c,v 1.5 2020/02/27 15:41:47 riastradh Exp $	*/
 
 /*
  * Copyright 2008 Advanced Micro Devices, Inc.
@@ -28,7 +28,7 @@
  *  Jerome Glisse
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: radeon_irq_kms.c,v 1.4 2018/08/27 07:03:26 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: radeon_irq_kms.c,v 1.5 2020/02/27 15:41:47 riastradh Exp $");
 
 #include 
 #include 
@@ -107,11 +107,12 @@ static void radeon_dp_work_func(struct w
 	struct drm_mode_config *mode_config = &dev->mode_config;
 	struct drm_connector *connector;
 
-	/* this should take a mutex */
+	mutex_lock(&mode_config->mutex);
 	if (mode_config->num_connector) {
 		list_for_each_entry(connector, &mode_config->connector_list, head)
 			radeon_connector_hotplug(connector);
 	}
+	mutex_unlock(&mode_config->mutex);
 }
 /**
  * radeon_driver_irq_preinstall_kms - drm irq preinstall callback



CVS commit: src/sys/external/bsd/drm2/include/drm

2020-02-20 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Thu Feb 20 09:07:39 UTC 2020

Modified Files:
src/sys/external/bsd/drm2/include/drm: bus_dma_hacks.h

Log Message:
in bus_dmamap_load_pglist() try a 32-element array of
bus_dma_segment_t's before attempting to allocate.

this hopefully avoids hangs i've had in X since updating
from netbsd-8 to netbsd-9 that i've tracked down to this
function failing with ENOMEM.

XXX: maybe can avoid the alloc entirely by batching these
calls in 32 segments each.

XXX pullup-9


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 \
src/sys/external/bsd/drm2/include/drm/bus_dma_hacks.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/include/drm/bus_dma_hacks.h
diff -u src/sys/external/bsd/drm2/include/drm/bus_dma_hacks.h:1.19 src/sys/external/bsd/drm2/include/drm/bus_dma_hacks.h:1.20
--- src/sys/external/bsd/drm2/include/drm/bus_dma_hacks.h:1.19	Wed Jan 22 07:53:45 2020
+++ src/sys/external/bsd/drm2/include/drm/bus_dma_hacks.h	Thu Feb 20 09:07:39 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus_dma_hacks.h,v 1.19 2020/01/22 07:53:45 jmcneill Exp $	*/
+/*	$NetBSD: bus_dma_hacks.h,v 1.20 2020/02/20 09:07:39 mrg Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -118,12 +118,15 @@ bus_dmatag_bounces_paddr(bus_dma_tag_t d
 #endif
 }
 
+#define MAX_STACK_SEGS 32	/* XXXMRG: 512 bytes on 16 byte seg platforms */
+
 static inline int
 bus_dmamap_load_pglist(bus_dma_tag_t tag, bus_dmamap_t map,
 struct pglist *pglist, bus_size_t size, int flags)
 {
 	km_flag_t kmflags;
 	bus_dma_segment_t *segs;
+	bus_dma_segment_t stacksegs[MAX_STACK_SEGS];
 	int nsegs, seg;
 	struct vm_page *page;
 	int error;
@@ -136,14 +139,23 @@ bus_dmamap_load_pglist(bus_dma_tag_t tag
 	}
 
 	KASSERT(nsegs <= (SIZE_MAX / sizeof(segs[0])));
-	switch (flags & (BUS_DMA_WAITOK|BUS_DMA_NOWAIT)) {
-	case BUS_DMA_WAITOK:	kmflags = KM_SLEEP;	break;
-	case BUS_DMA_NOWAIT:	kmflags = KM_NOSLEEP;	break;
-	default:		panic("invalid flags: %d", flags);
-	}
-	segs = kmem_alloc((nsegs * sizeof(segs[0])), kmflags);
-	if (segs == NULL)
-		return ENOMEM;
+	if (nsegs > MAX_STACK_SEGS) {
+		switch (flags & (BUS_DMA_WAITOK|BUS_DMA_NOWAIT)) {
+		case BUS_DMA_WAITOK:
+			kmflags = KM_SLEEP;
+			break;
+		case BUS_DMA_NOWAIT:
+			kmflags = KM_NOSLEEP;
+			break;
+		default:
+			panic("invalid flags: %d", flags);
+		}
+		segs = kmem_alloc((nsegs * sizeof(segs[0])), kmflags);
+		if (segs == NULL)
+			return ENOMEM;
+	} else {
+		segs = stacksegs;
+	}
 
 	seg = 0;
 	TAILQ_FOREACH(page, pglist, pageq.queue) {
@@ -166,7 +178,10 @@ bus_dmamap_load_pglist(bus_dma_tag_t tag
 fail1: __unused
 	bus_dmamap_unload(tag, map);
 fail0:	KASSERT(error);
-out:	kmem_free(segs, (nsegs * sizeof(segs[0])));
+out:	if (segs != stacksegs) {
+		KASSERT(nsegs > MAX_STACK_SEGS);
+		kmem_free(segs, (nsegs * sizeof(segs[0])));
+	}
 	return error;
 }
 



CVS commit: src/sys/external/bsd/drm2/include/linux

2020-02-14 Thread Tobias Nygren
Module Name:src
Committed By:   tnn
Date:   Fri Feb 14 18:17:23 UTC 2020

Modified Files:
src/sys/external/bsd/drm2/include/linux: fence.h

Log Message:
FENCE_TRACE is __printflike


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/external/bsd/drm2/include/linux/fence.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/include/linux/fence.h
diff -u src/sys/external/bsd/drm2/include/linux/fence.h:1.15 src/sys/external/bsd/drm2/include/linux/fence.h:1.16
--- src/sys/external/bsd/drm2/include/linux/fence.h:1.15	Mon Aug 27 14:20:41 2018
+++ src/sys/external/bsd/drm2/include/linux/fence.h	Fri Feb 14 18:17:23 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: fence.h,v 1.15 2018/08/27 14:20:41 riastradh Exp $	*/
+/*	$NetBSD: fence.h,v 1.16 2020/02/14 18:17:23 tnn Exp $	*/
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -127,7 +127,7 @@ long	fence_wait(struct fence *, bool);
 long	fence_wait_any_timeout(struct fence **, uint32_t, bool, long);
 long	fence_wait_timeout(struct fence *, bool, long);
 
-static inline void
+static inline void __printflike(2, 3)
 FENCE_TRACE(struct fence *f, const char *fmt, ...)
 {
 	va_list va;



CVS commit: src/sys/external/bsd/drm2/include/linux

2020-02-14 Thread Tobias Nygren
Module Name:src
Committed By:   tnn
Date:   Fri Feb 14 16:02:41 UTC 2020

Modified Files:
src/sys/external/bsd/drm2/include/linux: capability.h

Log Message:
fix a typo, caught by -Werror,-Wheader-guard


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/external/bsd/drm2/include/linux/capability.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/include/linux/capability.h
diff -u src/sys/external/bsd/drm2/include/linux/capability.h:1.1 src/sys/external/bsd/drm2/include/linux/capability.h:1.2
--- src/sys/external/bsd/drm2/include/linux/capability.h:1.1	Fri Feb 14 04:36:56 2020
+++ src/sys/external/bsd/drm2/include/linux/capability.h	Fri Feb 14 16:02:41 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: capability.h,v 1.1 2020/02/14 04:36:56 riastradh Exp $	*/
+/*	$NetBSD: capability.h,v 1.2 2020/02/14 16:02:41 tnn Exp $	*/
 
 /*-
  * Copyright (c) 2020 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #ifndef _LINUX_CAPABILITY_H_
-#define _LINUX_CAPABILITy_H_
+#define _LINUX_CAPABILITY_H_
 
 #include 
 



CVS commit: src/sys/external/bsd/drm2/dist/drm/i915

2020-02-14 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri Feb 14 09:39:57 UTC 2020

Modified Files:
src/sys/external/bsd/drm2/dist/drm/i915: intel_fbdev.c

Log Message:
Nix another conditional ALIGN.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 \
src/sys/external/bsd/drm2/dist/drm/i915/intel_fbdev.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/dist/drm/i915/intel_fbdev.c
diff -u src/sys/external/bsd/drm2/dist/drm/i915/intel_fbdev.c:1.11 src/sys/external/bsd/drm2/dist/drm/i915/intel_fbdev.c:1.12
--- src/sys/external/bsd/drm2/dist/drm/i915/intel_fbdev.c:1.11	Fri Feb 14 09:39:37 2020
+++ src/sys/external/bsd/drm2/dist/drm/i915/intel_fbdev.c	Fri Feb 14 09:39:57 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: intel_fbdev.c,v 1.11 2020/02/14 09:39:37 riastradh Exp $	*/
+/*	$NetBSD: intel_fbdev.c,v 1.12 2020/02/14 09:39:57 riastradh Exp $	*/
 
 /*
  * Copyright © 2007 David Airlie
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: intel_fbdev.c,v 1.11 2020/02/14 09:39:37 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: intel_fbdev.c,v 1.12 2020/02/14 09:39:57 riastradh Exp $");
 
 #include 
 #include 
@@ -53,6 +53,7 @@ __KERNEL_RCSID(0, "$NetBSD: intel_fbdev.
 
 #ifdef __NetBSD__
 #include "intelfb.h"
+#include 
 #endif
 
 #ifndef __NetBSD__
@@ -145,13 +146,8 @@ static int intelfb_alloc(struct drm_fb_h
 	mode_cmd.width = sizes->surface_width;
 	mode_cmd.height = sizes->surface_height;
 
-#ifdef __NetBSD__
-	mode_cmd.pitches[0] = round_up(mode_cmd.width *
-DIV_ROUND_UP(sizes->surface_bpp, 8), 64);
-#else
 	mode_cmd.pitches[0] = ALIGN(mode_cmd.width *
 DIV_ROUND_UP(sizes->surface_bpp, 8), 64);
-#endif
 	mode_cmd.pixel_format = drm_mode_legacy_fb_format(sizes->surface_bpp,
 			  sizes->surface_depth);
 



CVS commit: src/sys/external/bsd/drm2/dist/drm

2020-02-14 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri Feb 14 09:39:38 UTC 2020

Modified Files:
src/sys/external/bsd/drm2/dist/drm/i915: intel_bios.c intel_crt.c
intel_display.c intel_fbdev.c intel_lvds.c intel_pm.c intel_sdvo.c
src/sys/external/bsd/drm2/dist/drm/nouveau: nouveau_chan.c

Log Message:
Reduce some more cosmetic diffs.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/external/bsd/drm2/dist/drm/i915/intel_bios.c \
src/sys/external/bsd/drm2/dist/drm/i915/intel_lvds.c
cvs rdiff -u -r1.7 -r1.8 src/sys/external/bsd/drm2/dist/drm/i915/intel_crt.c
cvs rdiff -u -r1.30 -r1.31 \
src/sys/external/bsd/drm2/dist/drm/i915/intel_display.c
cvs rdiff -u -r1.10 -r1.11 \
src/sys/external/bsd/drm2/dist/drm/i915/intel_fbdev.c
cvs rdiff -u -r1.22 -r1.23 src/sys/external/bsd/drm2/dist/drm/i915/intel_pm.c
cvs rdiff -u -r1.13 -r1.14 \
src/sys/external/bsd/drm2/dist/drm/i915/intel_sdvo.c
cvs rdiff -u -r1.5 -r1.6 \
src/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_chan.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/dist/drm/i915/intel_bios.c
diff -u src/sys/external/bsd/drm2/dist/drm/i915/intel_bios.c:1.8 src/sys/external/bsd/drm2/dist/drm/i915/intel_bios.c:1.9
--- src/sys/external/bsd/drm2/dist/drm/i915/intel_bios.c:1.8	Fri Feb 14 04:30:05 2020
+++ src/sys/external/bsd/drm2/dist/drm/i915/intel_bios.c	Fri Feb 14 09:39:37 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: intel_bios.c,v 1.8 2020/02/14 04:30:05 riastradh Exp $	*/
+/*	$NetBSD: intel_bios.c,v 1.9 2020/02/14 09:39:37 riastradh Exp $	*/
 
 /*
  * Copyright © 2006 Intel Corporation
@@ -27,7 +27,7 @@
  *
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: intel_bios.c,v 1.8 2020/02/14 04:30:05 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: intel_bios.c,v 1.9 2020/02/14 09:39:37 riastradh Exp $");
 
 #include 
 #include 
@@ -1248,7 +1248,7 @@ static const struct dmi_system_id intel_
 			DMI_MATCH(DMI_PRODUCT_NAME, "97027RG"),
 		},
 	},
-	{ 	.callback = NULL, }
+	{ }
 };
 
 static const struct bdb_header *validate_vbt(const void *base,
Index: src/sys/external/bsd/drm2/dist/drm/i915/intel_lvds.c
diff -u src/sys/external/bsd/drm2/dist/drm/i915/intel_lvds.c:1.8 src/sys/external/bsd/drm2/dist/drm/i915/intel_lvds.c:1.9
--- src/sys/external/bsd/drm2/dist/drm/i915/intel_lvds.c:1.8	Fri Feb 14 04:36:12 2020
+++ src/sys/external/bsd/drm2/dist/drm/i915/intel_lvds.c	Fri Feb 14 09:39:37 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: intel_lvds.c,v 1.8 2020/02/14 04:36:12 riastradh Exp $	*/
+/*	$NetBSD: intel_lvds.c,v 1.9 2020/02/14 09:39:37 riastradh Exp $	*/
 
 /*
  * Copyright © 2006-2007 Intel Corporation
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: intel_lvds.c,v 1.8 2020/02/14 04:36:12 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: intel_lvds.c,v 1.9 2020/02/14 09:39:37 riastradh Exp $");
 
 #include 
 #include 
@@ -422,7 +422,7 @@ static const struct dmi_system_id intel_
 		},
 	},
 
-	{ .callback = NULL }	/* terminating entry */
+	{ }	/* terminating entry */
 };
 
 /*
@@ -784,7 +784,7 @@ static const struct dmi_system_id intel_
 		},
 	},
 
-	{ .callback = NULL }	/* terminating entry */
+	{ }	/* terminating entry */
 };
 
 /*
@@ -869,7 +869,7 @@ static const struct dmi_system_id intel_
 			DMI_MATCH(DMI_PRODUCT_NAME, "MacBookPro9,1"),
 		},
 	},
-	{ .callback = NULL }	/* terminating entry */
+	{ }	/* terminating entry */
 };
 
 bool intel_is_dual_link_lvds(struct drm_device *dev)

Index: src/sys/external/bsd/drm2/dist/drm/i915/intel_crt.c
diff -u src/sys/external/bsd/drm2/dist/drm/i915/intel_crt.c:1.7 src/sys/external/bsd/drm2/dist/drm/i915/intel_crt.c:1.8
--- src/sys/external/bsd/drm2/dist/drm/i915/intel_crt.c:1.7	Fri Feb 14 04:36:11 2020
+++ src/sys/external/bsd/drm2/dist/drm/i915/intel_crt.c	Fri Feb 14 09:39:37 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: intel_crt.c,v 1.7 2020/02/14 04:36:11 riastradh Exp $	*/
+/*	$NetBSD: intel_crt.c,v 1.8 2020/02/14 09:39:37 riastradh Exp $	*/
 
 /*
  * Copyright © 2006-2007 Intel Corporation
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: intel_crt.c,v 1.7 2020/02/14 04:36:11 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: intel_crt.c,v 1.8 2020/02/14 09:39:37 riastradh Exp $");
 
 #include 
 #include 
@@ -784,7 +784,7 @@ static const struct dmi_system_id intel_
 			DMI_MATCH(DMI_PRODUCT_NAME, "XPS 8700"),
 		},
 	},
-	{ .callback = NULL }
+	{ }
 };
 
 void intel_crt_init(struct drm_device *dev)

Index: src/sys/external/bsd/drm2/dist/drm/i915/intel_display.c
diff -u src/sys/external/bsd/drm2/dist/drm/i915/intel_display.c:1.30 src/sys/external/bsd/drm2/dist/drm/i915/intel_display.c:1.31
--- src/sys/external/bsd/drm2/dist/drm/i915/intel_display.c:1.30	Fri Feb 14 04:36:11 2020
+++ src/sys/external/bsd/drm2/dist/drm/i915/intel_display.c	Fri Feb 14 09:39:37 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: intel_display.c,v 1.30 2020/02/14 04:36:11 riastradh E

CVS commit: src/sys/external/bsd/drm2/include/linux

2020-02-14 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri Feb 14 09:35:40 UTC 2020

Modified Files:
src/sys/external/bsd/drm2/include/linux: delay.h

Log Message:
Placate -Wsign-compare.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/external/bsd/drm2/include/linux/delay.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/include/linux/delay.h
diff -u src/sys/external/bsd/drm2/include/linux/delay.h:1.5 src/sys/external/bsd/drm2/include/linux/delay.h:1.6
--- src/sys/external/bsd/drm2/include/linux/delay.h:1.5	Mon Aug  6 00:30:24 2018
+++ src/sys/external/bsd/drm2/include/linux/delay.h	Fri Feb 14 09:35:40 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: delay.h,v 1.5 2018/08/06 00:30:24 riastradh Exp $	*/
+/*	$NetBSD: delay.h,v 1.6 2020/02/14 09:35:40 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@ static inline void
 msleep(unsigned int msec)
 {
 	if (cold ||
-	((hz < 1000) && (msec < (1000/hz
+	((hz < 1000) && (msec < (1000/(unsigned)hz
 		mdelay(msec);
 	else
 		(void)kpause("lnxmslep", false, mstohz(msec), NULL);



CVS commit: src/sys/external/bsd/drm2/dist/drm

2020-02-13 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri Feb 14 04:37:29 UTC 2020

Modified Files:
src/sys/external/bsd/drm2/dist/drm: drm_crtc.c drm_fb_helper.c
drm_prime.c
src/sys/external/bsd/drm2/dist/drm/nouveau: nouveau_abi16.c
src/sys/external/bsd/drm2/dist/drm/nouveau/dispnv04:
nouveau_dispnv04_arb.c
src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/engine/disp:
nouveau_nvkm_engine_disp_dport.c
src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/bios:
nouveau_nvkm_subdev_bios_pll.c
src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/devinit:
nouveau_nvkm_subdev_devinit_nv04.c
src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/mxm:
nouveau_nvkm_subdev_mxm_nv50.c
src/sys/external/bsd/drm2/dist/drm/radeon: atombios.h
src/sys/external/bsd/drm2/dist/drm/ttm: ttm_bo.c ttm_bo_util.c
src/sys/external/bsd/drm2/dist/drm/vmwgfx: vmwgfx_kms.c

Log Message:
Revert cosmetic changes.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/external/bsd/drm2/dist/drm/drm_crtc.c \
src/sys/external/bsd/drm2/dist/drm/drm_fb_helper.c
cvs rdiff -u -r1.8 -r1.9 src/sys/external/bsd/drm2/dist/drm/drm_prime.c
cvs rdiff -u -r1.4 -r1.5 \
src/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_abi16.c
cvs rdiff -u -r1.3 -r1.4 \
src/sys/external/bsd/drm2/dist/drm/nouveau/dispnv04/nouveau_dispnv04_arb.c
cvs rdiff -u -r1.3 -r1.4 \

src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/engine/disp/nouveau_nvkm_engine_disp_dport.c
cvs rdiff -u -r1.2 -r1.3 \

src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/bios/nouveau_nvkm_subdev_bios_pll.c
cvs rdiff -u -r1.2 -r1.3 \

src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/devinit/nouveau_nvkm_subdev_devinit_nv04.c
cvs rdiff -u -r1.2 -r1.3 \

src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/mxm/nouveau_nvkm_subdev_mxm_nv50.c
cvs rdiff -u -r1.3 -r1.4 src/sys/external/bsd/drm2/dist/drm/radeon/atombios.h
cvs rdiff -u -r1.17 -r1.18 src/sys/external/bsd/drm2/dist/drm/ttm/ttm_bo.c \
src/sys/external/bsd/drm2/dist/drm/ttm/ttm_bo_util.c
cvs rdiff -u -r1.5 -r1.6 \
src/sys/external/bsd/drm2/dist/drm/vmwgfx/vmwgfx_kms.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/dist/drm/drm_crtc.c
diff -u src/sys/external/bsd/drm2/dist/drm/drm_crtc.c:1.14 src/sys/external/bsd/drm2/dist/drm/drm_crtc.c:1.15
--- src/sys/external/bsd/drm2/dist/drm/drm_crtc.c:1.14	Fri Feb 14 04:36:55 2020
+++ src/sys/external/bsd/drm2/dist/drm/drm_crtc.c	Fri Feb 14 04:37:27 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: drm_crtc.c,v 1.14 2020/02/14 04:36:55 riastradh Exp $	*/
+/*	$NetBSD: drm_crtc.c,v 1.15 2020/02/14 04:37:27 riastradh Exp $	*/
 
 /*
  * Copyright (c) 2006-2008 Intel Corporation
@@ -32,7 +32,7 @@
  *  Jesse Barnes 
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: drm_crtc.c,v 1.14 2020/02/14 04:36:55 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: drm_crtc.c,v 1.15 2020/02/14 04:37:27 riastradh Exp $");
 
 #include 
 #include 
@@ -3065,8 +3065,7 @@ int drm_mode_addfb(struct drm_device *de
 		   void *data, struct drm_file *file_priv)
 {
 	struct drm_mode_fb_cmd *or = data;
-	static const struct drm_mode_fb_cmd2 zero_fbcmd;
-	struct drm_mode_fb_cmd2 r = zero_fbcmd;
+	struct drm_mode_fb_cmd2 r = {};
 	int ret;
 
 	/* convert to new format and call new ioctl */
Index: src/sys/external/bsd/drm2/dist/drm/drm_fb_helper.c
diff -u src/sys/external/bsd/drm2/dist/drm/drm_fb_helper.c:1.14 src/sys/external/bsd/drm2/dist/drm/drm_fb_helper.c:1.15
--- src/sys/external/bsd/drm2/dist/drm/drm_fb_helper.c:1.14	Fri Feb 14 04:37:09 2020
+++ src/sys/external/bsd/drm2/dist/drm/drm_fb_helper.c	Fri Feb 14 04:37:27 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: drm_fb_helper.c,v 1.14 2020/02/14 04:37:09 riastradh Exp $	*/
+/*	$NetBSD: drm_fb_helper.c,v 1.15 2020/02/14 04:37:27 riastradh Exp $	*/
 
 /*
  * Copyright (c) 2006-2009 Red Hat Inc.
@@ -30,7 +30,7 @@
  *  Jesse Barnes 
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: drm_fb_helper.c,v 1.14 2020/02/14 04:37:09 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: drm_fb_helper.c,v 1.15 2020/02/14 04:37:27 riastradh Exp $");
 
 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
 
@@ -584,7 +584,7 @@ static struct sysrq_key_op sysrq_drm_fb_
 	.action_msg = "Restore framebuffer console",
 };
 #else
-static struct sysrq_key_op sysrq_drm_fb_helper_restore_op;
+static struct sysrq_key_op sysrq_drm_fb_helper_restore_op = { };
 #endif
 
 #ifndef __NetBSD__		/* XXX fb info */

Index: src/sys/external/bsd/drm2/dist/drm/drm_prime.c
diff -u src/sys/external/bsd/drm2/dist/drm/drm_prime.c:1.8 src/sys/external/bsd/drm2/dist/drm/drm_prime.c:1.9
--- src/sys/external/bsd/drm2/dist/drm/drm_prime.c:1.8	Fri Feb 14 04:35:19 2020
+++ src/sys/external/bsd/drm2/dist/drm/drm_prime.c	Fri Feb 14 04:37:27 2020
@

CVS commit: src/sys/external/bsd/drm2/dist/drm

2020-02-13 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri Feb 14 04:38:24 UTC 2020

Modified Files:
src/sys/external/bsd/drm2/dist/drm/amd/amdgpu: amdgpu_cs.c amdgpu_gem.c
amdgpu_ttm.c
src/sys/external/bsd/drm2/dist/drm/radeon: radeon_cs.c radeon_gem.c
radeon_ttm.c

Log Message:
Implement drm userptr with uvm_vslock & bus_dmamap_load_uio.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 \
src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_cs.c
cvs rdiff -u -r1.5 -r1.6 \
src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_gem.c
cvs rdiff -u -r1.4 -r1.5 \
src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_ttm.c
cvs rdiff -u -r1.4 -r1.5 \
src/sys/external/bsd/drm2/dist/drm/radeon/radeon_cs.c
cvs rdiff -u -r1.7 -r1.8 \
src/sys/external/bsd/drm2/dist/drm/radeon/radeon_gem.c
cvs rdiff -u -r1.15 -r1.16 \
src/sys/external/bsd/drm2/dist/drm/radeon/radeon_ttm.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_cs.c
diff -u src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_cs.c:1.3 src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_cs.c:1.4
--- src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_cs.c:1.3	Mon Aug 27 14:04:50 2018
+++ src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_cs.c	Fri Feb 14 04:38:23 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: amdgpu_cs.c,v 1.3 2018/08/27 14:04:50 riastradh Exp $	*/
+/*	$NetBSD: amdgpu_cs.c,v 1.4 2020/02/14 04:38:23 riastradh Exp $	*/
 
 /*
  * Copyright 2008 Jerome Glisse.
@@ -27,7 +27,7 @@
  *Jerome Glisse 
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: amdgpu_cs.c,v 1.3 2018/08/27 14:04:50 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: amdgpu_cs.c,v 1.4 2020/02/14 04:38:23 riastradh Exp $");
 
 #include 
 #include 
@@ -406,7 +406,7 @@ static int amdgpu_cs_parser_relocs(struc
 	struct amdgpu_fpriv *fpriv = p->filp->driver_priv;
 	struct amdgpu_cs_buckets buckets;
 	struct list_head duplicates;
-	bool need_mmap_lock __diagused = false;
+	bool need_mmap_lock = false;
 	int i, r;
 
 	if (p->bo_list) {
@@ -426,9 +426,8 @@ static int amdgpu_cs_parser_relocs(struc
 		list_add(&p->uf_entry.tv.head, &p->validated);
 
 #ifdef __NetBSD__
-	KASSERTMSG(!need_mmap_lock,
-	"someone didn't finish adding support for userptr"
-	" and it wasn't me");
+	if (need_mmap_lock)
+		vm_map_lock_read(&curproc->p_vmspace->vm_map);
 #else
 	if (need_mmap_lock)
 		down_read(¤t->mm->mmap_sem);
@@ -450,7 +449,10 @@ error_validate:
 		ttm_eu_backoff_reservation(&p->ticket, &p->validated);
 
 error_reserve:
-#ifndef __NetBSD__
+#ifdef __NetBSD__
+	if (need_mmap_lock)
+		vm_map_unlock_read(&curproc->p_vmspace->vm_map);
+#else
 	if (need_mmap_lock)
 		up_read(¤t->mm->mmap_sem);
 #endif

Index: src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_gem.c
diff -u src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_gem.c:1.5 src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_gem.c:1.6
--- src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_gem.c:1.5	Fri Feb 14 04:35:19 2020
+++ src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_gem.c	Fri Feb 14 04:38:23 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: amdgpu_gem.c,v 1.5 2020/02/14 04:35:19 riastradh Exp $	*/
+/*	$NetBSD: amdgpu_gem.c,v 1.6 2020/02/14 04:38:23 riastradh Exp $	*/
 
 /*
  * Copyright 2008 Advanced Micro Devices, Inc.
@@ -28,7 +28,7 @@
  *  Jerome Glisse
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: amdgpu_gem.c,v 1.5 2020/02/14 04:35:19 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: amdgpu_gem.c,v 1.6 2020/02/14 04:38:23 riastradh Exp $");
 
 #include 
 #include 
@@ -228,15 +228,6 @@ error_unlock:
 int amdgpu_gem_userptr_ioctl(struct drm_device *dev, void *data,
 			 struct drm_file *filp)
 {
-#ifdef __NetBSD__
-	/*
-	 * XXX Too painful to contemplate for now.  If you add this,
-	 * make sure to update amdgpu_cs.c amdgpu_cs_parser_relocs
-	 * (need_mmap_lock), and anything else using
-	 * amdgpu_ttm_tt_has_userptr.
-	 */
-	return -ENODEV;
-#else
 	struct amdgpu_device *adev = dev->dev_private;
 	struct drm_amdgpu_gem_userptr *args = data;
 	struct drm_gem_object *gobj;
@@ -281,17 +272,29 @@ int amdgpu_gem_userptr_ioctl(struct drm_
 	}
 
 	if (args->flags & AMDGPU_GEM_USERPTR_VALIDATE) {
+#ifdef __NetBSD__
+		vm_map_lock_read(&curproc->p_vmspace->vm_map);
+#else
 		down_read(¤t->mm->mmap_sem);
+#endif
 		r = amdgpu_bo_reserve(bo, true);
 		if (r) {
+#ifdef __NetBSD__
+			vm_map_unlock_read(&curproc->p_vmspace->vm_map);
+#else
 			up_read(¤t->mm->mmap_sem);
+#endif
 			goto release_object;
 		}
 
 		amdgpu_ttm_placement_from_domain(bo, AMDGPU_GEM_DOMAIN_GTT);
 		r = ttm_bo_validate(&bo->tbo, &bo->placement, true, false);
 		amdgpu_bo_unreserve(bo);
+#ifdef __NetBSD__
+		vm_map_unlock_read(&curproc->p_vmspace->vm_map);
+#else
 		up_read(¤t->mm->mmap_sem);
+#endif
 		if (r)
 			goto release_object;
 	}
@@ -312,7 +315,

CVS commit: src/sys/external/bsd/drm2/dist/drm/amd/amdgpu

2020-02-13 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri Feb 14 04:38:13 UTC 2020

Modified Files:
src/sys/external/bsd/drm2/dist/drm/amd/amdgpu: amdgpu_display.c

Log Message:
Revert unnecessary change.

The only way this logic can reach the reference to stat is if repcnt
goes to zero, which -- since it starts at 4 -- can only happen if we
go through several iterations of the loop, which in turn implies that
stat is initialized.

If GCC still complains about this, it's wrong and should be dealt
with some other way.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 \
src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_display.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_display.c
diff -u src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_display.c:1.5 src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_display.c:1.6
--- src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_display.c:1.5	Sat Feb 23 19:56:51 2019
+++ src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_display.c	Fri Feb 14 04:38:13 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: amdgpu_display.c,v 1.5 2019/02/23 19:56:51 kamil Exp $	*/
+/*	$NetBSD: amdgpu_display.c,v 1.6 2020/02/14 04:38:13 riastradh Exp $	*/
 
 /*
  * Copyright 2007-8 Advanced Micro Devices, Inc.
@@ -26,7 +26,7 @@
  *  Alex Deucher
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: amdgpu_display.c,v 1.5 2019/02/23 19:56:51 kamil Exp $");
+__KERNEL_RCSID(0, "$NetBSD: amdgpu_display.c,v 1.6 2020/02/14 04:38:13 riastradh Exp $");
 
 #include 
 #include 
@@ -101,8 +101,7 @@ static void amdgpu_flip_work_func(struct
 	 * In practice this won't execute very often unless on very fast
 	 * machines because the time window for this to happen is very small.
 	 */
-	if (amdgpuCrtc->enabled) {
-	while (--repcnt) {
+	while (amdgpuCrtc->enabled && --repcnt) {
 		/* GET_DISTANCE_TO_VBLANKSTART returns distance to real vblank
 		 * start in hpos, and to the "fudged earlier" vblank start in
 		 * vpos.
@@ -135,7 +134,6 @@ static void amdgpu_flip_work_func(struct
  "hpos %d\n", work->crtc_id, min_udelay,
  vblank->framedur_ns / 1000,
  vblank->linedur_ns / 1000, stat, vpos, hpos);
-	}
 
 	/* do the flip (mmio) */
 	adev->mode_info.funcs->page_flip(adev, work->crtc_id, work->base);



CVS commit: src/sys/external/bsd/drm2

2020-02-13 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri Feb 14 04:37:43 UTC 2020

Modified Files:
src/sys/external/bsd/drm2/dist/drm/radeon: radeon.h
src/sys/external/bsd/drm2/dist/drm/via: via_dmablit.c via_irq.c
via_video.c
src/sys/external/bsd/drm2/include/drm: drm_wait_netbsd.h

Log Message:
DRM_HZ -> HZ, to reduce diffs.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/external/bsd/drm2/dist/drm/radeon/radeon.h
cvs rdiff -u -r1.6 -r1.7 src/sys/external/bsd/drm2/dist/drm/via/via_dmablit.c \
src/sys/external/bsd/drm2/dist/drm/via/via_irq.c \
src/sys/external/bsd/drm2/dist/drm/via/via_video.c
cvs rdiff -u -r1.15 -r1.16 \
src/sys/external/bsd/drm2/include/drm/drm_wait_netbsd.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/dist/drm/radeon/radeon.h
diff -u src/sys/external/bsd/drm2/dist/drm/radeon/radeon.h:1.7 src/sys/external/bsd/drm2/dist/drm/radeon/radeon.h:1.8
--- src/sys/external/bsd/drm2/dist/drm/radeon/radeon.h:1.7	Sun Jan 26 14:36:35 2020
+++ src/sys/external/bsd/drm2/dist/drm/radeon/radeon.h	Fri Feb 14 04:37:43 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: radeon.h,v 1.7 2020/01/26 14:36:35 jmcneill Exp $	*/
+/*	$NetBSD: radeon.h,v 1.8 2020/02/14 04:37:43 riastradh Exp $	*/
 
 /*
  * Copyright 2008 Advanced Micro Devices, Inc.
@@ -127,7 +127,7 @@ extern int radeon_mst;
  * symbol;
  */
 #define RADEON_MAX_USEC_TIMEOUT			10	/* 100 ms */
-#define RADEON_FENCE_JIFFIES_TIMEOUT		(DRM_HZ / 2)
+#define RADEON_FENCE_JIFFIES_TIMEOUT		(HZ / 2)
 /* RADEON_IB_POOL_SIZE must be a power of 2 */
 #define RADEON_IB_POOL_SIZE			16
 #define RADEON_DEBUGFS_MAX_COMPONENTS		32

Index: src/sys/external/bsd/drm2/dist/drm/via/via_dmablit.c
diff -u src/sys/external/bsd/drm2/dist/drm/via/via_dmablit.c:1.6 src/sys/external/bsd/drm2/dist/drm/via/via_dmablit.c:1.7
--- src/sys/external/bsd/drm2/dist/drm/via/via_dmablit.c:1.6	Mon Aug 27 04:58:37 2018
+++ src/sys/external/bsd/drm2/dist/drm/via/via_dmablit.c	Fri Feb 14 04:37:43 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: via_dmablit.c,v 1.6 2018/08/27 04:58:37 riastradh Exp $	*/
+/*	$NetBSD: via_dmablit.c,v 1.7 2020/02/14 04:37:43 riastradh Exp $	*/
 
 /* via_dmablit.c -- PCI DMA BitBlt support for the VIA Unichrome/Pro
  *
@@ -37,7 +37,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: via_dmablit.c,v 1.6 2018/08/27 04:58:37 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: via_dmablit.c,v 1.7 2020/02/14 04:37:43 riastradh Exp $");
 
 #include 
 #include 
@@ -514,7 +514,7 @@ via_dmablit_handler(struct drm_device *d
 
 		via_abort_dmablit(dev, engine);
 		blitq->aborting = 1;
-		blitq->end = jiffies + DRM_HZ;
+		blitq->end = jiffies + HZ;
 	}
 
 	if (!blitq->is_active) {
@@ -523,7 +523,7 @@ via_dmablit_handler(struct drm_device *d
 			blitq->is_active = 1;
 			blitq->cur = cur;
 			blitq->num_outstanding--;
-			blitq->end = jiffies + DRM_HZ;
+			blitq->end = jiffies + HZ;
 			if (!timer_pending(&blitq->poll_timer))
 mod_timer(&blitq->poll_timer, jiffies + 1);
 		} else {
@@ -603,7 +603,7 @@ via_dmablit_sync(struct drm_device *dev,
 #ifdef __NetBSD__
 	spin_lock(&blitq->blit_lock);
 	if (via_dmablit_active(blitq, engine, handle, &queue)) {
-		DRM_SPIN_WAIT_ON(ret, queue, &blitq->blit_lock, 3*DRM_HZ,
+		DRM_SPIN_WAIT_ON(ret, queue, &blitq->blit_lock, 3*HZ,
 		!via_dmablit_active(blitq, engine, handle, NULL));
 	}
 	spin_unlock(&blitq->blit_lock);
@@ -881,7 +881,7 @@ via_dmablit_grab_slot(drm_via_blitq_t *b
 	while (blitq->num_free == 0) {
 #ifdef __NetBSD__
 		DRM_SPIN_WAIT_ON(ret, &blitq->busy_queue, &blitq->blit_lock,
-		DRM_HZ,
+		HZ,
 		blitq->num_free > 0);
 		/* Map -EINTR to -EAGAIN.  */
 		if (ret == -EINTR)
Index: src/sys/external/bsd/drm2/dist/drm/via/via_irq.c
diff -u src/sys/external/bsd/drm2/dist/drm/via/via_irq.c:1.6 src/sys/external/bsd/drm2/dist/drm/via/via_irq.c:1.7
--- src/sys/external/bsd/drm2/dist/drm/via/via_irq.c:1.6	Mon Aug 27 04:58:37 2018
+++ src/sys/external/bsd/drm2/dist/drm/via/via_irq.c	Fri Feb 14 04:37:43 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: via_irq.c,v 1.6 2018/08/27 04:58:37 riastradh Exp $	*/
+/*	$NetBSD: via_irq.c,v 1.7 2020/02/14 04:37:43 riastradh Exp $	*/
 
 /* via_irq.c
  *
@@ -38,7 +38,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: via_irq.c,v 1.6 2018/08/27 04:58:37 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: via_irq.c,v 1.7 2020/02/14 04:37:43 riastradh Exp $");
 
 #include 
 #include 
@@ -256,13 +256,13 @@ via_driver_irq_wait(struct drm_device *d
 	spin_lock(&cur_irq->irq_lock);
 	if (masks[real_irq][2] && !force_sequence) {
 		DRM_SPIN_WAIT_ON(ret, &cur_irq->irq_queue, &cur_irq->irq_lock,
-		3 * DRM_HZ,
+		3 * HZ,
 		((VIA_READ(masks[irq][2]) & masks[irq][3]) ==
 			masks[irq][4]));
 		cur_irq_sequence = cur_irq->irq_received;
 	} else {
 		DRM_SPIN_WAIT_ON(ret, &cur_irq->irq_queue, &cur_irq->irq_lock,
-		3 * DRM_HZ,
+		3

CVS commit: src/sys/external/bsd/drm2

2020-02-13 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri Feb 14 04:36:57 UTC 2020

Modified Files:
src/sys/external/bsd/drm2/dist/drm: drm_bufs.c drm_crtc.c drm_ioctl.c
src/sys/external/bsd/drm2/dist/drm/i915: i915_dma.c i915_gem_context.c
i915_gem_execbuffer.c intel_uncore.c
src/sys/external/bsd/drm2/dist/drm/ttm: ttm_bo_util.c ttm_memory.c
src/sys/external/bsd/drm2/dist/drm/via: via_dma.c
src/sys/external/bsd/drm2/drm: drm_fops.c drm_vm.c
src/sys/external/bsd/drm2/include/drm: drm_os_netbsd.h
src/sys/external/bsd/drm2/include/linux: fs.h
Added Files:
src/sys/external/bsd/drm2/include/linux: capability.h
Removed Files:
src/sys/external/bsd/drm2/include/drm: drm_auth_netbsd.h

Log Message:
Reduce diffs by nixing DRM_SUSER macro, deleted upstream long ago.

Instead stub Linux capable(CAP_SYS_ADMIN).


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/external/bsd/drm2/dist/drm/drm_bufs.c
cvs rdiff -u -r1.13 -r1.14 src/sys/external/bsd/drm2/dist/drm/drm_crtc.c
cvs rdiff -u -r1.11 -r1.12 src/sys/external/bsd/drm2/dist/drm/drm_ioctl.c
cvs rdiff -u -r1.30 -r1.31 src/sys/external/bsd/drm2/dist/drm/i915/i915_dma.c
cvs rdiff -u -r1.10 -r1.11 \
src/sys/external/bsd/drm2/dist/drm/i915/i915_gem_context.c
cvs rdiff -u -r1.9 -r1.10 \
src/sys/external/bsd/drm2/dist/drm/i915/i915_gem_execbuffer.c
cvs rdiff -u -r1.11 -r1.12 \
src/sys/external/bsd/drm2/dist/drm/i915/intel_uncore.c
cvs rdiff -u -r1.16 -r1.17 \
src/sys/external/bsd/drm2/dist/drm/ttm/ttm_bo_util.c
cvs rdiff -u -r1.4 -r1.5 src/sys/external/bsd/drm2/dist/drm/ttm/ttm_memory.c
cvs rdiff -u -r1.3 -r1.4 src/sys/external/bsd/drm2/dist/drm/via/via_dma.c
cvs rdiff -u -r1.14 -r1.15 src/sys/external/bsd/drm2/drm/drm_fops.c
cvs rdiff -u -r1.10 -r1.11 src/sys/external/bsd/drm2/drm/drm_vm.c
cvs rdiff -u -r1.2 -r0 \
src/sys/external/bsd/drm2/include/drm/drm_auth_netbsd.h
cvs rdiff -u -r1.16 -r1.17 \
src/sys/external/bsd/drm2/include/drm/drm_os_netbsd.h
cvs rdiff -u -r0 -r1.1 src/sys/external/bsd/drm2/include/linux/capability.h
cvs rdiff -u -r1.2 -r1.3 src/sys/external/bsd/drm2/include/linux/fs.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/dist/drm/drm_bufs.c
diff -u src/sys/external/bsd/drm2/dist/drm/drm_bufs.c:1.10 src/sys/external/bsd/drm2/dist/drm/drm_bufs.c:1.11
--- src/sys/external/bsd/drm2/dist/drm/drm_bufs.c:1.10	Fri Feb 14 04:30:04 2020
+++ src/sys/external/bsd/drm2/dist/drm/drm_bufs.c	Fri Feb 14 04:36:55 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: drm_bufs.c,v 1.10 2020/02/14 04:30:04 riastradh Exp $	*/
+/*	$NetBSD: drm_bufs.c,v 1.11 2020/02/14 04:36:55 riastradh Exp $	*/
 
 /*
  * Legacy: Generic DRM Buffer Management
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: drm_bufs.c,v 1.10 2020/02/14 04:30:04 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: drm_bufs.c,v 1.11 2020/02/14 04:36:55 riastradh Exp $");
 
 #include 
 #include 
@@ -424,17 +424,8 @@ int drm_legacy_addmap_ioctl(struct drm_d
 	struct drm_map_list *maplist;
 	int err;
 
-#ifdef __NetBSD__
-#  if 0/* XXX Old drm did this.  */
-	if (!(dev->flags & (FREAD | FWRITE)))
-		return -EACCES;
-#  endif
-	if (!(DRM_SUSER() || map->type == _DRM_AGP || map->type == _DRM_SHM))
-		return -EACCES;	/* XXX */
-#else
 	if (!(capable(CAP_SYS_ADMIN) || map->type == _DRM_AGP || map->type == _DRM_SHM))
 		return -EPERM;
-#endif
 
 	err = drm_addmap_core(dev, map->offset, map->size, map->type,
 			  map->flags, &maplist);
@@ -856,13 +847,8 @@ int drm_legacy_addbufs_pci(struct drm_de
 	if (!dma)
 		return -EINVAL;
 
-#ifdef __NetBSD__
-	if (!DRM_SUSER())
-		return -EACCES;	/* XXX */
-#else
 	if (!capable(CAP_SYS_ADMIN))
 		return -EPERM;
-#endif
 
 	count = request->count;
 	order = order_base_2(request->size);
@@ -1064,13 +1050,8 @@ static int drm_legacy_addbufs_sg(struct 
 	if (!dma)
 		return -EINVAL;
 
-#ifdef __NetBSD__
-	if (!DRM_SUSER())
-		return -EACCES;	/* XXX */
-#else
 	if (!capable(CAP_SYS_ADMIN))
 		return -EPERM;
-#endif
 
 	count = request->count;
 	order = order_base_2(request->size);

Index: src/sys/external/bsd/drm2/dist/drm/drm_crtc.c
diff -u src/sys/external/bsd/drm2/dist/drm/drm_crtc.c:1.13 src/sys/external/bsd/drm2/dist/drm/drm_crtc.c:1.14
--- src/sys/external/bsd/drm2/dist/drm/drm_crtc.c:1.13	Fri Feb 14 04:35:19 2020
+++ src/sys/external/bsd/drm2/dist/drm/drm_crtc.c	Fri Feb 14 04:36:55 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: drm_crtc.c,v 1.13 2020/02/14 04:35:19 riastradh Exp $	*/
+/*	$NetBSD: drm_crtc.c,v 1.14 2020/02/14 04:36:55 riastradh Exp $	*/
 
 /*
  * Copyright (c) 2006-2008 Intel Corporation
@@ -32,7 +32,7 @@
  *  Jesse Barnes 
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: drm_crtc.c,v 1.13 2020/02/14 04:35:19 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: drm_crtc.c,v 1.14 2020/02/14 04:36:55 riastradh Exp $");
 
 #include 
 #i

CVS commit: src/sys/external/bsd/drm2

2020-02-13 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri Feb 14 04:37:10 UTC 2020

Modified Files:
src/sys/external/bsd/drm2/dist/drm: drm_fb_helper.c
src/sys/external/bsd/drm2/dist/drm/amd/amdgpu: amdgpu_device.c
amdgpu_fb.c
src/sys/external/bsd/drm2/dist/drm/i915: i915_drv.c intel_fbdev.c
src/sys/external/bsd/drm2/dist/drm/nouveau: nouveau_fbcon.c
src/sys/external/bsd/drm2/dist/drm/radeon: radeon_device.c
src/sys/external/bsd/drm2/include/linux: console.h fb.h

Log Message:
Stub out console_lock/unlock and drm_fb_helper_set_suspend.

Reduce some more diffs.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/external/bsd/drm2/dist/drm/drm_fb_helper.c
cvs rdiff -u -r1.5 -r1.6 \
src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_device.c
cvs rdiff -u -r1.4 -r1.5 \
src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_fb.c
cvs rdiff -u -r1.17 -r1.18 src/sys/external/bsd/drm2/dist/drm/i915/i915_drv.c
cvs rdiff -u -r1.9 -r1.10 \
src/sys/external/bsd/drm2/dist/drm/i915/intel_fbdev.c
cvs rdiff -u -r1.8 -r1.9 \
src/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_fbcon.c
cvs rdiff -u -r1.8 -r1.9 \
src/sys/external/bsd/drm2/dist/drm/radeon/radeon_device.c
cvs rdiff -u -r1.2 -r1.3 src/sys/external/bsd/drm2/include/linux/console.h
cvs rdiff -u -r1.3 -r1.4 src/sys/external/bsd/drm2/include/linux/fb.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/dist/drm/drm_fb_helper.c
diff -u src/sys/external/bsd/drm2/dist/drm/drm_fb_helper.c:1.13 src/sys/external/bsd/drm2/dist/drm/drm_fb_helper.c:1.14
--- src/sys/external/bsd/drm2/dist/drm/drm_fb_helper.c:1.13	Tue Nov  5 04:09:51 2019
+++ src/sys/external/bsd/drm2/dist/drm/drm_fb_helper.c	Fri Feb 14 04:37:09 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: drm_fb_helper.c,v 1.13 2019/11/05 04:09:51 msaitoh Exp $	*/
+/*	$NetBSD: drm_fb_helper.c,v 1.14 2020/02/14 04:37:09 riastradh Exp $	*/
 
 /*
  * Copyright (c) 2006-2009 Red Hat Inc.
@@ -30,7 +30,7 @@
  *  Jesse Barnes 
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: drm_fb_helper.c,v 1.13 2019/11/05 04:09:51 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: drm_fb_helper.c,v 1.14 2020/02/14 04:37:09 riastradh Exp $");
 
 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
 
@@ -864,7 +864,11 @@ void drm_fb_helper_fini(struct drm_fb_he
 }
 EXPORT_SYMBOL(drm_fb_helper_fini);
 
-#ifndef __NetBSD__		/* XXX fb info */
+#ifdef __NetBSD__		/* XXX fb info */
+void drm_fb_helper_set_suspend(struct drm_fb_helper *fb_helper, int state)
+{
+}
+#else
 /**
  * drm_fb_helper_unlink_fbi - wrapper around unlink_framebuffer
  * @fb_helper: driver-allocated fbdev helper

Index: src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_device.c
diff -u src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_device.c:1.5 src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_device.c:1.6
--- src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_device.c:1.5	Fri Feb 14 04:35:19 2020
+++ src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_device.c	Fri Feb 14 04:37:09 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: amdgpu_device.c,v 1.5 2020/02/14 04:35:19 riastradh Exp $	*/
+/*	$NetBSD: amdgpu_device.c,v 1.6 2020/02/14 04:37:09 riastradh Exp $	*/
 
 /*
  * Copyright 2008 Advanced Micro Devices, Inc.
@@ -28,7 +28,7 @@
  *  Jerome Glisse
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: amdgpu_device.c,v 1.5 2020/02/14 04:35:19 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: amdgpu_device.c,v 1.6 2020/02/14 04:37:09 riastradh Exp $");
 
 #include 
 #include 
@@ -1893,13 +1893,11 @@ int amdgpu_suspend_kms(struct drm_device
 	}
 #endif
 
-#ifndef __NetBSD__		/* XXX amdgpu fb */
 	if (fbcon) {
 		console_lock();
 		amdgpu_fbdev_set_suspend(adev, 1);
 		console_unlock();
 	}
-#endif
 	return 0;
 }
 
@@ -1922,11 +1920,9 @@ int amdgpu_resume_kms(struct drm_device 
 	if (dev->switch_power_state == DRM_SWITCH_POWER_OFF)
 		return 0;
 
-#ifndef __NetBSD__		/* XXX amdgpu fb */
 	if (fbcon) {
 		console_lock();
 	}
-#endif
 #ifndef __NetBSD__		/* pmf handles this for us.  */
 	if (resume) {
 		pci_set_power_state(dev->pdev, PCI_D0);
@@ -1957,10 +1953,8 @@ int amdgpu_resume_kms(struct drm_device 
 
 	r = amdgpu_late_init(adev);
 	if (r) {
-#ifndef __NetBSD__
 		if (fbcon)
 			console_unlock();
-#endif
 		return r;
 	}
 
@@ -2012,12 +2006,10 @@ int amdgpu_resume_kms(struct drm_device 
 	dev->dev->power.disable_depth--;
 #endif
 
-#ifndef __NetBSD__		/* XXX amdgpu fb */
 	if (fbcon) {
 		amdgpu_fbdev_set_suspend(adev, 0);
 		console_unlock();
 	}
-#endif
 
 	return 0;
 }

Index: src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_fb.c
diff -u src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_fb.c:1.4 src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_fb.c:1.5
--- src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_fb.c:1.4	Fri Feb 14 04:35:19 2020
+++ src/sys/external/bsd/drm2/dist/dr

CVS commit: src/sys/external/bsd/drm2

2020-02-13 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri Feb 14 04:35:20 UTC 2020

Modified Files:
src/sys/external/bsd/drm2/dist/drm: drm_crtc.c drm_dp_helper.c
drm_dp_mst_topology.c drm_drv.c drm_gem.c drm_global.c drm_prime.c
src/sys/external/bsd/drm2/dist/drm/amd/amdgpu: amdgpu_bo_list.c
amdgpu_ctx.c amdgpu_cz_smc.c amdgpu_device.c amdgpu_fb.c
amdgpu_fence.c amdgpu_gem.c amdgpu_gfx_v8_0.c amdgpu_i2c.c
amdgpu_kms.c amdgpu_object.c amdgpu_sdma_v2_4.c amdgpu_sdma_v3_0.c
amdgpu_ucode.c amdgpu_uvd.c amdgpu_vm.c
src/sys/external/bsd/drm2/dist/drm/i915: i915_dma.c i915_gem.c
i915_gem_render_state.c i915_gem_stolen.c intel_display.c
intel_fbc.c intel_i2c.c intel_lrc.c intel_pm.c intel_psr.c
intel_runtime_pm.c
src/sys/external/bsd/drm2/dist/drm/nouveau: nouveau_drm.c
nouveau_nv84_fence.c
src/sys/external/bsd/drm2/dist/drm/nouveau/dispnv04:
nouveau_dispnv04_overlay.c
src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/engine/device:
nouveau_nvkm_engine_device_base.c
src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/i2c:
nouveau_nvkm_subdev_i2c_aux.c nouveau_nvkm_subdev_i2c_bus.c
nouveau_nvkm_subdev_i2c_pad.c
src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/mmu:
nouveau_nvkm_subdev_mmu_base.c
src/sys/external/bsd/drm2/dist/drm/radeon: radeon_cik.c radeon_device.c
radeon_evergreen_cs.c radeon_fb.c radeon_fence.c radeon_gem.c
radeon_i2c.c radeon_ni.c radeon_object.c radeon_r600.c radeon_si.c
radeon_uvd.c radeon_vm.c
src/sys/external/bsd/drm2/dist/drm/ttm: ttm_bo.c ttm_bo_util.c
Added Files:
src/sys/external/bsd/drm2/include/linux: nbsd-namespace.h

Log Message:
Use a header file hack to cope with Linux/NetBSD namespace clashes.

Currently serves for:

ALIGN
mutex_init
mutex_destroy


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/external/bsd/drm2/dist/drm/drm_crtc.c \
src/sys/external/bsd/drm2/dist/drm/drm_gem.c
cvs rdiff -u -r1.9 -r1.10 src/sys/external/bsd/drm2/dist/drm/drm_dp_helper.c
cvs rdiff -u -r1.3 -r1.4 \
src/sys/external/bsd/drm2/dist/drm/drm_dp_mst_topology.c
cvs rdiff -u -r1.10 -r1.11 src/sys/external/bsd/drm2/dist/drm/drm_drv.c
cvs rdiff -u -r1.4 -r1.5 src/sys/external/bsd/drm2/dist/drm/drm_global.c
cvs rdiff -u -r1.7 -r1.8 src/sys/external/bsd/drm2/dist/drm/drm_prime.c
cvs rdiff -u -r1.5 -r1.6 \
src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_bo_list.c \
src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_uvd.c
cvs rdiff -u -r1.4 -r1.5 \
src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_ctx.c \
src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_device.c \
src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_fence.c \
src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_gem.c \
src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_ucode.c
cvs rdiff -u -r1.3 -r1.4 \
src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_cz_smc.c \
src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_fb.c \
src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_i2c.c \
src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_kms.c \
src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_object.c \
src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_vm.c
cvs rdiff -u -r1.2 -r1.3 \
src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_gfx_v8_0.c
cvs rdiff -u -r1.1 -r1.2 \
src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_sdma_v2_4.c \
src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_sdma_v3_0.c
cvs rdiff -u -r1.28 -r1.29 src/sys/external/bsd/drm2/dist/drm/i915/i915_dma.c \
src/sys/external/bsd/drm2/dist/drm/i915/intel_display.c
cvs rdiff -u -r1.57 -r1.58 src/sys/external/bsd/drm2/dist/drm/i915/i915_gem.c
cvs rdiff -u -r1.9 -r1.10 \
src/sys/external/bsd/drm2/dist/drm/i915/i915_gem_render_state.c
cvs rdiff -u -r1.12 -r1.13 \
src/sys/external/bsd/drm2/dist/drm/i915/i915_gem_stolen.c
cvs rdiff -u -r1.4 -r1.5 src/sys/external/bsd/drm2/dist/drm/i915/intel_fbc.c
cvs rdiff -u -r1.17 -r1.18 \
src/sys/external/bsd/drm2/dist/drm/i915/intel_i2c.c
cvs rdiff -u -r1.10 -r1.11 \
src/sys/external/bsd/drm2/dist/drm/i915/intel_lrc.c
cvs rdiff -u -r1.20 -r1.21 src/sys/external/bsd/drm2/dist/drm/i915/intel_pm.c
cvs rdiff -u -r1.6 -r1.7 src/sys/external/bsd/drm2/dist/drm/i915/intel_psr.c
cvs rdiff -u -r1.7 -r1.8 \
src/sys/external/bsd/drm2/dist/drm/i915/intel_runtime_pm.c
cvs rdiff -u -r1.17 -r1.18 \
src/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_drm.c
cvs rdiff -u -r1.6 -r1.7 \
src/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_nv84_fence.c
cvs rdiff -u -r1.3 -r1.4 \

src/sys/external/bsd/drm2/dist/drm/nouveau/dispnv04/nouveau_dispnv04_overlay.c
cvs rdiff -u -r1.8 -r1.9 \

src/sys/external/bsd/drm

CVS commit: src/sys/external/bsd/drm2/dist/drm/i915

2020-02-13 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri Feb 14 04:36:12 UTC 2020

Modified Files:
src/sys/external/bsd/drm2/dist/drm/i915: i915_debugfs.c i915_dma.c
i915_drv.h i915_irq.c intel_audio.c intel_crt.c intel_ddi.c
intel_display.c intel_dp.c intel_dp_mst.c intel_drv.h intel_dsi.c
intel_dvo.c intel_fbc.c intel_fifo_underrun.c intel_hdmi.c
intel_lvds.c intel_overlay.c intel_panel.c intel_pm.c intel_psr.c
intel_runtime_pm.c intel_sdvo.c intel_sideband.c intel_sprite.c
intel_tv.c

Log Message:
Undo the `enum pipe' -> `enum i915_pipe' rename.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 \
src/sys/external/bsd/drm2/dist/drm/i915/i915_debugfs.c \
src/sys/external/bsd/drm2/dist/drm/i915/intel_dp_mst.c \
src/sys/external/bsd/drm2/dist/drm/i915/intel_sideband.c
cvs rdiff -u -r1.29 -r1.30 src/sys/external/bsd/drm2/dist/drm/i915/i915_dma.c \
src/sys/external/bsd/drm2/dist/drm/i915/intel_display.c
cvs rdiff -u -r1.30 -r1.31 src/sys/external/bsd/drm2/dist/drm/i915/i915_drv.h
cvs rdiff -u -r1.17 -r1.18 src/sys/external/bsd/drm2/dist/drm/i915/i915_irq.c
cvs rdiff -u -r1.5 -r1.6 \
src/sys/external/bsd/drm2/dist/drm/i915/intel_audio.c \
src/sys/external/bsd/drm2/dist/drm/i915/intel_fbc.c
cvs rdiff -u -r1.6 -r1.7 src/sys/external/bsd/drm2/dist/drm/i915/intel_crt.c
cvs rdiff -u -r1.10 -r1.11 \
src/sys/external/bsd/drm2/dist/drm/i915/intel_ddi.c
cvs rdiff -u -r1.20 -r1.21 src/sys/external/bsd/drm2/dist/drm/i915/intel_dp.c
cvs rdiff -u -r1.11 -r1.12 \
src/sys/external/bsd/drm2/dist/drm/i915/intel_drv.h
cvs rdiff -u -r1.4 -r1.5 src/sys/external/bsd/drm2/dist/drm/i915/intel_dsi.c \
src/sys/external/bsd/drm2/dist/drm/i915/intel_dvo.c
cvs rdiff -u -r1.2 -r1.3 \
src/sys/external/bsd/drm2/dist/drm/i915/intel_fifo_underrun.c
cvs rdiff -u -r1.7 -r1.8 src/sys/external/bsd/drm2/dist/drm/i915/intel_hdmi.c \
src/sys/external/bsd/drm2/dist/drm/i915/intel_lvds.c \
src/sys/external/bsd/drm2/dist/drm/i915/intel_psr.c \
src/sys/external/bsd/drm2/dist/drm/i915/intel_tv.c
cvs rdiff -u -r1.8 -r1.9 \
src/sys/external/bsd/drm2/dist/drm/i915/intel_overlay.c \
src/sys/external/bsd/drm2/dist/drm/i915/intel_runtime_pm.c
cvs rdiff -u -r1.12 -r1.13 \
src/sys/external/bsd/drm2/dist/drm/i915/intel_panel.c \
src/sys/external/bsd/drm2/dist/drm/i915/intel_sdvo.c
cvs rdiff -u -r1.21 -r1.22 src/sys/external/bsd/drm2/dist/drm/i915/intel_pm.c
cvs rdiff -u -r1.9 -r1.10 \
src/sys/external/bsd/drm2/dist/drm/i915/intel_sprite.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/dist/drm/i915/i915_debugfs.c
diff -u src/sys/external/bsd/drm2/dist/drm/i915/i915_debugfs.c:1.3 src/sys/external/bsd/drm2/dist/drm/i915/i915_debugfs.c:1.4
--- src/sys/external/bsd/drm2/dist/drm/i915/i915_debugfs.c:1.3	Mon Aug 27 04:58:23 2018
+++ src/sys/external/bsd/drm2/dist/drm/i915/i915_debugfs.c	Fri Feb 14 04:36:11 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: i915_debugfs.c,v 1.3 2018/08/27 04:58:23 riastradh Exp $	*/
+/*	$NetBSD: i915_debugfs.c,v 1.4 2020/02/14 04:36:11 riastradh Exp $	*/
 
 /*
  * Copyright © 2008 Intel Corporation
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: i915_debugfs.c,v 1.3 2018/08/27 04:58:23 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i915_debugfs.c,v 1.4 2020/02/14 04:36:11 riastradh Exp $");
 
 #include 
 #include 
@@ -3286,7 +3286,7 @@ static int i915_drrs_status(struct seq_f
 struct pipe_crc_info {
 	const char *name;
 	struct drm_device *dev;
-	enum i915_pipe pipe;
+	enum pipe pipe;
 };
 
 static int i915_dp_mst_info(struct seq_file *m, void *unused)
@@ -3462,7 +3462,7 @@ static struct pipe_crc_info i915_pipe_cr
 };
 
 static int i915_pipe_crc_create(struct dentry *root, struct drm_minor *minor,
-enum i915_pipe pipe)
+enum pipe pipe)
 {
 	struct drm_device *dev = minor->dev;
 	struct dentry *ent;
@@ -3536,7 +3536,7 @@ static int i8xx_pipe_crc_ctl_reg(enum in
 	return 0;
 }
 
-static int i9xx_pipe_crc_auto_source(struct drm_device *dev, enum i915_pipe pipe,
+static int i9xx_pipe_crc_auto_source(struct drm_device *dev, enum pipe pipe,
  enum intel_pipe_crc_source *source)
 {
 	struct intel_encoder *encoder;
@@ -3589,7 +3589,7 @@ static int i9xx_pipe_crc_auto_source(str
 }
 
 static int vlv_pipe_crc_ctl_reg(struct drm_device *dev,
-enum i915_pipe pipe,
+enum pipe pipe,
 enum intel_pipe_crc_source *source,
 uint32_t *val)
 {
@@ -3660,7 +3660,7 @@ static int vlv_pipe_crc_ctl_reg(struct d
 }
 
 static int i9xx_pipe_crc_ctl_reg(struct drm_device *dev,
- enum i915_pipe pipe,
+ enum pipe pipe,
  enum intel_pipe_crc_source *source,
  uint32_t *val)
 {
@@ -3736,7 +3736,7 @@ static int i9xx_pipe_crc_ctl_reg(struct 
 }
 
 static void vlv_undo_pipe_scramble_reset(struct drm_device *dev,
-	 enum i915_pipe pipe)
+	

CVS commit: src/sys/external/bsd/drm2/dist/drm/radeon

2020-02-13 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri Feb 14 04:29:42 UTC 2020

Modified Files:
src/sys/external/bsd/drm2/dist/drm/radeon: radeon_ci_dpm.c
radeon_evergreen_cs.c radeon_rv770_dpm.c radeon_si_dpm.c
radeon_sumo_dpm.c radeon_trinity_dpm.c

Log Message:
We use -Wno-shadow for radeon; remove unused diff.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 \
src/sys/external/bsd/drm2/dist/drm/radeon/radeon_ci_dpm.c \
src/sys/external/bsd/drm2/dist/drm/radeon/radeon_evergreen_cs.c \
src/sys/external/bsd/drm2/dist/drm/radeon/radeon_si_dpm.c
cvs rdiff -u -r1.1 -r1.2 \
src/sys/external/bsd/drm2/dist/drm/radeon/radeon_rv770_dpm.c \
src/sys/external/bsd/drm2/dist/drm/radeon/radeon_sumo_dpm.c \
src/sys/external/bsd/drm2/dist/drm/radeon/radeon_trinity_dpm.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/dist/drm/radeon/radeon_ci_dpm.c
diff -u src/sys/external/bsd/drm2/dist/drm/radeon/radeon_ci_dpm.c:1.2 src/sys/external/bsd/drm2/dist/drm/radeon/radeon_ci_dpm.c:1.3
--- src/sys/external/bsd/drm2/dist/drm/radeon/radeon_ci_dpm.c:1.2	Fri Feb 14 04:29:19 2020
+++ src/sys/external/bsd/drm2/dist/drm/radeon/radeon_ci_dpm.c	Fri Feb 14 04:29:42 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: radeon_ci_dpm.c,v 1.2 2020/02/14 04:29:19 riastradh Exp $	*/
+/*	$NetBSD: radeon_ci_dpm.c,v 1.3 2020/02/14 04:29:42 riastradh Exp $	*/
 
 /*
  * Copyright 2013 Advanced Micro Devices, Inc.
@@ -24,7 +24,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: radeon_ci_dpm.c,v 1.2 2020/02/14 04:29:19 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: radeon_ci_dpm.c,v 1.3 2020/02/14 04:29:42 riastradh Exp $");
 
 #include 
 #include "drmP.h"
@@ -386,29 +386,29 @@ static int ci_min_max_v_gnbl_pm_lid_from
 	struct ci_power_info *pi = ci_get_pi(rdev);
 	u8 *hi_vid = pi->smc_powertune_table.BapmVddCVidHiSidd;
 	u8 *lo_vid = pi->smc_powertune_table.BapmVddCVidLoSidd;
-	int i, vmin, vmax;
+	int i, min, max;
 
-	vmin = vmax = hi_vid[0];
+	min = max = hi_vid[0];
 	for (i = 0; i < 8; i++) {
 		if (0 != hi_vid[i]) {
-			if (vmin > hi_vid[i])
-vmin = hi_vid[i];
-			if (vmax < hi_vid[i])
-vmax = hi_vid[i];
+			if (min > hi_vid[i])
+min = hi_vid[i];
+			if (max < hi_vid[i])
+max = hi_vid[i];
 		}
 
 		if (0 != lo_vid[i]) {
-			if (vmin > lo_vid[i])
-vmin = lo_vid[i];
-			if (vmax < lo_vid[i])
-vmax = lo_vid[i];
+			if (min > lo_vid[i])
+min = lo_vid[i];
+			if (max < lo_vid[i])
+max = lo_vid[i];
 		}
 	}
 
-	if ((vmin == 0) || (vmax == 0))
+	if ((min == 0) || (max == 0))
 		return -EINVAL;
-	pi->smc_powertune_table.GnbLPMLMaxVid = (u8)vmax;
-	pi->smc_powertune_table.GnbLPMLMinVid = (u8)vmin;
+	pi->smc_powertune_table.GnbLPMLMaxVid = (u8)max;
+	pi->smc_powertune_table.GnbLPMLMinVid = (u8)min;
 
 	return 0;
 }
@@ -2443,15 +2443,15 @@ static u8 ci_get_sleep_divider_id_from_c
 {
 	u32 i;
 	u32 tmp;
-	u32 vmin = (min_sclk_in_sr > CISLAND_MINIMUM_ENGINE_CLOCK) ?
+	u32 min = (min_sclk_in_sr > CISLAND_MINIMUM_ENGINE_CLOCK) ?
 		min_sclk_in_sr : CISLAND_MINIMUM_ENGINE_CLOCK;
 
-	if (sclk < vmin)
+	if (sclk < min)
 		return 0;
 
 	for (i = CISLAND_MAX_DEEPSLEEP_DIVIDER_ID;  ; i--) {
 		tmp = sclk / (1 << i);
-		if (tmp >= vmin || i == 0)
+		if (tmp >= min || i == 0)
 			break;
 	}
 
Index: src/sys/external/bsd/drm2/dist/drm/radeon/radeon_evergreen_cs.c
diff -u src/sys/external/bsd/drm2/dist/drm/radeon/radeon_evergreen_cs.c:1.2 src/sys/external/bsd/drm2/dist/drm/radeon/radeon_evergreen_cs.c:1.3
--- src/sys/external/bsd/drm2/dist/drm/radeon/radeon_evergreen_cs.c:1.2	Fri Feb  8 04:11:53 2019
+++ src/sys/external/bsd/drm2/dist/drm/radeon/radeon_evergreen_cs.c	Fri Feb 14 04:29:42 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: radeon_evergreen_cs.c,v 1.2 2019/02/08 04:11:53 mrg Exp $	*/
+/*	$NetBSD: radeon_evergreen_cs.c,v 1.3 2020/02/14 04:29:42 riastradh Exp $	*/
 
 /*
  * Copyright 2010 Advanced Micro Devices, Inc.
@@ -28,7 +28,7 @@
  *  Jerome Glisse
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: radeon_evergreen_cs.c,v 1.2 2019/02/08 04:11:53 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: radeon_evergreen_cs.c,v 1.3 2020/02/14 04:29:42 riastradh Exp $");
 
 #include 
 #include "radeon.h"
@@ -37,8 +37,8 @@ __KERNEL_RCSID(0, "$NetBSD: radeon_everg
 #include "cayman_reg_safe.h"
 
 #ifndef __NetBSD__
-#define MAX(a,b)			(((a)>(b))?(a):(b))
-#define MIN(a,b)			(((a)<(b))?(a):(b))
+#define MAX(a,b)   (((a)>(b))?(a):(b))
+#define MIN(a,b)   (((a)<(b))?(a):(b))
 #endif
 
 #define REG_SAFE_BM_SIZE ARRAY_SIZE(evergreen_reg_safe_bm)
@@ -455,21 +455,21 @@ static int evergreen_cs_track_validate_c
 		 */
 		if (!surf.mode) {
 			uint32_t *ib = p->ib.ptr;
-			unsigned long tmp, nby, bsize, size, vmin = 0;
+			unsigned long tmp, nby, bsize, size, min = 0;
 
 			/* find the height the ddx wants */
 			if (surf.nby > 8) {
-vmin = surf.nby - 8;
+		

CVS commit: src/sys/external/bsd/drm2

2020-02-13 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri Feb 14 04:30:06 UTC 2020

Modified Files:
src/sys/external/bsd/drm2/amdgpu: files.amdgpu
src/sys/external/bsd/drm2/dist/drm: drm_bufs.c drm_crtc.c
drm_dp_helper.c
src/sys/external/bsd/drm2/dist/drm/amd/amdgpu: amdgpu_atom.c
amdgpu_atombios.c amdgpu_atombios_encoders.c amdgpu_bo_list.c
amdgpu_ci_dpm.c amdgpu_cz_dpm.c amdgpu_cz_smc.c amdgpu_dce_v10_0.c
amdgpu_dce_v11_0.c amdgpu_dce_v8_0.c amdgpu_dpm.c amdgpu_fence.c
amdgpu_gmc_v7_0.c amdgpu_gmc_v8_0.c amdgpu_kv_dpm.c amdgpu_test.c
amdgpu_ucode.c amdgpu_uvd.c
src/sys/external/bsd/drm2/dist/drm/i915: i915_cmd_parser.c i915_gem.c
i915_guc_submission.c intel_bios.c intel_opregion.c intel_psr.c
src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/bios:
nouveau_nvkm_subdev_bios_shadowpci.c
src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/instmem:
nouveau_nvkm_subdev_instmem_base.c
nouveau_nvkm_subdev_instmem_nv40.c
src/sys/external/bsd/drm2/dist/drm/radeon: drm_buffer.c radeon_test.c
radeon_uvd.c
src/sys/external/bsd/drm2/drm: files.drmkms
src/sys/external/bsd/drm2/i915drm: files.i915drmkms
src/sys/external/bsd/drm2/nouveau: files.nouveau
src/sys/external/bsd/drm2/radeon: files.radeon

Log Message:
Eliminate -Wpointer-arith patches; use -Wno-pointer-arith instead.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/external/bsd/drm2/amdgpu/files.amdgpu
cvs rdiff -u -r1.9 -r1.10 src/sys/external/bsd/drm2/dist/drm/drm_bufs.c
cvs rdiff -u -r1.11 -r1.12 src/sys/external/bsd/drm2/dist/drm/drm_crtc.c
cvs rdiff -u -r1.8 -r1.9 src/sys/external/bsd/drm2/dist/drm/drm_dp_helper.c
cvs rdiff -u -r1.1 -r1.2 \
src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_atom.c \
src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_atombios_encoders.c \
src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_cz_dpm.c \
src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_gmc_v7_0.c \
src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_gmc_v8_0.c
cvs rdiff -u -r1.3 -r1.4 \
src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_atombios.c \
src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_ci_dpm.c \
src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_dce_v8_0.c \
src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_dpm.c \
src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_fence.c \
src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_test.c \
src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_ucode.c
cvs rdiff -u -r1.4 -r1.5 \
src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_bo_list.c \
src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_uvd.c
cvs rdiff -u -r1.2 -r1.3 \
src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_cz_smc.c \
src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_dce_v10_0.c \
src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_dce_v11_0.c \
src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_kv_dpm.c
cvs rdiff -u -r1.20 -r1.21 \
src/sys/external/bsd/drm2/dist/drm/i915/i915_cmd_parser.c
cvs rdiff -u -r1.56 -r1.57 src/sys/external/bsd/drm2/dist/drm/i915/i915_gem.c
cvs rdiff -u -r1.8 -r1.9 \
src/sys/external/bsd/drm2/dist/drm/i915/i915_guc_submission.c
cvs rdiff -u -r1.7 -r1.8 src/sys/external/bsd/drm2/dist/drm/i915/intel_bios.c
cvs rdiff -u -r1.15 -r1.16 \
src/sys/external/bsd/drm2/dist/drm/i915/intel_opregion.c
cvs rdiff -u -r1.5 -r1.6 src/sys/external/bsd/drm2/dist/drm/i915/intel_psr.c
cvs rdiff -u -r1.3 -r1.4 \

src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/bios/nouveau_nvkm_subdev_bios_shadowpci.c
cvs rdiff -u -r1.4 -r1.5 \

src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/instmem/nouveau_nvkm_subdev_instmem_base.c
cvs rdiff -u -r1.7 -r1.8 \

src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/instmem/nouveau_nvkm_subdev_instmem_nv40.c
cvs rdiff -u -r1.2 -r1.3 \
src/sys/external/bsd/drm2/dist/drm/radeon/drm_buffer.c
cvs rdiff -u -r1.3 -r1.4 \
src/sys/external/bsd/drm2/dist/drm/radeon/radeon_test.c
cvs rdiff -u -r1.4 -r1.5 \
src/sys/external/bsd/drm2/dist/drm/radeon/radeon_uvd.c
cvs rdiff -u -r1.33 -r1.34 src/sys/external/bsd/drm2/drm/files.drmkms
cvs rdiff -u -r1.38 -r1.39 src/sys/external/bsd/drm2/i915drm/files.i915drmkms
cvs rdiff -u -r1.28 -r1.29 src/sys/external/bsd/drm2/nouveau/files.nouveau
cvs rdiff -u -r1.27 -r1.28 src/sys/external/bsd/drm2/radeon/files.radeon

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/amdgpu/files.amdgpu
diff -u src/sys/external/bsd/drm2/amdgpu/files.amdgpu:1.7 src/sys/external/bsd/drm2/amdgpu/files.amdgpu:1.8
--- src/sys/external/bsd/drm2/amdgpu/files.amdgpu:1.7	Mon Aug 27 16:06

CVS commit: src/sys/external/bsd/drm2

2020-02-13 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri Feb 14 04:29:20 UTC 2020

Modified Files:
src/sys/external/bsd/drm2/dist/drm/amd/amdgpu: amdgpu_ci_dpm.c
src/sys/external/bsd/drm2/dist/drm/radeon: radeon_ci_dpm.c
radeon_si_dpm.c
src/sys/external/bsd/drm2/pci: drm_pci.c

Log Message:
New stub to reduce diff.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 \
src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_ci_dpm.c
cvs rdiff -u -r1.1 -r1.2 \
src/sys/external/bsd/drm2/dist/drm/radeon/radeon_ci_dpm.c \
src/sys/external/bsd/drm2/dist/drm/radeon/radeon_si_dpm.c
cvs rdiff -u -r1.32 -r1.33 src/sys/external/bsd/drm2/pci/drm_pci.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_ci_dpm.c
diff -u src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_ci_dpm.c:1.2 src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_ci_dpm.c:1.3
--- src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_ci_dpm.c:1.2	Mon Aug 27 14:24:03 2018
+++ src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_ci_dpm.c	Fri Feb 14 04:29:19 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: amdgpu_ci_dpm.c,v 1.2 2018/08/27 14:24:03 riastradh Exp $	*/
+/*	$NetBSD: amdgpu_ci_dpm.c,v 1.3 2020/02/14 04:29:19 riastradh Exp $	*/
 
 /*
  * Copyright 2013 Advanced Micro Devices, Inc.
@@ -24,7 +24,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: amdgpu_ci_dpm.c,v 1.2 2018/08/27 14:24:03 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: amdgpu_ci_dpm.c,v 1.3 2020/02/14 04:29:19 riastradh Exp $");
 
 #include 
 #include 
@@ -5858,22 +5858,18 @@ static int ci_dpm_init(struct amdgpu_dev
 	u8 frev, crev;
 	struct ci_power_info *pi;
 	int ret;
-#ifndef __NetBSD__		/* XXX amdgpu pcie */
 	u32 mask;
-#endif
 
 	pi = kzalloc(sizeof(struct ci_power_info), GFP_KERNEL);
 	if (pi == NULL)
 		return -ENOMEM;
 	adev->pm.dpm.priv = pi;
 
-#ifndef __NetBSD__		/* XXX amdgpu pcie */
 	ret = drm_pcie_get_speed_cap_mask(adev->ddev, &mask);
 	if (ret)
 		pi->sys_pcie_mask = 0;
 	else
 		pi->sys_pcie_mask = mask;
-#endif
 	pi->force_pcie_gen = AMDGPU_PCIE_GEN_INVALID;
 
 	pi->pcie_gen_performance.max = AMDGPU_PCIE_GEN1;

Index: src/sys/external/bsd/drm2/dist/drm/radeon/radeon_ci_dpm.c
diff -u src/sys/external/bsd/drm2/dist/drm/radeon/radeon_ci_dpm.c:1.1 src/sys/external/bsd/drm2/dist/drm/radeon/radeon_ci_dpm.c:1.2
--- src/sys/external/bsd/drm2/dist/drm/radeon/radeon_ci_dpm.c:1.1	Mon Aug 27 14:38:20 2018
+++ src/sys/external/bsd/drm2/dist/drm/radeon/radeon_ci_dpm.c	Fri Feb 14 04:29:19 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: radeon_ci_dpm.c,v 1.1 2018/08/27 14:38:20 riastradh Exp $	*/
+/*	$NetBSD: radeon_ci_dpm.c,v 1.2 2020/02/14 04:29:19 riastradh Exp $	*/
 
 /*
  * Copyright 2013 Advanced Micro Devices, Inc.
@@ -24,7 +24,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: radeon_ci_dpm.c,v 1.1 2018/08/27 14:38:20 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: radeon_ci_dpm.c,v 1.2 2020/02/14 04:29:19 riastradh Exp $");
 
 #include 
 #include "drmP.h"
@@ -5664,22 +5664,18 @@ int ci_dpm_init(struct radeon_device *rd
 	u8 frev, crev;
 	struct ci_power_info *pi;
 	int ret;
-#ifndef __NetBSD__
 	u32 mask;
-#endif
 
 	pi = kzalloc(sizeof(struct ci_power_info), GFP_KERNEL);
 	if (pi == NULL)
 		return -ENOMEM;
 	rdev->pm.dpm.priv = pi;
 
-#ifndef __NetBSD__
 	ret = drm_pcie_get_speed_cap_mask(rdev->ddev, &mask);
 	if (ret)
 		pi->sys_pcie_mask = 0;
 	else
 		pi->sys_pcie_mask = mask;
-#endif
 	pi->force_pcie_gen = RADEON_PCIE_GEN_INVALID;
 
 	pi->pcie_gen_performance.max = RADEON_PCIE_GEN1;
Index: src/sys/external/bsd/drm2/dist/drm/radeon/radeon_si_dpm.c
diff -u src/sys/external/bsd/drm2/dist/drm/radeon/radeon_si_dpm.c:1.1 src/sys/external/bsd/drm2/dist/drm/radeon/radeon_si_dpm.c:1.2
--- src/sys/external/bsd/drm2/dist/drm/radeon/radeon_si_dpm.c:1.1	Mon Aug 27 14:38:20 2018
+++ src/sys/external/bsd/drm2/dist/drm/radeon/radeon_si_dpm.c	Fri Feb 14 04:29:19 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: radeon_si_dpm.c,v 1.1 2018/08/27 14:38:20 riastradh Exp $	*/
+/*	$NetBSD: radeon_si_dpm.c,v 1.2 2020/02/14 04:29:19 riastradh Exp $	*/
 
 /*
  * Copyright 2013 Advanced Micro Devices, Inc.
@@ -24,7 +24,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: radeon_si_dpm.c,v 1.1 2018/08/27 14:38:20 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: radeon_si_dpm.c,v 1.2 2020/02/14 04:29:19 riastradh Exp $");
 
 #include "drmP.h"
 #include "radeon.h"
@@ -6957,9 +6957,7 @@ int si_dpm_init(struct radeon_device *rd
 	struct si_power_info *si_pi;
 	struct atom_clock_dividers dividers;
 	int ret;
-#ifndef __NetBSD__		/* XXX radeon pcie */
 	u32 mask;
-#endif
 
 	si_pi = kzalloc(sizeof(struct si_power_info), GFP_KERNEL);
 	if (si_pi == NULL)
@@ -6969,13 +6967,11 @@ int si_dpm_init(struct radeon_device *rd
 	eg_pi = &ni_pi->eg;
 	pi = &eg_pi->rv7xx;
 
-#ifndef __NetBSD__		/* XXX radeon pcie */
 	ret = drm_pcie_get_speed_cap_m

CVS commit: src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/pci

2020-02-12 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Wed Feb 12 22:34:51 UTC 2020

Modified Files:
src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/pci:
nouveau_nvkm_subdev_pci_base.c

Log Message:
adjust the PCI interrupt allocation code to work the same as
drm_pci_request_irq(), now the driver successfully allocates MSI interrupt

[   3.6619808] nouveau0: info: NVIDIA GK208B (b06070b1)
[   3.7685336] nouveau0: info: bios: version 80.28.78.00.4b
[   3.7785491] nouveau0: interrupting at msi8 vec 0 (nouveau0)

related to PR kern/52440 by John D. Baker


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 \

src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/pci/nouveau_nvkm_subdev_pci_base.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/pci/nouveau_nvkm_subdev_pci_base.c
diff -u src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/pci/nouveau_nvkm_subdev_pci_base.c:1.6 src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/pci/nouveau_nvkm_subdev_pci_base.c:1.7
--- src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/pci/nouveau_nvkm_subdev_pci_base.c:1.6	Fri Feb  7 18:13:33 2020
+++ src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/pci/nouveau_nvkm_subdev_pci_base.c	Wed Feb 12 22:34:51 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: nouveau_nvkm_subdev_pci_base.c,v 1.6 2020/02/07 18:13:33 jmcneill Exp $	*/
+/*	$NetBSD: nouveau_nvkm_subdev_pci_base.c,v 1.7 2020/02/12 22:34:51 jdolecek Exp $	*/
 
 /*
  * Copyright 2015 Red Hat Inc.
@@ -24,7 +24,7 @@
  * Authors: Ben Skeggs 
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: nouveau_nvkm_subdev_pci_base.c,v 1.6 2020/02/07 18:13:33 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nouveau_nvkm_subdev_pci_base.c,v 1.7 2020/02/12 22:34:51 jdolecek Exp $");
 
 #include "priv.h"
 #include "agp.h"
@@ -141,22 +141,51 @@ nvkm_pci_init(struct nvkm_subdev *subdev
 
 #ifdef __NetBSD__
 {
+	const char *const name = device_xname(pci_dev_dev(pdev));
 	const struct pci_attach_args *pa = &pdev->pd_pa;
-	int counts[PCI_INTR_TYPE_SIZE] =  {
-			[PCI_INTR_TYPE_INTX] = 1,
-			[PCI_INTR_TYPE_MSI] = 0,
-			[PCI_INTR_TYPE_MSIX] = 0,
-	};
+	const char *intrstr;
+	char intrbuf[PCI_INTRSTR_LEN];
 
-	/* XXX errno NetBSD->Linux */
-	ret = -pci_intr_alloc(pa, &pci->pci_ihp, counts, PCI_INTR_TYPE_INTX);
-	if (ret)
-		return ret;
+	/* XXX convert to use drm_pci_request_irq() */
+	if (pdev->msi_enabled) {
+		if (pdev->pd_intr_handles == NULL) {
+			if ((ret = pci_msi_alloc_exact(pa, &pci->pci_ihp,
+			1))) {
+aprint_error_dev(pci_dev_dev(pdev),
+"couldn't allocate MSI (%s)\n", name);
+/* XXX errno NetBSD->Linux */
+return -ret;
+			}
+		} else {
+			pci->pci_ihp = pdev->pd_intr_handles;
+			pdev->pd_intr_handles = NULL;
+		}
+	} else {
+		if ((ret = pci_intx_alloc(pa, &pci->pci_ihp))) {
+			aprint_error_dev(pci_dev_dev(pdev),
+			"couldn't allocate INTx interrupt (%s)\n",
+			name);
+
+			/* XXX errno NetBSD->Linux */
+			return -ret;
+		}
+	}
+
+	intrstr = pci_intr_string(pa->pa_pc, pci->pci_ihp[0],
+	intrbuf, sizeof(intrbuf));
 	pci->pci_intrcookie = pci_intr_establish_xname(pa->pa_pc,
 	pci->pci_ihp[0], IPL_DRM, nvkm_pci_intr, pci,
-	device_xname(pci_dev_dev(pdev)));
-	if (pci->pci_intrcookie == NULL)
+	name);
+	if (pci->pci_intrcookie == NULL) {
+		aprint_error_dev(pci_dev_dev(pdev),
+		"couldn't establish interrupt at %s (%s)\n", intrstr, name);
+		pci_intr_release(pa->pa_pc, pci->pci_ihp, 1);
+		pci->pci_ihp = NULL;
 		return -EIO;	/* XXX er? */
+	}
+
+	aprint_normal_dev(pci_dev_dev(pdev), "interrupting at %s (%s)\n",
+	intrstr, name);
 }
 #else
 	ret = request_irq(pdev->irq, nvkm_pci_intr, IRQF_SHARED, "nvkm", pci);



CVS commit: src/sys/external/bsd/drm2/dist/drm/nouveau

2020-02-12 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Wed Feb 12 20:31:46 UTC 2020

Modified Files:
src/sys/external/bsd/drm2/dist/drm/nouveau: nouveau_fbcon.c

Log Message:
remove superfluous static variable used only to zero attach args


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 \
src/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_fbcon.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_fbcon.c
diff -u src/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_fbcon.c:1.7 src/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_fbcon.c:1.8
--- src/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_fbcon.c:1.7	Wed Feb 12 20:25:48 2020
+++ src/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_fbcon.c	Wed Feb 12 20:31:46 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: nouveau_fbcon.c,v 1.7 2020/02/12 20:25:48 jdolecek Exp $	*/
+/*	$NetBSD: nouveau_fbcon.c,v 1.8 2020/02/12 20:31:46 jdolecek Exp $	*/
 
 /*
  * Copyright © 2007 David Airlie
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: nouveau_fbcon.c,v 1.7 2020/02/12 20:25:48 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nouveau_fbcon.c,v 1.8 2020/02/12 20:31:46 jdolecek Exp $");
 
 #include 
 #include 
@@ -434,10 +434,9 @@ nouveau_fbcon_create(struct drm_fb_helpe
 
 	nouveau_fbcon_zfill(dev, fbcon);
 
-{
-	static const struct nouveaufb_attach_args zero_nfa;
-	struct nouveaufb_attach_args nfa = zero_nfa;
+	struct nouveaufb_attach_args nfa;
 
+	memset(&nfa, 0, sizeof(nfa));
 	nfa.nfa_fb_helper = helper;
 	nfa.nfa_fb_sizes = *sizes;
 	nfa.nfa_fb_ptr = nvbo_kmap_obj_iovirtual(nvbo);
@@ -448,7 +447,7 @@ nouveau_fbcon_create(struct drm_fb_helpe
 	if (helper->fbdev == NULL) {
 		goto out_unlock;
 	}
-}
+
 	helper->fb = fb;
 
 	return 0;



CVS commit: src/sys/external/bsd/drm2/dist/drm/nouveau

2020-02-12 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Wed Feb 12 20:25:48 UTC 2020

Modified Files:
src/sys/external/bsd/drm2/dist/drm/nouveau: nouveau_fbcon.c

Log Message:
don't consider it error when nouveaufbbus fails to attach, it currently
can happen only not configured into the kernel


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 \
src/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_fbcon.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_fbcon.c
diff -u src/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_fbcon.c:1.6 src/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_fbcon.c:1.7
--- src/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_fbcon.c:1.6	Wed Feb 12 20:08:31 2020
+++ src/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_fbcon.c	Wed Feb 12 20:25:48 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: nouveau_fbcon.c,v 1.6 2020/02/12 20:08:31 jdolecek Exp $	*/
+/*	$NetBSD: nouveau_fbcon.c,v 1.7 2020/02/12 20:25:48 jdolecek Exp $	*/
 
 /*
  * Copyright © 2007 David Airlie
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: nouveau_fbcon.c,v 1.6 2020/02/12 20:08:31 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nouveau_fbcon.c,v 1.7 2020/02/12 20:25:48 jdolecek Exp $");
 
 #include 
 #include 
@@ -356,6 +356,17 @@ nouveau_fbcon_zfill(struct drm_device *d
 #endif
 }
 
+#ifdef __NetBSD__
+static int
+nouveau_fbcon_print(void *aux, const char *pnp)
+{
+	if (pnp)
+		aprint_normal("nouveaufbbus at %s", pnp);
+
+	return (UNCONF);
+}
+#endif
+
 static int
 nouveau_fbcon_create(struct drm_fb_helper *helper,
 		 struct drm_fb_helper_surface_size *sizes)
@@ -432,9 +443,9 @@ nouveau_fbcon_create(struct drm_fb_helpe
 	nfa.nfa_fb_ptr = nvbo_kmap_obj_iovirtual(nvbo);
 	nfa.nfa_fb_linebytes = mode_cmd.pitches[0];
 
-	helper->fbdev = config_found_ia(dev->dev, "nouveaufbbus", &nfa, NULL);
+	helper->fbdev = config_found_ia(dev->dev, "nouveaufbbus", &nfa,
+	nouveau_fbcon_print);
 	if (helper->fbdev == NULL) {
-		DRM_ERROR("failed to attach nouveaufb\n");
 		goto out_unlock;
 	}
 }



CVS commit: src/sys/external/bsd/drm2/dist/drm/ttm

2020-02-12 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Wed Feb 12 20:22:37 UTC 2020

Modified Files:
src/sys/external/bsd/drm2/dist/drm/ttm: ttm_bo.c

Log Message:
mark case fallthrough to avoid warning


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/external/bsd/drm2/dist/drm/ttm/ttm_bo.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/dist/drm/ttm/ttm_bo.c
diff -u src/sys/external/bsd/drm2/dist/drm/ttm/ttm_bo.c:1.15 src/sys/external/bsd/drm2/dist/drm/ttm/ttm_bo.c:1.16
--- src/sys/external/bsd/drm2/dist/drm/ttm/ttm_bo.c:1.15	Sat Feb  2 21:46:27 2019
+++ src/sys/external/bsd/drm2/dist/drm/ttm/ttm_bo.c	Wed Feb 12 20:22:37 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: ttm_bo.c,v 1.15 2019/02/02 21:46:27 mrg Exp $	*/
+/*	$NetBSD: ttm_bo.c,v 1.16 2020/02/12 20:22:37 jdolecek Exp $	*/
 
 /**
  *
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ttm_bo.c,v 1.15 2019/02/02 21:46:27 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ttm_bo.c,v 1.16 2020/02/12 20:22:37 jdolecek Exp $");
 
 #define pr_fmt(fmt) "[TTM] " fmt
 
@@ -273,6 +273,7 @@ static int ttm_bo_add_ttm(struct ttm_buf
 	case ttm_bo_type_device:
 		if (zero_alloc)
 			page_flags |= TTM_PAGE_FLAG_ZERO_ALLOC;
+		/* FALLTHROUGH */
 	case ttm_bo_type_kernel:
 		bo->ttm = bdev->driver->ttm_tt_create(bdev, bo->num_pages << PAGE_SHIFT,
 		  page_flags, glob->dummy_read_page);



CVS commit: src/sys/external/bsd/drm2/dist/drm/nouveau

2020-02-12 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Wed Feb 12 20:08:32 UTC 2020

Modified Files:
src/sys/external/bsd/drm2/dist/drm/nouveau: nouveau_fbcon.c

Log Message:
fix error path when nouveaufb fails to attach (such as when it's not
actually configured into the kernel), the gem was not released
properly leading to:
panic: LOCKDEBUG: Reader / writer lock error: kmem_intr_free,289: allocation 
contains active lock


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 \
src/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_fbcon.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_fbcon.c
diff -u src/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_fbcon.c:1.5 src/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_fbcon.c:1.6
--- src/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_fbcon.c:1.5	Mon Aug 27 07:57:34 2018
+++ src/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_fbcon.c	Wed Feb 12 20:08:31 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: nouveau_fbcon.c,v 1.5 2018/08/27 07:57:34 riastradh Exp $	*/
+/*	$NetBSD: nouveau_fbcon.c,v 1.6 2020/02/12 20:08:31 jdolecek Exp $	*/
 
 /*
  * Copyright © 2007 David Airlie
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: nouveau_fbcon.c,v 1.5 2018/08/27 07:57:34 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nouveau_fbcon.c,v 1.6 2020/02/12 20:08:31 jdolecek Exp $");
 
 #include 
 #include 
@@ -507,7 +507,7 @@ out_unlock:
 out_unpin:
 	nouveau_bo_unpin(nvbo);
 out_unref:
-	nouveau_bo_ref(NULL, &nvbo);
+	nouveau_gem_object_del(&nvbo->gem);
 out:
 	return ret;
 }



CVS commit: src/sys/external/bsd/drm2/linux

2020-02-12 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Wed Feb 12 18:35:02 UTC 2020

Modified Files:
src/sys/external/bsd/drm2/linux: linux_pci.c

Log Message:
re-enable MSI - this actually enables MSI only for intel/radeon/generic
which are reported to work fine, while nouveau (which breaks with
MSI) still uses INTx

see the thread
http://mail-index.netbsd.org/current-users/2020/02/06/msg037661.html


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/external/bsd/drm2/linux/linux_pci.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/linux/linux_pci.c
diff -u src/sys/external/bsd/drm2/linux/linux_pci.c:1.9 src/sys/external/bsd/drm2/linux/linux_pci.c:1.10
--- src/sys/external/bsd/drm2/linux/linux_pci.c:1.9	Fri Feb  7 18:13:33 2020
+++ src/sys/external/bsd/drm2/linux/linux_pci.c	Wed Feb 12 18:35:01 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux_pci.c,v 1.9 2020/02/07 18:13:33 jmcneill Exp $	*/
+/*	$NetBSD: linux_pci.c,v 1.10 2020/02/12 18:35:01 jdolecek Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
 #endif
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: linux_pci.c,v 1.9 2020/02/07 18:13:33 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_pci.c,v 1.10 2020/02/12 18:35:01 jdolecek Exp $");
 
 #include 
 
@@ -266,7 +266,6 @@ pci_bus_write_config_byte(struct pci_bus
 int
 pci_enable_msi(struct pci_dev *pdev)
 {
-#ifdef notyet
 	const struct pci_attach_args *const pa = &pdev->pd_pa;
 
 	if (pci_msi_alloc_exact(pa, &pdev->pd_intr_handles, 1))
@@ -274,9 +273,6 @@ pci_enable_msi(struct pci_dev *pdev)
 
 	pdev->msi_enabled = 1;
 	return 0;
-#else
-	return -ENOSYS;
-#endif
 }
 
 void



CVS commit: src/sys/external/bsd/drm2/dist/drm/i915

2020-02-10 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Mon Feb 10 21:54:26 UTC 2020

Modified Files:
src/sys/external/bsd/drm2/dist/drm/i915: intel_opregion.c

Log Message:
Use a closer equivalent to MEMREMAP_WB: BUS_SPACE_MAP_CACHEABLE

Not a fix for PR port-amd64/54808


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 \
src/sys/external/bsd/drm2/dist/drm/i915/intel_opregion.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/dist/drm/i915/intel_opregion.c
diff -u src/sys/external/bsd/drm2/dist/drm/i915/intel_opregion.c:1.14 src/sys/external/bsd/drm2/dist/drm/i915/intel_opregion.c:1.15
--- src/sys/external/bsd/drm2/dist/drm/i915/intel_opregion.c:1.14	Mon Aug 27 13:54:48 2018
+++ src/sys/external/bsd/drm2/dist/drm/i915/intel_opregion.c	Mon Feb 10 21:54:26 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: intel_opregion.c,v 1.14 2018/08/27 13:54:48 riastradh Exp $	*/
+/*	$NetBSD: intel_opregion.c,v 1.15 2020/02/10 21:54:26 maya Exp $	*/
 
 /*
  * Copyright 2008 Intel Corporation 
@@ -28,7 +28,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: intel_opregion.c,v 1.14 2018/08/27 13:54:48 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: intel_opregion.c,v 1.15 2020/02/10 21:54:26 maya Exp $");
 
 #include 
 #include 
@@ -997,7 +997,7 @@ int intel_opregion_setup(struct drm_devi
 #ifdef __NetBSD__
 	opregion->bst = dev->pdev->pd_pa.pa_memt;
 	err = -bus_space_map(opregion->bst, asls, OPREGION_SIZE,
-	BUS_SPACE_MAP_LINEAR|BUS_SPACE_MAP_PREFETCHABLE, &opregion->bsh);
+	BUS_SPACE_MAP_LINEAR|BUS_SPACE_MAP_CACHEABLE, &opregion->bsh);
 	if (err) {
 		DRM_DEBUG_DRIVER("Failed to map opregion: %d\n", err);
 		return err;



CVS commit: src/sys/external/bsd/drm2

2020-02-07 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Fri Feb  7 18:13:33 UTC 2020

Modified Files:
src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/pci:
nouveau_nvkm_subdev_pci_base.c
src/sys/external/bsd/drm2/linux: linux_pci.c

Log Message:
Turn MSI off again.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 \

src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/pci/nouveau_nvkm_subdev_pci_base.c
cvs rdiff -u -r1.8 -r1.9 src/sys/external/bsd/drm2/linux/linux_pci.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/pci/nouveau_nvkm_subdev_pci_base.c
diff -u src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/pci/nouveau_nvkm_subdev_pci_base.c:1.5 src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/pci/nouveau_nvkm_subdev_pci_base.c:1.6
--- src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/pci/nouveau_nvkm_subdev_pci_base.c:1.5	Mon Feb  3 16:22:25 2020
+++ src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/pci/nouveau_nvkm_subdev_pci_base.c	Fri Feb  7 18:13:33 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: nouveau_nvkm_subdev_pci_base.c,v 1.5 2020/02/03 16:22:25 jmcneill Exp $	*/
+/*	$NetBSD: nouveau_nvkm_subdev_pci_base.c,v 1.6 2020/02/07 18:13:33 jmcneill Exp $	*/
 
 /*
  * Copyright 2015 Red Hat Inc.
@@ -24,7 +24,7 @@
  * Authors: Ben Skeggs 
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: nouveau_nvkm_subdev_pci_base.c,v 1.5 2020/02/03 16:22:25 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nouveau_nvkm_subdev_pci_base.c,v 1.6 2020/02/07 18:13:33 jmcneill Exp $");
 
 #include "priv.h"
 #include "agp.h"
@@ -142,18 +142,14 @@ nvkm_pci_init(struct nvkm_subdev *subdev
 #ifdef __NetBSD__
 {
 	const struct pci_attach_args *pa = &pdev->pd_pa;
-	const pci_intr_type_t intr_type = pci->msi ?
-	PCI_INTR_TYPE_MSI : PCI_INTR_TYPE_INTX;
-
 	int counts[PCI_INTR_TYPE_SIZE] =  {
-			[PCI_INTR_TYPE_INTX] = 0,
+			[PCI_INTR_TYPE_INTX] = 1,
 			[PCI_INTR_TYPE_MSI] = 0,
 			[PCI_INTR_TYPE_MSIX] = 0,
 	};
-	counts[intr_type] = 1;
 
 	/* XXX errno NetBSD->Linux */
-	ret = -pci_intr_alloc(pa, &pci->pci_ihp, counts, intr_type);
+	ret = -pci_intr_alloc(pa, &pci->pci_ihp, counts, PCI_INTR_TYPE_INTX);
 	if (ret)
 		return ret;
 	pci->pci_intrcookie = pci_intr_establish_xname(pa->pa_pc,

Index: src/sys/external/bsd/drm2/linux/linux_pci.c
diff -u src/sys/external/bsd/drm2/linux/linux_pci.c:1.8 src/sys/external/bsd/drm2/linux/linux_pci.c:1.9
--- src/sys/external/bsd/drm2/linux/linux_pci.c:1.8	Mon Feb  3 16:22:52 2020
+++ src/sys/external/bsd/drm2/linux/linux_pci.c	Fri Feb  7 18:13:33 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux_pci.c,v 1.8 2020/02/03 16:22:52 jmcneill Exp $	*/
+/*	$NetBSD: linux_pci.c,v 1.9 2020/02/07 18:13:33 jmcneill Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
 #endif
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: linux_pci.c,v 1.8 2020/02/03 16:22:52 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_pci.c,v 1.9 2020/02/07 18:13:33 jmcneill Exp $");
 
 #include 
 
@@ -266,6 +266,7 @@ pci_bus_write_config_byte(struct pci_bus
 int
 pci_enable_msi(struct pci_dev *pdev)
 {
+#ifdef notyet
 	const struct pci_attach_args *const pa = &pdev->pd_pa;
 
 	if (pci_msi_alloc_exact(pa, &pdev->pd_intr_handles, 1))
@@ -273,6 +274,9 @@ pci_enable_msi(struct pci_dev *pdev)
 
 	pdev->msi_enabled = 1;
 	return 0;
+#else
+	return -ENOSYS;
+#endif
 }
 
 void



CVS commit: src/sys/external/bsd/drm2/nouveau

2020-02-03 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Feb  3 16:52:13 UTC 2020

Modified Files:
src/sys/external/bsd/drm2/nouveau: nouveau_pci.c

Log Message:
Disable simplefb if nouveau attaches


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/sys/external/bsd/drm2/nouveau/nouveau_pci.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/nouveau/nouveau_pci.c
diff -u src/sys/external/bsd/drm2/nouveau/nouveau_pci.c:1.25 src/sys/external/bsd/drm2/nouveau/nouveau_pci.c:1.26
--- src/sys/external/bsd/drm2/nouveau/nouveau_pci.c:1.25	Sat Oct  5 22:37:49 2019
+++ src/sys/external/bsd/drm2/nouveau/nouveau_pci.c	Mon Feb  3 16:52:13 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: nouveau_pci.c,v 1.25 2019/10/05 22:37:49 mrg Exp $	*/
+/*	$NetBSD: nouveau_pci.c,v 1.26 2020/02/03 16:52:13 jmcneill Exp $	*/
 
 /*-
  * Copyright (c) 2015 The NetBSD Foundation, Inc.
@@ -30,7 +30,13 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: nouveau_pci.c,v 1.25 2019/10/05 22:37:49 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nouveau_pci.c,v 1.26 2020/02/03 16:52:13 jmcneill Exp $");
+
+#ifdef _KERNEL_OPT
+#if defined(__arm__) || defined(__aarch64__)
+#include "opt_fdt.h"
+#endif
+#endif
 
 #include 
 #include 
@@ -43,6 +49,10 @@ __KERNEL_RCSID(0, "$NetBSD: nouveau_pci.
 #include 
 #include 
 
+#ifdef FDT
+#include 
+#endif
+
 #include "nouveau_drm.h"
 #include "nouveau_pci.h"
 
@@ -154,6 +164,15 @@ nouveau_pci_attach(device_t parent, devi
 	sc->sc_dev = NULL;
 	sc->sc_pa = *pa;
 
+#ifdef FDT
+	/*
+	 * XXX Remove the simple framebuffer, assuming that this device
+	 * will take over.
+	 */
+	const char *fb_compatible[] = { "simple-framebuffer", NULL };
+	fdt_remove_bycompat(fb_compatible);
+#endif
+
 	config_mountroot(self, &nouveau_pci_attach_real);
 }
 



CVS commit: src/sys/external/bsd/drm2/linux

2020-02-03 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Feb  3 16:22:52 UTC 2020

Modified Files:
src/sys/external/bsd/drm2/linux: linux_pci.c

Log Message:
Re-enable PCI MSI for DRM devices


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/external/bsd/drm2/linux/linux_pci.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/linux/linux_pci.c
diff -u src/sys/external/bsd/drm2/linux/linux_pci.c:1.7 src/sys/external/bsd/drm2/linux/linux_pci.c:1.8
--- src/sys/external/bsd/drm2/linux/linux_pci.c:1.7	Sat Jan 18 02:59:42 2020
+++ src/sys/external/bsd/drm2/linux/linux_pci.c	Mon Feb  3 16:22:52 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux_pci.c,v 1.7 2020/01/18 02:59:42 jmcneill Exp $	*/
+/*	$NetBSD: linux_pci.c,v 1.8 2020/02/03 16:22:52 jmcneill Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
 #endif
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: linux_pci.c,v 1.7 2020/01/18 02:59:42 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_pci.c,v 1.8 2020/02/03 16:22:52 jmcneill Exp $");
 
 #include 
 
@@ -266,7 +266,6 @@ pci_bus_write_config_byte(struct pci_bus
 int
 pci_enable_msi(struct pci_dev *pdev)
 {
-#ifdef notyet
 	const struct pci_attach_args *const pa = &pdev->pd_pa;
 
 	if (pci_msi_alloc_exact(pa, &pdev->pd_intr_handles, 1))
@@ -274,9 +273,6 @@ pci_enable_msi(struct pci_dev *pdev)
 
 	pdev->msi_enabled = 1;
 	return 0;
-#else
-	return -ENOSYS;
-#endif
 }
 
 void



CVS commit: src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/pci

2020-02-03 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Feb  3 16:22:25 UTC 2020

Modified Files:
src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/pci:
nouveau_nvkm_subdev_pci_base.c

Log Message:
Use the correct PCI interrupt type based on what the driver has configured


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 \

src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/pci/nouveau_nvkm_subdev_pci_base.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/pci/nouveau_nvkm_subdev_pci_base.c
diff -u src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/pci/nouveau_nvkm_subdev_pci_base.c:1.4 src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/pci/nouveau_nvkm_subdev_pci_base.c:1.5
--- src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/pci/nouveau_nvkm_subdev_pci_base.c:1.4	Wed Dec 19 09:20:56 2018
+++ src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/pci/nouveau_nvkm_subdev_pci_base.c	Mon Feb  3 16:22:25 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: nouveau_nvkm_subdev_pci_base.c,v 1.4 2018/12/19 09:20:56 maya Exp $	*/
+/*	$NetBSD: nouveau_nvkm_subdev_pci_base.c,v 1.5 2020/02/03 16:22:25 jmcneill Exp $	*/
 
 /*
  * Copyright 2015 Red Hat Inc.
@@ -24,7 +24,7 @@
  * Authors: Ben Skeggs 
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: nouveau_nvkm_subdev_pci_base.c,v 1.4 2018/12/19 09:20:56 maya Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nouveau_nvkm_subdev_pci_base.c,v 1.5 2020/02/03 16:22:25 jmcneill Exp $");
 
 #include "priv.h"
 #include "agp.h"
@@ -142,14 +142,18 @@ nvkm_pci_init(struct nvkm_subdev *subdev
 #ifdef __NetBSD__
 {
 	const struct pci_attach_args *pa = &pdev->pd_pa;
+	const pci_intr_type_t intr_type = pci->msi ?
+	PCI_INTR_TYPE_MSI : PCI_INTR_TYPE_INTX;
+
 	int counts[PCI_INTR_TYPE_SIZE] =  {
-			[PCI_INTR_TYPE_INTX] = 1,
+			[PCI_INTR_TYPE_INTX] = 0,
 			[PCI_INTR_TYPE_MSI] = 0,
 			[PCI_INTR_TYPE_MSIX] = 0,
 	};
+	counts[intr_type] = 1;
 
 	/* XXX errno NetBSD->Linux */
-	ret = -pci_intr_alloc(pa, &pci->pci_ihp, counts, PCI_INTR_TYPE_INTX);
+	ret = -pci_intr_alloc(pa, &pci->pci_ihp, counts, intr_type);
 	if (ret)
 		return ret;
 	pci->pci_intrcookie = pci_intr_establish_xname(pa->pa_pc,



CVS commit: src/sys/external/bsd/drm2/ttm

2020-01-28 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Tue Jan 28 23:24:09 UTC 2020

Modified Files:
src/sys/external/bsd/drm2/ttm: ttm_bo_vm.c

Log Message:
Do not extract mmap flags from the bus_space_mmap cookie as they may
conflict with the bo's existing protection flags. This caused VRAM to
be incorrectly mapped as Device-nGnRE on Arm64 instead of Normal-NC. Ok
riastradh@.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/external/bsd/drm2/ttm/ttm_bo_vm.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/ttm/ttm_bo_vm.c
diff -u src/sys/external/bsd/drm2/ttm/ttm_bo_vm.c:1.12 src/sys/external/bsd/drm2/ttm/ttm_bo_vm.c:1.13
--- src/sys/external/bsd/drm2/ttm/ttm_bo_vm.c:1.12	Sat Mar  9 01:59:47 2019
+++ src/sys/external/bsd/drm2/ttm/ttm_bo_vm.c	Tue Jan 28 23:24:09 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: ttm_bo_vm.c,v 1.12 2019/03/09 01:59:47 mrg Exp $	*/
+/*	$NetBSD: ttm_bo_vm.c,v 1.13 2020/01/28 23:24:09 jmcneill Exp $	*/
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ttm_bo_vm.c,v 1.12 2019/03/09 01:59:47 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ttm_bo_vm.c,v 1.13 2020/01/28 23:24:09 jmcneill Exp $");
 
 #include 
 
@@ -89,7 +89,6 @@ ttm_bo_uvm_fault(struct uvm_faultinfo *u
 	unsigned i;
 	vm_prot_t vm_prot;	/* VM_PROT_* */
 	pgprot_t pgprot;	/* VM_PROT_* | PMAP_* cacheability flags */
-	unsigned mmapflags;
 	int ret;
 
 	/* Thanks, uvm, but we don't need this lock.  */
@@ -189,13 +188,11 @@ ttm_bo_uvm_fault(struct uvm_faultinfo *u
 			0);
 
 			paddr = pmap_phys_address(cookie);
-			mmapflags = pmap_mmap_flags(cookie);
 		} else {
 			paddr = page_to_phys(u.ttm->pages[startpage + i]);
-			mmapflags = 0;
 		}
 		ret = -pmap_enter(ufi->orig_map->pmap, vaddr + i*PAGE_SIZE,
-		paddr, vm_prot, (PMAP_CANFAIL | pgprot | mmapflags));
+		paddr, vm_prot, (PMAP_CANFAIL | pgprot));
 		if (ret)
 			goto out3;
 	}



CVS commit: src/sys/external/bsd/drm2/dist/drm/ttm

2020-01-28 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Tue Jan 28 23:21:05 UTC 2020

Modified Files:
src/sys/external/bsd/drm2/dist/drm/ttm: ttm_bo_util.c

Log Message:
ttm_io_prot: follow linux semantics and set either PMAP_WRITE_COMBINE or
PMAP_NOCACHE when existing cache flags are not set


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 \
src/sys/external/bsd/drm2/dist/drm/ttm/ttm_bo_util.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/dist/drm/ttm/ttm_bo_util.c
diff -u src/sys/external/bsd/drm2/dist/drm/ttm/ttm_bo_util.c:1.14 src/sys/external/bsd/drm2/dist/drm/ttm/ttm_bo_util.c:1.15
--- src/sys/external/bsd/drm2/dist/drm/ttm/ttm_bo_util.c:1.14	Thu Aug 30 01:19:49 2018
+++ src/sys/external/bsd/drm2/dist/drm/ttm/ttm_bo_util.c	Tue Jan 28 23:21:05 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: ttm_bo_util.c,v 1.14 2018/08/30 01:19:49 riastradh Exp $	*/
+/*	$NetBSD: ttm_bo_util.c,v 1.15 2020/01/28 23:21:05 jmcneill Exp $	*/
 
 /**
  *
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ttm_bo_util.c,v 1.14 2018/08/30 01:19:49 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ttm_bo_util.c,v 1.15 2020/01/28 23:21:05 jmcneill Exp $");
 
 #include 
 #include 
@@ -565,17 +565,11 @@ pgprot_t ttm_io_prot(uint32_t caching_fl
 		return tmp;
 
 #ifdef __NetBSD__
-	switch (caching_flags & TTM_PL_MASK_CACHING) {
-	case TTM_PL_FLAG_CACHED:
-		return (tmp | PMAP_WRITE_BACK);
-	case TTM_PL_FLAG_WC:
+	tmp &= ~PMAP_CACHE_MASK;
+	if (caching_flags & TTM_PL_FLAG_WC)
 		return (tmp | PMAP_WRITE_COMBINE);
-	case TTM_PL_FLAG_UNCACHED:
+	else
 		return (tmp | PMAP_NOCACHE);
-	default:
-		panic("invalid caching flags: %"PRIx32"\n",
-		(caching_flags & TTM_PL_MASK_CACHING));
-	}
 #else
 #if defined(__i386__) || defined(__x86_64__)
 	if (caching_flags & TTM_PL_FLAG_WC)



CVS commit: src/sys/external/bsd/drm2/dist/drm/radeon

2020-01-26 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Jan 26 14:36:36 UTC 2020

Modified Files:
src/sys/external/bsd/drm2/dist/drm/radeon: radeon.h radeon_device.c

Log Message:
Zero the dummy page


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/external/bsd/drm2/dist/drm/radeon/radeon.h \
src/sys/external/bsd/drm2/dist/drm/radeon/radeon_device.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/dist/drm/radeon/radeon.h
diff -u src/sys/external/bsd/drm2/dist/drm/radeon/radeon.h:1.6 src/sys/external/bsd/drm2/dist/drm/radeon/radeon.h:1.7
--- src/sys/external/bsd/drm2/dist/drm/radeon/radeon.h:1.6	Mon Aug 27 06:38:51 2018
+++ src/sys/external/bsd/drm2/dist/drm/radeon/radeon.h	Sun Jan 26 14:36:35 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: radeon.h,v 1.6 2018/08/27 06:38:51 riastradh Exp $	*/
+/*	$NetBSD: radeon.h,v 1.7 2020/01/26 14:36:35 jmcneill Exp $	*/
 
 /*
  * Copyright 2008 Advanced Micro Devices, Inc.
@@ -259,6 +259,7 @@ struct radeon_dummy_page {
 #ifdef __NetBSD__
 	bus_dma_segment_t	rdp_seg;
 	bus_dmamap_t		rdp_map;
+	void		*rdp_addr;
 #else
 	struct page	*page;
 #endif
Index: src/sys/external/bsd/drm2/dist/drm/radeon/radeon_device.c
diff -u src/sys/external/bsd/drm2/dist/drm/radeon/radeon_device.c:1.6 src/sys/external/bsd/drm2/dist/drm/radeon/radeon_device.c:1.7
--- src/sys/external/bsd/drm2/dist/drm/radeon/radeon_device.c:1.6	Mon Aug 27 07:48:40 2018
+++ src/sys/external/bsd/drm2/dist/drm/radeon/radeon_device.c	Sun Jan 26 14:36:35 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: radeon_device.c,v 1.6 2018/08/27 07:48:40 riastradh Exp $	*/
+/*	$NetBSD: radeon_device.c,v 1.7 2020/01/26 14:36:35 jmcneill Exp $	*/
 
 /*
  * Copyright 2008 Advanced Micro Devices, Inc.
@@ -28,7 +28,7 @@
  *  Jerome Glisse
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: radeon_device.c,v 1.6 2018/08/27 07:48:40 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: radeon_device.c,v 1.7 2020/01/26 14:36:35 jmcneill Exp $");
 
 #include 
 #include 
@@ -835,10 +835,17 @@ int radeon_dummy_page_init(struct radeon
 	BUS_DMA_WAITOK, &rdev->dummy_page.rdp_map);
 	if (error)
 		goto fail1;
-	error = bus_dmamap_load_raw(rdev->ddev->dmat, rdev->dummy_page.rdp_map,
-	&rdev->dummy_page.rdp_seg, 1, PAGE_SIZE, BUS_DMA_WAITOK);
+	error = bus_dmamem_map(rdev->ddev->dmat, &rdev->dummy_page.rdp_seg, 1,
+	PAGE_SIZE, &rdev->dummy_page.rdp_addr,
+	BUS_DMA_WAITOK|BUS_DMA_NOCACHE);
 	if (error)
 		goto fail2;
+	error = bus_dmamap_load(rdev->ddev->dmat, rdev->dummy_page.rdp_map,
+	rdev->dummy_page.rdp_addr, PAGE_SIZE, NULL, BUS_DMA_WAITOK);
+	if (error)
+		goto fail3;
+
+	memset(rdev->dummy_page.rdp_addr, 0, PAGE_SIZE);
 
 	/* Success!  */
 	rdev->dummy_page.addr = rdev->dummy_page.rdp_map->dm_segs[0].ds_addr;
@@ -846,8 +853,10 @@ int radeon_dummy_page_init(struct radeon
 		rdev->dummy_page.addr, RADEON_GART_PAGE_DUMMY);
 	return 0;
 
-fail3: __unused
+fail4: __unused
 	bus_dmamap_unload(rdev->ddev->dmat, rdev->dummy_page.rdp_map);
+fail3:	bus_dmamem_unmap(rdev->ddev->dmat, rdev->dummy_page.rdp_addr,
+	PAGE_SIZE);
 fail2:	bus_dmamap_destroy(rdev->ddev->dmat, rdev->dummy_page.rdp_map);
 fail1:	bus_dmamem_free(rdev->ddev->dmat, &rdev->dummy_page.rdp_seg, 1);
 fail0:	KASSERT(error);
@@ -888,6 +897,8 @@ void radeon_dummy_page_fini(struct radeo
 	if (rdev->dummy_page.rdp_map == NULL)
 		return;
 	bus_dmamap_unload(rdev->ddev->dmat, rdev->dummy_page.rdp_map);
+	bus_dmamem_unmap(rdev->ddev->dmat, rdev->dummy_page.rdp_addr,
+	PAGE_SIZE);
 	bus_dmamap_destroy(rdev->ddev->dmat, rdev->dummy_page.rdp_map);
 	bus_dmamem_free(rdev->ddev->dmat, &rdev->dummy_page.rdp_seg, 1);
 	rdev->dummy_page.rdp_map = NULL;



CVS commit: src/sys/external/bsd/drm2/radeon

2020-01-24 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Fri Jan 24 11:44:27 UTC 2020

Modified Files:
src/sys/external/bsd/drm2/radeon: radeon_pci.c

Log Message:
If radeon attaches, prevent simplefb from claiming the console


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/external/bsd/drm2/radeon/radeon_pci.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/radeon/radeon_pci.c
diff -u src/sys/external/bsd/drm2/radeon/radeon_pci.c:1.13 src/sys/external/bsd/drm2/radeon/radeon_pci.c:1.14
--- src/sys/external/bsd/drm2/radeon/radeon_pci.c:1.13	Mon Aug 27 14:12:14 2018
+++ src/sys/external/bsd/drm2/radeon/radeon_pci.c	Fri Jan 24 11:44:27 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: radeon_pci.c,v 1.13 2018/08/27 14:12:14 riastradh Exp $	*/
+/*	$NetBSD: radeon_pci.c,v 1.14 2020/01/24 11:44:27 jmcneill Exp $	*/
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -30,10 +30,13 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: radeon_pci.c,v 1.13 2018/08/27 14:12:14 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: radeon_pci.c,v 1.14 2020/01/24 11:44:27 jmcneill Exp $");
 
 #ifdef _KERNEL_OPT
 #include "vga.h"
+#if defined(__arm__) || defined(__aarch64__)
+#include "opt_fdt.h"
+#endif
 #endif
 
 #include 
@@ -60,6 +63,10 @@ __KERNEL_RCSID(0, "$NetBSD: radeon_pci.c
 #include 
 #endif
 
+#ifdef FDT
+#include 
+#endif
+
 #include 
 #include 
 
@@ -201,6 +208,15 @@ radeon_attach(device_t parent, device_t 
    "i386 radeondrmkms hack\n");
 #endif
 
+#ifdef FDT
+	/*
+	 * XXX Remove the simple framebuffer, assuming that this device
+	 * will take over.
+	 */
+	const char *fb_compatible[] = { "simple-framebuffer", NULL };
+	fdt_remove_bycompat(fb_compatible);
+#endif
+
 	config_mountroot(self, &radeon_attach_real);
 }
 



CVS commit: src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/engine/fifo

2020-01-22 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Wed Jan 22 11:38:54 UTC 2020

Modified Files:
src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/engine/fifo:
nouveau_nvkm_engine_fifo_gk104.c

Log Message:
Write pbdma timeout regs during initialisation on GK208B, GK208, and GM107.

Based on the following upstream commit:
https://github.com/torvalds/linux/commit/79bb4b617f965736d2e1c616235302c1d0e823b2


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 \

src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/engine/fifo/nouveau_nvkm_engine_fifo_gk104.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/engine/fifo/nouveau_nvkm_engine_fifo_gk104.c
diff -u src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/engine/fifo/nouveau_nvkm_engine_fifo_gk104.c:1.3 src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/engine/fifo/nouveau_nvkm_engine_fifo_gk104.c:1.4
--- src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/engine/fifo/nouveau_nvkm_engine_fifo_gk104.c:1.3	Mon Aug 27 07:40:11 2018
+++ src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/engine/fifo/nouveau_nvkm_engine_fifo_gk104.c	Wed Jan 22 11:38:54 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: nouveau_nvkm_engine_fifo_gk104.c,v 1.3 2018/08/27 07:40:11 riastradh Exp $	*/
+/*	$NetBSD: nouveau_nvkm_engine_fifo_gk104.c,v 1.4 2020/01/22 11:38:54 jmcneill Exp $	*/
 
 /*
  * Copyright 2012 Red Hat Inc.
@@ -24,7 +24,7 @@
  * Authors: Ben Skeggs
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: nouveau_nvkm_engine_fifo_gk104.c,v 1.3 2018/08/27 07:40:11 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nouveau_nvkm_engine_fifo_gk104.c,v 1.4 2020/01/22 11:38:54 jmcneill Exp $");
 
 #include "gk104.h"
 #include "changk104.h"
@@ -752,6 +752,20 @@ gk104_fifo_init(struct nvkm_fifo *base)
 
 	nvkm_wr32(device, 0x002254, 0x1000 | fifo->user.bar.offset >> 12);
 
+	/* XXX NetBSD
+	 * write pbdma timeout regs during initialization
+	 * backport of:
+	 * https://github.com/torvalds/linux/commit/79bb4b617f965736d2e1c616235302c1d0e823b2
+	 */
+	switch (device->chipset) {
+	case 0x106:	/* GK208B */
+	case 0x108:	/* GK208 */
+	case 0x117:	/* GM107 */
+		for (i = 0; i < fifo->spoon_nr; i++)
+			nvkm_wr32(device, 0x04012c + (i * 0x2000), 0x);
+		break;
+	}
+
 	nvkm_wr32(device, 0x002100, 0x);
 	nvkm_wr32(device, 0x002140, 0x7fff);
 }



CVS commit: src/sys/external/bsd/drm2/include/drm

2020-01-21 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Wed Jan 22 07:53:45 UTC 2020

Modified Files:
src/sys/external/bsd/drm2/include/drm: bus_dma_hacks.h

Log Message:
Fix PHYS_TO_BUS_MEM and BUS_MEM_TO_PHYS on arm and aarch64


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 \
src/sys/external/bsd/drm2/include/drm/bus_dma_hacks.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/include/drm/bus_dma_hacks.h
diff -u src/sys/external/bsd/drm2/include/drm/bus_dma_hacks.h:1.18 src/sys/external/bsd/drm2/include/drm/bus_dma_hacks.h:1.19
--- src/sys/external/bsd/drm2/include/drm/bus_dma_hacks.h:1.18	Tue Nov  5 23:27:23 2019
+++ src/sys/external/bsd/drm2/include/drm/bus_dma_hacks.h	Wed Jan 22 07:53:45 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus_dma_hacks.h,v 1.18 2019/11/05 23:27:23 jmcneill Exp $	*/
+/*	$NetBSD: bus_dma_hacks.h,v 1.19 2020/01/22 07:53:45 jmcneill Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -58,7 +58,7 @@ PHYS_TO_BUS_MEM(bus_dma_tag_t dmat, padd
 		const struct arm32_dma_range *dr = &dmat->_ranges[i];
 
 		if (dr->dr_sysbase <= pa && pa - dr->dr_sysbase <= dr->dr_len)
-			return dr->dr_busbase + (dr->dr_sysbase - pa);
+			return pa - dr->dr_sysbase + dr->dr_busbase;
 	}
 	panic("paddr has no bus address in dma tag %p: %"PRIxPADDR, dmat, pa);
 }
@@ -74,7 +74,7 @@ BUS_MEM_TO_PHYS(bus_dma_tag_t dmat, bus_
 		const struct arm32_dma_range *dr = &dmat->_ranges[i];
 
 		if (dr->dr_busbase <= ba && ba - dr->dr_busbase <= dr->dr_len)
-			return dr->dr_sysbase + (dr->dr_busbase - ba);
+			return ba - dr->dr_busbase + dr->dr_sysbase;
 	}
 	panic("bus addr has no bus address in dma tag %p: %"PRIxPADDR, dmat,
 	ba);



CVS commit: src/sys/external/bsd/drm2/dist/drm/radeon

2020-01-20 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Jan 20 23:22:09 UTC 2020

Modified Files:
src/sys/external/bsd/drm2/dist/drm/radeon: radeon_gart.c

Log Message:
add missing memset in radeon_gart_table_ram_alloc


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 \
src/sys/external/bsd/drm2/dist/drm/radeon/radeon_gart.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/dist/drm/radeon/radeon_gart.c
diff -u src/sys/external/bsd/drm2/dist/drm/radeon/radeon_gart.c:1.10 src/sys/external/bsd/drm2/dist/drm/radeon/radeon_gart.c:1.11
--- src/sys/external/bsd/drm2/dist/drm/radeon/radeon_gart.c:1.10	Mon Aug 27 13:56:22 2018
+++ src/sys/external/bsd/drm2/dist/drm/radeon/radeon_gart.c	Mon Jan 20 23:22:09 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: radeon_gart.c,v 1.10 2018/08/27 13:56:22 riastradh Exp $	*/
+/*	$NetBSD: radeon_gart.c,v 1.11 2020/01/20 23:22:09 jmcneill Exp $	*/
 
 /*
  * Copyright 2008 Advanced Micro Devices, Inc.
@@ -28,7 +28,7 @@
  *  Jerome Glisse
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: radeon_gart.c,v 1.10 2018/08/27 13:56:22 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: radeon_gart.c,v 1.11 2020/01/20 23:22:09 jmcneill Exp $");
 
 #include 
 #include 
@@ -93,6 +93,8 @@ int radeon_gart_table_ram_alloc(struct r
 	if (error)
 		goto fail3;
 
+	memset((void *)rdev->gart.ptr, 0, rdev->gart.table_size);
+
 	/* Success!  */
 	rdev->gart.table_addr = rdev->gart.rg_table_map->dm_segs[0].ds_addr;
 	return 0;



CVS commit: src/sys/external/bsd/drm2/dist/include/drm

2020-01-19 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Jan 19 16:12:00 UTC 2020

Modified Files:
src/sys/external/bsd/drm2/dist/include/drm: drm_cache.h

Log Message:
Pull in drm_os_netbsd.h for CONFIG_ defines


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 \
src/sys/external/bsd/drm2/dist/include/drm/drm_cache.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/dist/include/drm/drm_cache.h
diff -u src/sys/external/bsd/drm2/dist/include/drm/drm_cache.h:1.3 src/sys/external/bsd/drm2/dist/include/drm/drm_cache.h:1.4
--- src/sys/external/bsd/drm2/dist/include/drm/drm_cache.h:1.3	Sun Jan 19 12:03:27 2020
+++ src/sys/external/bsd/drm2/dist/include/drm/drm_cache.h	Sun Jan 19 16:12:00 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: drm_cache.h,v 1.3 2020/01/19 12:03:27 jmcneill Exp $	*/
+/*	$NetBSD: drm_cache.h,v 1.4 2020/01/19 16:12:00 jmcneill Exp $	*/
 
 /**
  *
@@ -35,6 +35,10 @@
 #ifndef _DRM_CACHE_H_
 #define _DRM_CACHE_H_
 
+#ifdef __NetBSD__
+#include 
+#endif
+
 void drm_clflush_pages(struct page *pages[], unsigned long num_pages);
 
 static inline bool drm_arch_can_wc_memory(void)



CVS commit: src/sys/external/bsd/drm2/include/linux

2020-01-19 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Jan 19 15:31:56 UTC 2020

Modified Files:
src/sys/external/bsd/drm2/include/linux: mm.h

Log Message:
Fix build on aarch64 by including uvm_object.h.

OK from Riastradh


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/external/bsd/drm2/include/linux/mm.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/include/linux/mm.h
diff -u src/sys/external/bsd/drm2/include/linux/mm.h:1.11 src/sys/external/bsd/drm2/include/linux/mm.h:1.12
--- src/sys/external/bsd/drm2/include/linux/mm.h:1.11	Fri Jan 17 20:09:47 2020
+++ src/sys/external/bsd/drm2/include/linux/mm.h	Sun Jan 19 15:31:56 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: mm.h,v 1.11 2020/01/17 20:09:47 ad Exp $	*/
+/*	$NetBSD: mm.h,v 1.12 2020/01/19 15:31:56 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -35,6 +35,7 @@
 #include 
 
 #include 
+#include 
 
 #include 
 #include 



CVS commit: src/sys/external/bsd/drm2

2020-01-19 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Jan 19 12:03:27 UTC 2020

Modified Files:
src/sys/external/bsd/drm2/dist/include/drm: drm_cache.h
src/sys/external/bsd/drm2/include/drm: drm_os_netbsd.h

Log Message:
Disable the use of WC memory on Arm and Arm64. From Linux:

 * The DRM driver stack is designed to work with cache coherent devices
 * only, but permits an optimization to be enabled in some cases, where
 * for some buffers, both the CPU and the GPU use uncached mappings,
 * removing the need for DMA snooping and allocation in the CPU caches.
 *
 * The use of uncached GPU mappings relies on the correct implementation
 * of the PCIe NoSnoop TLP attribute by the platform, otherwise the GPU
 * will use cached mappings nonetheless. On x86 platforms, this does not
 * seem to matter, as uncached CPU mappings will snoop the caches in any
 * case. However, on ARM and arm64, enabling this optimization on a
 * platform where NoSnoop is ignored results in loss of coherency, which
 * breaks correct operation of the device. Since we have no way of
 * detecting whether NoSnoop works or not, just disable this
 * optimization entirely for ARM and arm64.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 \
src/sys/external/bsd/drm2/dist/include/drm/drm_cache.h
cvs rdiff -u -r1.15 -r1.16 \
src/sys/external/bsd/drm2/include/drm/drm_os_netbsd.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/dist/include/drm/drm_cache.h
diff -u src/sys/external/bsd/drm2/dist/include/drm/drm_cache.h:1.2 src/sys/external/bsd/drm2/dist/include/drm/drm_cache.h:1.3
--- src/sys/external/bsd/drm2/dist/include/drm/drm_cache.h:1.2	Mon Aug 27 04:58:37 2018
+++ src/sys/external/bsd/drm2/dist/include/drm/drm_cache.h	Sun Jan 19 12:03:27 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: drm_cache.h,v 1.2 2018/08/27 04:58:37 riastradh Exp $	*/
+/*	$NetBSD: drm_cache.h,v 1.3 2020/01/19 12:03:27 jmcneill Exp $	*/
 
 /**
  *
@@ -43,6 +43,8 @@ static inline bool drm_arch_can_wc_memor
 	return false;
 #elif defined(CONFIG_MIPS) && defined(CONFIG_CPU_LOONGSON3)
 	return false;
+#elif defined(CONFIG_ARM) || defined(CONFIG_ARM64)
+	return false;
 #else
 	return true;
 #endif

Index: src/sys/external/bsd/drm2/include/drm/drm_os_netbsd.h
diff -u src/sys/external/bsd/drm2/include/drm/drm_os_netbsd.h:1.15 src/sys/external/bsd/drm2/include/drm/drm_os_netbsd.h:1.16
--- src/sys/external/bsd/drm2/include/drm/drm_os_netbsd.h:1.15	Tue Nov  5 23:29:28 2019
+++ src/sys/external/bsd/drm2/include/drm/drm_os_netbsd.h	Sun Jan 19 12:03:27 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: drm_os_netbsd.h,v 1.15 2019/11/05 23:29:28 jmcneill Exp $	*/
+/*	$NetBSD: drm_os_netbsd.h,v 1.16 2020/01/19 12:03:27 jmcneill Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -41,6 +41,14 @@
 #define	CONFIG_X86_PAT	1
 #endif
 
+#if defined(__arm__)
+#define CONFIG_ARM	1
+#endif
+
+#if defined(__aarch64__)
+#define CONFIG_ARM64	1
+#endif
+
 /*
  * Nothing meaningfully depends on this; defining this avoids patching
  * away some conditionalization in drmP.h.



CVS commit: src/sys/external/bsd/drm2/dist/drm/radeon

2020-01-19 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Jan 19 11:07:00 UTC 2020

Modified Files:
src/sys/external/bsd/drm2/dist/drm/radeon: radeon_vce.c

Log Message:
Fix loading TAHITI VCE firmware.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 \
src/sys/external/bsd/drm2/dist/drm/radeon/radeon_vce.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/dist/drm/radeon/radeon_vce.c
diff -u src/sys/external/bsd/drm2/dist/drm/radeon/radeon_vce.c:1.3 src/sys/external/bsd/drm2/dist/drm/radeon/radeon_vce.c:1.4
--- src/sys/external/bsd/drm2/dist/drm/radeon/radeon_vce.c:1.3	Mon Aug 27 04:58:36 2018
+++ src/sys/external/bsd/drm2/dist/drm/radeon/radeon_vce.c	Sun Jan 19 11:07:00 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: radeon_vce.c,v 1.3 2018/08/27 04:58:36 riastradh Exp $	*/
+/*	$NetBSD: radeon_vce.c,v 1.4 2020/01/19 11:07:00 jmcneill Exp $	*/
 
 /*
  * Copyright 2013 Advanced Micro Devices, Inc.
@@ -28,7 +28,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: radeon_vce.c,v 1.3 2018/08/27 04:58:36 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: radeon_vce.c,v 1.4 2020/01/19 11:07:00 jmcneill Exp $");
 
 #include 
 #include 
@@ -53,34 +53,38 @@ static void radeon_vce_idle_work_handler
 
 #ifdef __NetBSD__		/* XXX Ugh!  */
 static bool
-scan_2dec_u8(const char **sp, char delim, uint8_t *u8p)
+scan_2dec_uint(const char **sp, char delim, unsigned int *uintp)
 {
-	char c0, c1;
+	u_int val = 0, n;
+	char c;
 
-	if (!isdigit((unsigned char)(c0 = *(*sp)++)))
-		return false;
-	if (!isdigit((unsigned char)(c1 = *(*sp)++)))
-		return false;
-	if (*(*sp)++ != delim)
+	for (n = 0; n < 2; n++) {
+		c = *(*sp)++;
+		if (!isdigit((unsigned char)c))
+			return false;
+		if (n != 0)
+			val *= 10;
+		val += (c - '0');
+		if (*(*sp) == delim)
+			break;
+	}
+	if (*(*sp) != delim)
 		return false;
 
-	*u8p = ((c0 - '0') * 10) + (c1 - '0');
+	(*sp)++;
+	*uintp = val;
 	return true;
 }
 
 static bool
-scan_2dec_uint(const char **sp, char delim, unsigned int *uintp)
+scan_2dec_u8(const char **sp, char delim, uint8_t *u8p)
 {
-	char c0, c1;
+	unsigned int val;
 
-	if (!isdigit((unsigned char)(c0 = *(*sp)++)))
-		return false;
-	if (!isdigit((unsigned char)(c1 = *(*sp)++)))
-		return false;
-	if (*(*sp)++ != delim)
+	if (!scan_2dec_uint(sp, delim, &val))
 		return false;
 
-	*uintp = ((c0 - '0') * 10) + (c1 - '0');
+	*u8p = (uint8_t)val;
 	return true;
 }
 #endif



CVS commit: src/sys/external/bsd/drm2/include/linux

2020-01-17 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Jan 18 03:00:04 UTC 2020

Modified Files:
src/sys/external/bsd/drm2/include/linux: acpi.h pci.h

Log Message:
Pull in acpica.h on aarch64


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/external/bsd/drm2/include/linux/acpi.h
cvs rdiff -u -r1.37 -r1.38 src/sys/external/bsd/drm2/include/linux/pci.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/include/linux/acpi.h
diff -u src/sys/external/bsd/drm2/include/linux/acpi.h:1.4 src/sys/external/bsd/drm2/include/linux/acpi.h:1.5
--- src/sys/external/bsd/drm2/include/linux/acpi.h:1.4	Sat Oct 17 21:07:23 2015
+++ src/sys/external/bsd/drm2/include/linux/acpi.h	Sat Jan 18 03:00:04 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: acpi.h,v 1.4 2015/10/17 21:07:23 jmcneill Exp $	*/
+/*	$NetBSD: acpi.h,v 1.5 2020/01/18 03:00:04 jmcneill Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -33,7 +33,7 @@
 #define _LINUX_ACPI_H_
 
 #ifdef _KERNEL_OPT
-#if defined(__i386__) || defined(__x86_64__)
+#if defined(__i386__) || defined(__x86_64__) || defined(__aarch64__)
 #include "acpica.h"
 #else
 #define NACPICA 0

Index: src/sys/external/bsd/drm2/include/linux/pci.h
diff -u src/sys/external/bsd/drm2/include/linux/pci.h:1.37 src/sys/external/bsd/drm2/include/linux/pci.h:1.38
--- src/sys/external/bsd/drm2/include/linux/pci.h:1.37	Mon Aug 27 14:16:38 2018
+++ src/sys/external/bsd/drm2/include/linux/pci.h	Sat Jan 18 03:00:04 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: pci.h,v 1.37 2018/08/27 14:16:38 riastradh Exp $	*/
+/*	$NetBSD: pci.h,v 1.38 2020/01/18 03:00:04 jmcneill Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -33,7 +33,7 @@
 #define _LINUX_PCI_H_
 
 #ifdef _KERNEL_OPT
-#if defined(i386) || defined(amd64)
+#if defined(i386) || defined(amd64) || defined(__aarch64__)
 #include "acpica.h"
 #else	/* !(i386 || amd64) */
 #define NACPICA	0



CVS commit: src/sys/external/bsd/drm2/linux

2020-01-17 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Jan 18 02:59:42 UTC 2020

Modified Files:
src/sys/external/bsd/drm2/linux: linux_pci.c

Log Message:
Use pci_get_segment if available


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/external/bsd/drm2/linux/linux_pci.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/linux/linux_pci.c
diff -u src/sys/external/bsd/drm2/linux/linux_pci.c:1.6 src/sys/external/bsd/drm2/linux/linux_pci.c:1.7
--- src/sys/external/bsd/drm2/linux/linux_pci.c:1.6	Tue Aug 28 03:41:39 2018
+++ src/sys/external/bsd/drm2/linux/linux_pci.c	Sat Jan 18 02:59:42 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux_pci.c,v 1.6 2018/08/28 03:41:39 riastradh Exp $	*/
+/*	$NetBSD: linux_pci.c,v 1.7 2020/01/18 02:59:42 jmcneill Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -29,8 +29,12 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
+#ifdef _KERNEL_OPT
+#include "opt_pci.h"
+#endif
+
 #include 
-__KERNEL_RCSID(0, "$NetBSD: linux_pci.c,v 1.6 2018/08/28 03:41:39 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_pci.c,v 1.7 2020/01/18 02:59:42 jmcneill Exp $");
 
 #include 
 
@@ -66,7 +70,12 @@ linux_pci_dev_init(struct pci_dev *pdev,
 	pdev->pd_rom_vaddr = NULL;
 	pdev->pd_dev = dev;
 #if (NACPICA > 0)
-	pdev->pd_ad = acpi_pcidev_find(0 /*XXX segment*/, pa->pa_bus,
+#ifdef __HAVE_PCI_GET_SEGMENT
+	const int seg = pci_get_segment(pa->pa_pc);
+#else
+	const int seg = 0;
+#endif
+	pdev->pd_ad = acpi_pcidev_find(seg, pa->pa_bus,
 	pa->pa_device, pa->pa_function);
 #else
 	pdev->pd_ad = NULL;



CVS commit: src/sys/external/bsd/drm2/include/asm

2020-01-17 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Jan 18 02:42:23 UTC 2020

Modified Files:
src/sys/external/bsd/drm2/include/asm: io.h

Log Message:
memset_io works with bytes not dwords, noted by riastradh@


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/external/bsd/drm2/include/asm/io.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/include/asm/io.h
diff -u src/sys/external/bsd/drm2/include/asm/io.h:1.5 src/sys/external/bsd/drm2/include/asm/io.h:1.6
--- src/sys/external/bsd/drm2/include/asm/io.h:1.5	Fri Jan 17 20:28:59 2020
+++ src/sys/external/bsd/drm2/include/asm/io.h	Sat Jan 18 02:42:23 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: io.h,v 1.5 2020/01/17 20:28:59 jmcneill Exp $	*/
+/*	$NetBSD: io.h,v 1.6 2020/01/18 02:42:23 jmcneill Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -51,12 +51,13 @@
 static inline void *
 memset_io(void *b, int c, size_t len)
 {
-	uint32_t *ptr = b;
-	while (len >= 4) {
+	uint8_t *ptr = b;
+
+	while (len > 0) {
 		*ptr++ = c;
-		len -= 4;
+		len--;
 	}
-	KASSERT(len == 0);
+
 	return b;
 }
 #else



CVS commit: src/sys/external/bsd/drm2/include/asm

2020-01-17 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Fri Jan 17 20:28:59 UTC 2020

Modified Files:
src/sys/external/bsd/drm2/include/asm: io.h

Log Message:
Don't use memset as memset_io on aarch64. With c=0 it uses the "dc zva"
cache maintenance instruction as an optimization which does not work on
device memory.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/external/bsd/drm2/include/asm/io.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/include/asm/io.h
diff -u src/sys/external/bsd/drm2/include/asm/io.h:1.4 src/sys/external/bsd/drm2/include/asm/io.h:1.5
--- src/sys/external/bsd/drm2/include/asm/io.h:1.4	Wed Feb 25 14:56:17 2015
+++ src/sys/external/bsd/drm2/include/asm/io.h	Fri Jan 17 20:28:59 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: io.h,v 1.4 2015/02/25 14:56:17 riastradh Exp $	*/
+/*	$NetBSD: io.h,v 1.5 2020/01/17 20:28:59 jmcneill Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -46,7 +46,22 @@
 
 #define	memcpy_fromio	memcpy
 #define	memcpy_toio	memcpy
+
+#if defined(__NetBSD__) && defined(__aarch64__)
+static inline void *
+memset_io(void *b, int c, size_t len)
+{
+	uint32_t *ptr = b;
+	while (len >= 4) {
+		*ptr++ = c;
+		len -= 4;
+	}
+	KASSERT(len == 0);
+	return b;
+}
+#else
 #define	memset_io	memset
+#endif
 
 /* XXX wrong place */
 #define	__force



CVS commit: src/sys/external/bsd/drm2/include/linux

2020-01-17 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Fri Jan 17 20:09:47 UTC 2020

Modified Files:
src/sys/external/bsd/drm2/include/linux: mm.h

Log Message:
set_page_dirty: take the vmobjlock if present


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/external/bsd/drm2/include/linux/mm.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/include/linux/mm.h
diff -u src/sys/external/bsd/drm2/include/linux/mm.h:1.10 src/sys/external/bsd/drm2/include/linux/mm.h:1.11
--- src/sys/external/bsd/drm2/include/linux/mm.h:1.10	Wed Jan 15 17:55:44 2020
+++ src/sys/external/bsd/drm2/include/linux/mm.h	Fri Jan 17 20:09:47 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: mm.h,v 1.10 2020/01/15 17:55:44 ad Exp $	*/
+/*	$NetBSD: mm.h,v 1.11 2020/01/17 20:09:47 ad Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -95,8 +95,16 @@ kvfree(void *ptr)
 static inline void
 set_page_dirty(struct page *page)
 {
+	struct vm_page *pg = &page->p_vmp;
 
-	uvm_pagemarkdirty(&page->p_vmp, UVM_PAGE_STATUS_DIRTY);
+	/* XXX */
+	if (pg->uobject != NULL) {
+		mutex_enter(pg->uobject->vmobjlock);
+		uvm_pagemarkdirty(pg, UVM_PAGE_STATUS_DIRTY);
+		mutex_exit(pg->uobject->vmobjlock);
+	} else {
+		uvm_pagemarkdirty(pg, UVM_PAGE_STATUS_DIRTY);
+	}
 }
 
 #endif  /* _LINUX_MM_H_ */



CVS commit: src/sys/external/bsd/drm2/dist/drm

2020-01-17 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Fri Jan 17 19:56:50 UTC 2020

Modified Files:
src/sys/external/bsd/drm2/dist/drm: drm_gem.c
src/sys/external/bsd/drm2/dist/drm/i915: i915_gem.c i915_gem_fence.c

Log Message:
Apply patch from kamil@: vmobjlock needs to be held for uvm_pagemarkdirty().


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/external/bsd/drm2/dist/drm/drm_gem.c
cvs rdiff -u -r1.55 -r1.56 src/sys/external/bsd/drm2/dist/drm/i915/i915_gem.c
cvs rdiff -u -r1.6 -r1.7 \
src/sys/external/bsd/drm2/dist/drm/i915/i915_gem_fence.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/dist/drm/drm_gem.c
diff -u src/sys/external/bsd/drm2/dist/drm/drm_gem.c:1.11 src/sys/external/bsd/drm2/dist/drm/drm_gem.c:1.12
--- src/sys/external/bsd/drm2/dist/drm/drm_gem.c:1.11	Wed Jan 15 17:55:43 2020
+++ src/sys/external/bsd/drm2/dist/drm/drm_gem.c	Fri Jan 17 19:56:49 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: drm_gem.c,v 1.11 2020/01/15 17:55:43 ad Exp $	*/
+/*	$NetBSD: drm_gem.c,v 1.12 2020/01/17 19:56:49 ad Exp $	*/
 
 /*
  * Copyright © 2008 Intel Corporation
@@ -28,7 +28,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: drm_gem.c,v 1.11 2020/01/15 17:55:43 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: drm_gem.c,v 1.12 2020/01/17 19:56:49 ad Exp $");
 
 #include 
 #include 
@@ -613,8 +613,10 @@ drm_gem_put_pages(struct drm_gem_object 
 
 	for (i = 0; i < (obj->size >> PAGE_SHIFT); i++) {
 		if (dirty) {
+			mutex_enter(obj->filp->vmobjlock);
 			uvm_pagemarkdirty(&pages[i]->p_vmp,
 			UVM_PAGE_STATUS_DIRTY);
+			mutex_exit(obj->filp->vmobjlock);
 		}
 	}
 

Index: src/sys/external/bsd/drm2/dist/drm/i915/i915_gem.c
diff -u src/sys/external/bsd/drm2/dist/drm/i915/i915_gem.c:1.55 src/sys/external/bsd/drm2/dist/drm/i915/i915_gem.c:1.56
--- src/sys/external/bsd/drm2/dist/drm/i915/i915_gem.c:1.55	Wed Jan 15 17:55:43 2020
+++ src/sys/external/bsd/drm2/dist/drm/i915/i915_gem.c	Fri Jan 17 19:56:50 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: i915_gem.c,v 1.55 2020/01/15 17:55:43 ad Exp $	*/
+/*	$NetBSD: i915_gem.c,v 1.56 2020/01/17 19:56:50 ad Exp $	*/
 
 /*
  * Copyright © 2008-2015 Intel Corporation
@@ -28,7 +28,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: i915_gem.c,v 1.55 2020/01/15 17:55:43 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i915_gem.c,v 1.56 2020/01/17 19:56:50 ad Exp $");
 
 #ifdef __NetBSD__
 #if 0/* XXX uvmhist option?  */
@@ -2643,10 +2643,12 @@ i915_gem_object_put_pages_gtt(struct drm
 		obj->dirty = 0;
 
 	if (obj->dirty) {
+		mutex_enter(obj->base.filp->vmobjlock);
 		TAILQ_FOREACH(page, &obj->pageq, pageq.queue) {
 			uvm_pagemarkdirty(page, UVM_PAGE_STATUS_DIRTY);
 			/* XXX mark page accessed */
 		}
+		mutex_exit(obj->base.filp->vmobjlock);
 	}
 	obj->dirty = 0;
 

Index: src/sys/external/bsd/drm2/dist/drm/i915/i915_gem_fence.c
diff -u src/sys/external/bsd/drm2/dist/drm/i915/i915_gem_fence.c:1.6 src/sys/external/bsd/drm2/dist/drm/i915/i915_gem_fence.c:1.7
--- src/sys/external/bsd/drm2/dist/drm/i915/i915_gem_fence.c:1.6	Wed Jan 15 17:55:43 2020
+++ src/sys/external/bsd/drm2/dist/drm/i915/i915_gem_fence.c	Fri Jan 17 19:56:50 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: i915_gem_fence.c,v 1.6 2020/01/15 17:55:43 ad Exp $	*/
+/*	$NetBSD: i915_gem_fence.c,v 1.7 2020/01/17 19:56:50 ad Exp $	*/
 
 /*
  * Copyright © 2008-2015 Intel Corporation
@@ -24,7 +24,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: i915_gem_fence.c,v 1.6 2020/01/15 17:55:43 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i915_gem_fence.c,v 1.7 2020/01/17 19:56:50 ad Exp $");
 
 #include 
 #include 
@@ -769,7 +769,9 @@ i915_gem_object_do_bit_17_swizzle(struct
 		(test_bit(i, obj->bit_17) != 0)) {
 			i915_gem_swizzle_page(container_of(page, struct page,
 p_vmp));
+			mutex_enter(obj->base.filp->vmobjlock);
 			uvm_pagemarkdirty(page, UVM_PAGE_STATUS_DIRTY);
+			mutex_exit(obj->base.filp->vmobjlock);
 		}
 		i += 1;
 	}



CVS commit: src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/engine/device

2020-01-17 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Fri Jan 17 19:13:25 UTC 2020

Modified Files:
src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/engine/device:
nouveau_nvkm_engine_device_pci.c

Log Message:
Enable the device on NetBSD too (don't rely on firmware to do it for us).


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 \

src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/engine/device/nouveau_nvkm_engine_device_pci.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/engine/device/nouveau_nvkm_engine_device_pci.c
diff -u src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/engine/device/nouveau_nvkm_engine_device_pci.c:1.8 src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/engine/device/nouveau_nvkm_engine_device_pci.c:1.9
--- src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/engine/device/nouveau_nvkm_engine_device_pci.c:1.8	Mon Aug 27 14:17:36 2018
+++ src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/engine/device/nouveau_nvkm_engine_device_pci.c	Fri Jan 17 19:13:25 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: nouveau_nvkm_engine_device_pci.c,v 1.8 2018/08/27 14:17:36 riastradh Exp $	*/
+/*	$NetBSD: nouveau_nvkm_engine_device_pci.c,v 1.9 2020/01/17 19:13:25 jmcneill Exp $	*/
 
 /*
  * Copyright 2015 Red Hat Inc.
@@ -24,7 +24,7 @@
  * Authors: Ben Skeggs 
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: nouveau_nvkm_engine_device_pci.c,v 1.8 2018/08/27 14:17:36 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nouveau_nvkm_engine_device_pci.c,v 1.9 2020/01/17 19:13:25 jmcneill Exp $");
 
 #include 
 #include "priv.h"
@@ -1673,15 +1673,11 @@ nvkm_device_pci_new(struct pci_dev *pci_
 	const struct nvkm_device_pci_vendor *pciv;
 	const char *name = NULL;
 	struct nvkm_device_pci *pdev;
-#ifndef __NetBSD__
 	int ret;
-#endif
 
-#ifndef __NetBSD__
-	ret = pci_enable_device(pci_dev);
+	ret = linux_pci_enable_device(pci_dev);
 	if (ret)
 		return ret;
-#endif
 
 	switch (pci_dev->vendor) {
 	case 0x10de: pcid = nvkm_device_pci_10de; break;



CVS commit: src/sys/external/bsd/drm2/dist/drm/radeon

2020-01-07 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Jan  7 13:51:38 UTC 2020

Modified Files:
src/sys/external/bsd/drm2/dist/drm/radeon: radeon_atombios_dp.c

Log Message:
 Don't call memcpy() when the length is 0 (and the source pointer is NULL)
in radeon_dp_aux_transfer_atom() to avoid undefined behavior. Found by kUBSan.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 \
src/sys/external/bsd/drm2/dist/drm/radeon/radeon_atombios_dp.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/dist/drm/radeon/radeon_atombios_dp.c
diff -u src/sys/external/bsd/drm2/dist/drm/radeon/radeon_atombios_dp.c:1.1 src/sys/external/bsd/drm2/dist/drm/radeon/radeon_atombios_dp.c:1.2
--- src/sys/external/bsd/drm2/dist/drm/radeon/radeon_atombios_dp.c:1.1	Mon Aug 27 14:38:20 2018
+++ src/sys/external/bsd/drm2/dist/drm/radeon/radeon_atombios_dp.c	Tue Jan  7 13:51:38 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: radeon_atombios_dp.c,v 1.1 2018/08/27 14:38:20 riastradh Exp $	*/
+/*	$NetBSD: radeon_atombios_dp.c,v 1.2 2020/01/07 13:51:38 msaitoh Exp $	*/
 
 /*
  * Copyright 2007-8 Advanced Micro Devices, Inc.
@@ -27,7 +27,7 @@
  *  Jerome Glisse
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: radeon_atombios_dp.c,v 1.1 2018/08/27 14:38:20 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: radeon_atombios_dp.c,v 1.2 2020/01/07 13:51:38 msaitoh Exp $");
 
 #include 
 #include 
@@ -196,9 +196,10 @@ radeon_dp_aux_transfer_atom(struct drm_d
 		tx_size = HEADER_SIZE + msg->size;
 		if (msg->size == 0)
 			tx_buf[3] |= BARE_ADDRESS_SIZE << 4;
-		else
+		else {
 			tx_buf[3] |= tx_size << 4;
-		memcpy(tx_buf + HEADER_SIZE, msg->buffer, msg->size);
+			memcpy(tx_buf + HEADER_SIZE, msg->buffer, msg->size);
+		}
 		ret = radeon_process_aux_ch(chan,
 	tx_buf, tx_size, NULL, 0, delay, &ack);
 		if (ret >= 0)



CVS commit: src/sys/external/bsd/drm2

2020-01-03 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Fri Jan  3 21:01:17 UTC 2020

Modified Files:
src/sys/external/bsd/drm2/dist/drm: drm_bridge.c drm_panel.c
src/sys/external/bsd/drm2/dist/include/drm: drm_crtc.h drm_panel.h
src/sys/external/bsd/drm2/drm: drm_module.c

Log Message:
Initialize drm_bridge and drm_panel locks.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/external/bsd/drm2/dist/drm/drm_bridge.c \
src/sys/external/bsd/drm2/dist/drm/drm_panel.c
cvs rdiff -u -r1.7 -r1.8 \
src/sys/external/bsd/drm2/dist/include/drm/drm_crtc.h
cvs rdiff -u -r1.2 -r1.3 \
src/sys/external/bsd/drm2/dist/include/drm/drm_panel.h
cvs rdiff -u -r1.16 -r1.17 src/sys/external/bsd/drm2/drm/drm_module.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/dist/drm/drm_bridge.c
diff -u src/sys/external/bsd/drm2/dist/drm/drm_bridge.c:1.3 src/sys/external/bsd/drm2/dist/drm/drm_bridge.c:1.4
--- src/sys/external/bsd/drm2/dist/drm/drm_bridge.c:1.3	Mon Aug 27 06:43:47 2018
+++ src/sys/external/bsd/drm2/dist/drm/drm_bridge.c	Fri Jan  3 21:01:16 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: drm_bridge.c,v 1.3 2018/08/27 06:43:47 riastradh Exp $	*/
+/*	$NetBSD: drm_bridge.c,v 1.4 2020/01/03 21:01:16 jmcneill Exp $	*/
 
 /*
  * Copyright (c) 2014 Samsung Electronics Co., Ltd
@@ -24,7 +24,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: drm_bridge.c,v 1.3 2018/08/27 06:43:47 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: drm_bridge.c,v 1.4 2020/01/03 21:01:16 jmcneill Exp $");
 
 #include 
 #include 
@@ -66,6 +66,17 @@ static DEFINE_MUTEX(bridge_lock);
 static LIST_HEAD(bridge_list);
 #endif
 
+#ifdef __NetBSD__
+void drm_bridge_init_lock(void)
+{
+	linux_mutex_init(&bridge_lock);
+}
+void drm_bridge_fini_lock(void)
+{
+	linux_mutex_destroy(&bridge_lock);
+}
+#endif
+
 /**
  * drm_bridge_add - add the given bridge to the global bridge list
  *
Index: src/sys/external/bsd/drm2/dist/drm/drm_panel.c
diff -u src/sys/external/bsd/drm2/dist/drm/drm_panel.c:1.3 src/sys/external/bsd/drm2/dist/drm/drm_panel.c:1.4
--- src/sys/external/bsd/drm2/dist/drm/drm_panel.c:1.3	Mon Dec  9 15:36:16 2019
+++ src/sys/external/bsd/drm2/dist/drm/drm_panel.c	Fri Jan  3 21:01:16 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: drm_panel.c,v 1.3 2019/12/09 15:36:16 jakllsch Exp $	*/
+/*	$NetBSD: drm_panel.c,v 1.4 2020/01/03 21:01:16 jmcneill Exp $	*/
 
 /*
  * Copyright (C) 2013, NVIDIA Corporation.  All rights reserved.
@@ -24,7 +24,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: drm_panel.c,v 1.3 2019/12/09 15:36:16 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: drm_panel.c,v 1.4 2020/01/03 21:01:16 jmcneill Exp $");
 
 #include 
 #include 
@@ -40,6 +40,17 @@ static DEFINE_MUTEX(panel_lock);
 static LIST_HEAD(panel_list);
 #endif
 
+#ifdef __NetBSD__
+void drm_panel_init_lock(void)
+{
+	linux_mutex_init(&panel_lock);
+}
+void drm_panel_fini_lock(void)
+{
+	linux_mutex_destroy(&panel_lock);
+}
+#endif
+
 void drm_panel_init(struct drm_panel *panel)
 {
 	INIT_LIST_HEAD(&panel->list);

Index: src/sys/external/bsd/drm2/dist/include/drm/drm_crtc.h
diff -u src/sys/external/bsd/drm2/dist/include/drm/drm_crtc.h:1.7 src/sys/external/bsd/drm2/dist/include/drm/drm_crtc.h:1.8
--- src/sys/external/bsd/drm2/dist/include/drm/drm_crtc.h:1.7	Mon Aug 27 06:46:02 2018
+++ src/sys/external/bsd/drm2/dist/include/drm/drm_crtc.h	Fri Jan  3 21:01:16 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: drm_crtc.h,v 1.7 2018/08/27 06:46:02 riastradh Exp $	*/
+/*	$NetBSD: drm_crtc.h,v 1.8 2020/01/03 21:01:16 jmcneill Exp $	*/
 
 /*
  * Copyright © 2006 Keith Packard
@@ -1224,6 +1224,11 @@ extern unsigned int drm_connector_index(
 /* helper to unplug all connectors from sysfs for device */
 extern void drm_connector_unplug_all(struct drm_device *dev);
 
+#ifdef __NetBSD__
+extern void drm_bridge_init_lock(void);
+extern void drm_bridge_fini_lock(void);
+#endif
+
 extern int drm_bridge_add(struct drm_bridge *bridge);
 extern void drm_bridge_remove(struct drm_bridge *bridge);
 extern struct drm_bridge *of_drm_find_bridge(struct device_node *np);

Index: src/sys/external/bsd/drm2/dist/include/drm/drm_panel.h
diff -u src/sys/external/bsd/drm2/dist/include/drm/drm_panel.h:1.2 src/sys/external/bsd/drm2/dist/include/drm/drm_panel.h:1.3
--- src/sys/external/bsd/drm2/dist/include/drm/drm_panel.h:1.2	Mon Aug 27 04:58:38 2018
+++ src/sys/external/bsd/drm2/dist/include/drm/drm_panel.h	Fri Jan  3 21:01:16 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: drm_panel.h,v 1.2 2018/08/27 04:58:38 riastradh Exp $	*/
+/*	$NetBSD: drm_panel.h,v 1.3 2020/01/03 21:01:16 jmcneill Exp $	*/
 
 /*
  * Copyright (C) 2013, NVIDIA Corporation.  All rights reserved.
@@ -127,6 +127,11 @@ static inline int drm_panel_get_modes(st
 	return panel ? -ENOSYS : -EINVAL;
 }
 
+#ifdef __NetBSD__
+void drm_panel_init_lock(void);
+void drm_panel_fini_lock(void);
+#endif
+
 void drm_panel_init(struct drm_pane

CVS commit: src/sys/external/bsd/drm2/dist/drm/radeon

2019-12-18 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Dec 18 13:25:58 UTC 2019

Modified Files:
src/sys/external/bsd/drm2/dist/drm/radeon: sumod.h

Log Message:
 Use unsigned to avoid undefined behavior. Found by kUBSan.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/external/bsd/drm2/dist/drm/radeon/sumod.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/dist/drm/radeon/sumod.h
diff -u src/sys/external/bsd/drm2/dist/drm/radeon/sumod.h:1.2 src/sys/external/bsd/drm2/dist/drm/radeon/sumod.h:1.3
--- src/sys/external/bsd/drm2/dist/drm/radeon/sumod.h:1.2	Mon Aug 27 04:58:36 2018
+++ src/sys/external/bsd/drm2/dist/drm/radeon/sumod.h	Wed Dec 18 13:25:58 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: sumod.h,v 1.2 2018/08/27 04:58:36 riastradh Exp $	*/
+/*	$NetBSD: sumod.h,v 1.3 2019/12/18 13:25:58 msaitoh Exp $	*/
 
 /*
  * Copyright 2012 Advanced Micro Devices, Inc.
@@ -197,7 +197,7 @@
 #   define SCLK_FSTATE_3_DIV(x) ((x) << 24)
 #   define SCLK_FSTATE_3_DIV_MASK   (0x7f << 24)
 #   define SCLK_FSTATE_3_DIV_SHIFT  24
-#   define SCLK_FSTATE_3_VLD(1 << 31)
+#   define SCLK_FSTATE_3_VLD(1U << 31)
 #define CG_SCLK_DPM_CTRL_2  0x688
 #define CG_GCOOR0x68c
 #   define PHC(x)   ((x) << 0)
@@ -243,7 +243,7 @@
 #   define DPM_SCLK_ENABLE  (1 << 18)
 #   define GNB_SLOW_FSTATE_0_MASK   (1 << 23)
 #   define GNB_SLOW_FSTATE_0_SHIFT  23
-#   define FORCE_NB_PSTATE_1(1 << 31)
+#   define FORCE_NB_PSTATE_1(1U << 31)
 
 #define CG_SSP  0x6e8
 #   define SST(x)   ((x) << 0)
@@ -263,7 +263,7 @@
 #   define DC_HDC_MASK  (0x3fff << 14)
 #   define DC_HDC_SHIFT 14
 #   define DC_HU(x) ((x) << 28)
-#   define DC_HU_MASK   (0xf << 28)
+#   define DC_HU_MASK   (0xfU << 28)
 #   define DC_HU_SHIFT  28
 #define CG_SCLK_DPM_CTRL_5  0x720
 #   define SCLK_FSTATE_BOOTUP(x)((x) << 0)
@@ -281,7 +281,7 @@
 #   define CG_R_MASK(0x << 0)
 #   define CG_R_SHIFT   0
 #   define CG_L(x)  ((x) << 16)
-#   define CG_L_MASK(0x << 16)
+#   define CG_L_MASK(0xU << 16)
 #   define CG_L_SHIFT   16
 #define CG_AT_1 0x72c
 #define CG_AT_2 0x730
@@ -351,7 +351,7 @@
 #   define HS(x)((x) << 4)
 #   define HS_MASK  (0xfff << 4)
 #   define HS_SHIFT 4
-#   define ENABLE_DS(1 << 31)
+#   define ENABLE_DS(1U << 31)
 #define DEEP_SLEEP_CNTL20x81c
 #   define LB_UFP_EN(1 << 0)
 #   define INOUT_C(x)   ((x) << 4)
@@ -363,7 +363,7 @@
 #define CG_SCLK_DPM_CTRL_11 0x830
 
 #define HW_REV   	0x5564
-#   define ATI_REV_ID_MASK  (0xf << 28)
+#   define ATI_REV_ID_MASK  (0xfU << 28)
 #   define ATI_REV_ID_SHIFT 28
 /* 0 = A0, 1 = A1, 2 = B0, 3 = C0, etc. */
 



CVS commit: src/sys/external/bsd/drm2/drm

2019-12-09 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Mon Dec  9 15:37:26 UTC 2019

Modified Files:
src/sys/external/bsd/drm2/drm: files.drmkms

Log Message:
build drm_panel.c w/ drmkms


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/sys/external/bsd/drm2/drm/files.drmkms

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/drm/files.drmkms
diff -u src/sys/external/bsd/drm2/drm/files.drmkms:1.32 src/sys/external/bsd/drm2/drm/files.drmkms:1.33
--- src/sys/external/bsd/drm2/drm/files.drmkms:1.32	Mon Nov 18 20:02:09 2019
+++ src/sys/external/bsd/drm2/drm/files.drmkms	Mon Dec  9 15:37:26 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: files.drmkms,v 1.32 2019/11/18 20:02:09 christos Exp $
+#	$NetBSD: files.drmkms,v 1.33 2019/12/09 15:37:26 jakllsch Exp $
 
 include "external/bsd/drm2/linux/files.drmkms_linux"
 
@@ -89,6 +89,7 @@ file	external/bsd/drm2/drm/drm_memory.c	
 file	external/bsd/drm2/dist/drm/drm_mm.c	drmkms
 file	external/bsd/drm2/dist/drm/drm_modes.c	drmkms
 file	external/bsd/drm2/dist/drm/drm_modeset_lock.c	drmkms
+file	external/bsd/drm2/dist/drm/drm_panel.c	drmkms
 #file	external/bsd/drm2/dist/drm/drm_pci.c	drmkms	# drmkms_pci
 file	external/bsd/drm2/dist/drm/drm_plane_helper.c	drmkms
 #file	external/bsd/drm2/dist/drm/drm_platform.c	drmkms



CVS commit: src/sys/external/bsd/drm2/dist/drm

2019-12-09 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Mon Dec  9 15:36:16 UTC 2019

Modified Files:
src/sys/external/bsd/drm2/dist/drm: drm_panel.c

Log Message:
workaround netbsd incompatible LIST_HEAD

adapted from drm_bridge.c r1.3


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/external/bsd/drm2/dist/drm/drm_panel.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/dist/drm/drm_panel.c
diff -u src/sys/external/bsd/drm2/dist/drm/drm_panel.c:1.2 src/sys/external/bsd/drm2/dist/drm/drm_panel.c:1.3
--- src/sys/external/bsd/drm2/dist/drm/drm_panel.c:1.2	Mon Aug 27 04:58:19 2018
+++ src/sys/external/bsd/drm2/dist/drm/drm_panel.c	Mon Dec  9 15:36:16 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: drm_panel.c,v 1.2 2018/08/27 04:58:19 riastradh Exp $	*/
+/*	$NetBSD: drm_panel.c,v 1.3 2019/12/09 15:36:16 jakllsch Exp $	*/
 
 /*
  * Copyright (C) 2013, NVIDIA Corporation.  All rights reserved.
@@ -24,7 +24,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: drm_panel.c,v 1.2 2018/08/27 04:58:19 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: drm_panel.c,v 1.3 2019/12/09 15:36:16 jakllsch Exp $");
 
 #include 
 #include 
@@ -32,8 +32,13 @@ __KERNEL_RCSID(0, "$NetBSD: drm_panel.c,
 #include 
 #include 
 
+#ifdef __NetBSD__
+static struct mutex panel_lock;
+static struct list_head panel_list = LIST_HEAD_INIT(panel_list);
+#else
 static DEFINE_MUTEX(panel_lock);
 static LIST_HEAD(panel_list);
+#endif
 
 void drm_panel_init(struct drm_panel *panel)
 {



CVS commit: src/sys/external/bsd/drm2/dist/drm/nouveau/include/nvif

2019-12-07 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Dec  7 13:31:41 UTC 2019

Modified Files:
src/sys/external/bsd/drm2/dist/drm/nouveau/include/nvif: os.h

Log Message:
Fix build for ports without __BUS_SPACE_HAS_STREAM_METHODS defined


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 \
src/sys/external/bsd/drm2/dist/drm/nouveau/include/nvif/os.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/dist/drm/nouveau/include/nvif/os.h
diff -u src/sys/external/bsd/drm2/dist/drm/nouveau/include/nvif/os.h:1.4 src/sys/external/bsd/drm2/dist/drm/nouveau/include/nvif/os.h:1.5
--- src/sys/external/bsd/drm2/dist/drm/nouveau/include/nvif/os.h:1.4	Mon Aug 27 07:35:13 2018
+++ src/sys/external/bsd/drm2/dist/drm/nouveau/include/nvif/os.h	Sat Dec  7 13:31:41 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: os.h,v 1.4 2018/08/27 07:35:13 riastradh Exp $	*/
+/*	$NetBSD: os.h,v 1.5 2019/12/07 13:31:41 jmcneill Exp $	*/
 
 #ifndef __NOUVEAU_OS_H__
 #define __NOUVEAU_OS_H__
@@ -74,4 +74,14 @@
 #endif /* !ioread32_native */
 #endif
 
+#ifdef __NetBSD__
+#include 
+#ifndef __BUS_SPACE_HAS_STREAM_METHODS
+#define	bus_space_read_stream_2	bus_space_read_2
+#define	bus_space_read_stream_4	bus_space_read_4
+#define	bus_space_write_stream_2 bus_space_write_2
+#define	bus_space_write_stream_4 bus_space_write_4
+#endif
+#endif
+
 #endif



CVS commit: src/sys/external/bsd/drm2/dist/drm/i915

2019-12-05 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Thu Dec  5 20:25:54 UTC 2019

Modified Files:
src/sys/external/bsd/drm2/dist/drm/i915: i915_cmd_parser.c

Log Message:
Use the original linux function rather than my wrong translation.

...Include the header to have it.

Thanks Riastradh!


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 \
src/sys/external/bsd/drm2/dist/drm/i915/i915_cmd_parser.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/dist/drm/i915/i915_cmd_parser.c
diff -u src/sys/external/bsd/drm2/dist/drm/i915/i915_cmd_parser.c:1.19 src/sys/external/bsd/drm2/dist/drm/i915/i915_cmd_parser.c:1.20
--- src/sys/external/bsd/drm2/dist/drm/i915/i915_cmd_parser.c:1.19	Thu Dec  5 20:03:09 2019
+++ src/sys/external/bsd/drm2/dist/drm/i915/i915_cmd_parser.c	Thu Dec  5 20:25:54 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: i915_cmd_parser.c,v 1.19 2019/12/05 20:03:09 maya Exp $	*/
+/*	$NetBSD: i915_cmd_parser.c,v 1.20 2019/12/05 20:25:54 maya Exp $	*/
 
 /*
  * Copyright © 2013 Intel Corporation
@@ -28,10 +28,11 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: i915_cmd_parser.c,v 1.19 2019/12/05 20:03:09 maya Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i915_cmd_parser.c,v 1.20 2019/12/05 20:25:54 maya Exp $");
 
 #include "i915_drv.h"
 #include 
+#include 
 
 /**
  * DOC: batch buffer command parser
@@ -1259,7 +1260,7 @@ static void init_whitelist(struct intel_
 {
 	const u32 batch_cmds = DIV_ROUND_UP(batch_len, sizeof(u32));
 	const u32 exact_size = BITS_TO_LONGS(batch_cmds);
-	u32 next_size = BITS_TO_LONGS(powerof2(batch_cmds));
+	u32 next_size = BITS_TO_LONGS(roundup_pow_of_two(batch_cmds));
 	unsigned long *next_whitelist;
 
 	if (CMDPARSER_USES_GGTT(ctx->i915))



CVS commit: src/sys/external/bsd/drm2/ttm

2019-04-21 Thread Chuck Silvers
Module Name:src
Committed By:   chs
Date:   Sun Apr 21 15:49:50 UTC 2019

Modified Files:
src/sys/external/bsd/drm2/ttm: ttm_bus_dma.c

Log Message:
in ttm_bus_dma_populate(), move the clearing of TTM_PAGE_FLAG_SWAPPED to be
earlier to avoid wrongly asserting if bus_dmamap_load_pglist() fails.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/external/bsd/drm2/ttm/ttm_bus_dma.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/ttm/ttm_bus_dma.c
diff -u src/sys/external/bsd/drm2/ttm/ttm_bus_dma.c:1.7 src/sys/external/bsd/drm2/ttm/ttm_bus_dma.c:1.8
--- src/sys/external/bsd/drm2/ttm/ttm_bus_dma.c:1.7	Thu Mar  9 08:27:18 2017
+++ src/sys/external/bsd/drm2/ttm/ttm_bus_dma.c	Sun Apr 21 15:49:50 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: ttm_bus_dma.c,v 1.7 2017/03/09 08:27:18 maya Exp $	*/
+/*	$NetBSD: ttm_bus_dma.c,v 1.8 2019/04/21 15:49:50 chs Exp $	*/
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ttm_bus_dma.c,v 1.7 2017/03/09 08:27:18 maya Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ttm_bus_dma.c,v 1.8 2019/04/21 15:49:50 chs Exp $");
 
 #include 
 
@@ -70,6 +70,9 @@ ttm_bus_dma_populate(struct ttm_dma_tt *
 	/* Mark it populated but unbound.  */
 	ttm_dma->ttm.state = tt_unbound;
 
+	/* Mark it wired.  */
+	ttm_dma->ttm.page_flags &= ~TTM_PAGE_FLAG_SWAPPED;
+
 	/* Load the DMA map.  */
 	/* XXX errno NetBSD->Linux */
 	ret = -bus_dmamap_load_pglist(ttm_dma->ttm.bdev->dmat,
@@ -78,9 +81,6 @@ ttm_bus_dma_populate(struct ttm_dma_tt *
 	if (ret)
 		goto fail1;
 
-	/* Mark it wired.  */
-	ttm_dma->ttm.page_flags &= ~TTM_PAGE_FLAG_SWAPPED;
-
 	/* Success!  */
 	return 0;
 



CVS commit: src/sys/external/bsd/drm2/include/drm

2019-04-07 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Sun Apr  7 20:28:41 UTC 2019

Modified Files:
src/sys/external/bsd/drm2/include/drm: drm_os_netbsd.h
Removed Files:
src/sys/external/bsd/drm2/include/drm: drm_copy_netbsd.h

Log Message:
Remove unused definitions.

(These appear to have existed in old-drm)


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r0 \
src/sys/external/bsd/drm2/include/drm/drm_copy_netbsd.h
cvs rdiff -u -r1.13 -r1.14 \
src/sys/external/bsd/drm2/include/drm/drm_os_netbsd.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/include/drm/drm_os_netbsd.h
diff -u src/sys/external/bsd/drm2/include/drm/drm_os_netbsd.h:1.13 src/sys/external/bsd/drm2/include/drm/drm_os_netbsd.h:1.14
--- src/sys/external/bsd/drm2/include/drm/drm_os_netbsd.h:1.13	Tue Aug 28 03:41:39 2018
+++ src/sys/external/bsd/drm2/include/drm/drm_os_netbsd.h	Sun Apr  7 20:28:41 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: drm_os_netbsd.h,v 1.13 2018/08/28 03:41:39 riastradh Exp $	*/
+/*	$NetBSD: drm_os_netbsd.h,v 1.14 2019/04/07 20:28:41 maya Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -69,7 +69,6 @@
 
 #include 
 #include 
-#include 
 #include 
 #include 
 



CVS commit: src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/mmu

2019-03-17 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Mon Mar 18 02:01:41 UTC 2019

Modified Files:
src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/mmu:
nouveau_nvkm_subdev_mmu_base.c

Log Message:
call destroy on a mutex before freeing it.
fixes LOCKDEBUG assert on a GT 6xx card.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 \

src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/mmu/nouveau_nvkm_subdev_mmu_base.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/mmu/nouveau_nvkm_subdev_mmu_base.c
diff -u src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/mmu/nouveau_nvkm_subdev_mmu_base.c:1.4 src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/mmu/nouveau_nvkm_subdev_mmu_base.c:1.5
--- src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/mmu/nouveau_nvkm_subdev_mmu_base.c:1.4	Sat Sep  1 04:38:22 2018
+++ src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/mmu/nouveau_nvkm_subdev_mmu_base.c	Mon Mar 18 02:01:41 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: nouveau_nvkm_subdev_mmu_base.c,v 1.4 2018/09/01 04:38:22 riastradh Exp $	*/
+/*	$NetBSD: nouveau_nvkm_subdev_mmu_base.c,v 1.5 2019/03/18 02:01:41 mrg Exp $	*/
 
 /*
  * Copyright 2010 Red Hat Inc.
@@ -24,7 +24,7 @@
  * Authors: Ben Skeggs
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: nouveau_nvkm_subdev_mmu_base.c,v 1.4 2018/09/01 04:38:22 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nouveau_nvkm_subdev_mmu_base.c,v 1.5 2019/03/18 02:01:41 mrg Exp $");
 
 #include "priv.h"
 
@@ -528,6 +528,11 @@ nvkm_vm_del(struct kref *kref)
 
 	nvkm_mm_fini(&vm->mm);
 	vfree(vm->pgt);
+#ifdef __NetBSD__
+	linux_mutex_destroy(&vm->mutex);
+#else
+	mutex_destroy(&vm->mutex);
+#endif
 	kfree(vm);
 }
 



CVS commit: src/sys/external/bsd/drm2/ttm

2019-03-08 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sat Mar  9 01:59:47 UTC 2019

Modified Files:
src/sys/external/bsd/drm2/ttm: ttm_bo_vm.c

Log Message:
ttm_bo_uvm_fault() is a netbsd API function and thus should return
netbsd errnos.  fix the one "return -ERESTART".


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/external/bsd/drm2/ttm/ttm_bo_vm.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/ttm/ttm_bo_vm.c
diff -u src/sys/external/bsd/drm2/ttm/ttm_bo_vm.c:1.11 src/sys/external/bsd/drm2/ttm/ttm_bo_vm.c:1.12
--- src/sys/external/bsd/drm2/ttm/ttm_bo_vm.c:1.11	Mon Aug 27 07:53:28 2018
+++ src/sys/external/bsd/drm2/ttm/ttm_bo_vm.c	Sat Mar  9 01:59:47 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: ttm_bo_vm.c,v 1.11 2018/08/27 07:53:28 riastradh Exp $	*/
+/*	$NetBSD: ttm_bo_vm.c,v 1.12 2019/03/09 01:59:47 mrg Exp $	*/
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ttm_bo_vm.c,v 1.11 2018/08/27 07:53:28 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ttm_bo_vm.c,v 1.12 2019/03/09 01:59:47 mrg Exp $");
 
 #include 
 
@@ -112,7 +112,7 @@ ttm_bo_uvm_fault(struct uvm_faultinfo *u
 		 */
 		uvmfault_unlockall(ufi, ufi->entry->aref.ar_amap, NULL);
 		(void)ttm_bo_wait_unreserved(bo);
-		return -ERESTART;
+		return ERESTART;
 	}
 
 	/* drm prime buffers are not mappable.  XXX Catch this earlier?  */



CVS commit: src/sys/external/bsd/drm2/drm

2019-03-07 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Fri Mar  8 02:53:22 UTC 2019

Modified Files:
src/sys/external/bsd/drm2/drm: drm_gem_cma_helper.c

Log Message:
drm_gem_cma_fault() is a UVM fault function.  return netbsd errnos.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/external/bsd/drm2/drm/drm_gem_cma_helper.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/drm/drm_gem_cma_helper.c
diff -u src/sys/external/bsd/drm2/drm/drm_gem_cma_helper.c:1.6 src/sys/external/bsd/drm2/drm/drm_gem_cma_helper.c:1.7
--- src/sys/external/bsd/drm2/drm/drm_gem_cma_helper.c:1.6	Mon Aug 27 15:27:43 2018
+++ src/sys/external/bsd/drm2/drm/drm_gem_cma_helper.c	Fri Mar  8 02:53:22 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: drm_gem_cma_helper.c,v 1.6 2018/08/27 15:27:43 riastradh Exp $ */
+/* $NetBSD: drm_gem_cma_helper.c,v 1.7 2019/03/08 02:53:22 mrg Exp $ */
 
 /*-
  * Copyright (c) 2015-2017 Jared McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: drm_gem_cma_helper.c,v 1.6 2018/08/27 15:27:43 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: drm_gem_cma_helper.c,v 1.7 2019/03/08 02:53:22 mrg Exp $");
 
 #include 
 #include 
@@ -194,7 +194,7 @@ drm_gem_cma_fault(struct uvm_faultinfo *
 	vm_prot_t mapprot;
 
 	if (UVM_ET_ISCOPYONWRITE(entry))
-		return -EIO;
+		return EIO;
 
 	curr_offset = entry->offset + (vaddr - entry->start);
 	curr_va = vaddr;
@@ -210,7 +210,7 @@ drm_gem_cma_fault(struct uvm_faultinfo *
 		mdpgno = bus_dmamem_mmap(obj->dmat, obj->dmasegs, 1,
 		curr_offset, access_type, BUS_DMA_PREFETCHABLE);
 		if (mdpgno == -1) {
-			retval = -EIO;
+			retval = EIO;
 			break;
 		}
 		paddr = pmap_phys_address(mdpgno);
@@ -222,7 +222,7 @@ drm_gem_cma_fault(struct uvm_faultinfo *
 			pmap_update(ufi->orig_map->pmap);
 			uvmfault_unlockall(ufi, ufi->entry->aref.ar_amap, uobj);
 			uvm_wait("drm_gem_cma_fault");
-			return -ERESTART;
+			return ERESTART;
 		}
 	}
 



CVS commit: src/sys/external/bsd/drm2/dist/drm/amd/amdgpu

2019-02-23 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Sat Feb 23 19:56:51 UTC 2019

Modified Files:
src/sys/external/bsd/drm2/dist/drm/amd/amdgpu: amdgpu_display.c

Log Message:
Rearrange code in amdgpu_display.c to prevent build error

GCC reports that stat can be uninitialized when used, prevent this with
changing the construction of the code a little bit.

Keep original indent in order to not generate diff with upstream.

Solution suggested by 

Detected with GCC7 when building NetBSD/i386 with kUBSan.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 \
src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_display.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_display.c
diff -u src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_display.c:1.4 src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_display.c:1.5
--- src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_display.c:1.4	Mon Aug 27 15:22:54 2018
+++ src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_display.c	Sat Feb 23 19:56:51 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: amdgpu_display.c,v 1.4 2018/08/27 15:22:54 riastradh Exp $	*/
+/*	$NetBSD: amdgpu_display.c,v 1.5 2019/02/23 19:56:51 kamil Exp $	*/
 
 /*
  * Copyright 2007-8 Advanced Micro Devices, Inc.
@@ -26,7 +26,7 @@
  *  Alex Deucher
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: amdgpu_display.c,v 1.4 2018/08/27 15:22:54 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: amdgpu_display.c,v 1.5 2019/02/23 19:56:51 kamil Exp $");
 
 #include 
 #include 
@@ -101,7 +101,8 @@ static void amdgpu_flip_work_func(struct
 	 * In practice this won't execute very often unless on very fast
 	 * machines because the time window for this to happen is very small.
 	 */
-	while (amdgpuCrtc->enabled && --repcnt) {
+	if (amdgpuCrtc->enabled) {
+	while (--repcnt) {
 		/* GET_DISTANCE_TO_VBLANKSTART returns distance to real vblank
 		 * start in hpos, and to the "fudged earlier" vblank start in
 		 * vpos.
@@ -134,6 +135,7 @@ static void amdgpu_flip_work_func(struct
  "hpos %d\n", work->crtc_id, min_udelay,
  vblank->framedur_ns / 1000,
  vblank->linedur_ns / 1000, stat, vpos, hpos);
+	}
 
 	/* do the flip (mmio) */
 	adev->mode_info.funcs->page_flip(adev, work->crtc_id, work->base);



CVS commit: src/sys/external/bsd/drm2/dist/drm/amd/amdgpu

2019-02-23 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Sat Feb 23 19:37:36 UTC 2019

Modified Files:
src/sys/external/bsd/drm2/dist/drm/amd/amdgpu: amdgpu_gfx_v8_0.c

Log Message:
Add missing break in amdgpu_gfx_v8_0.c

Reviewed by 

Detected with GCC7 with kUBSan build for NetBSD/i386


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 \
src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_gfx_v8_0.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_gfx_v8_0.c
diff -u src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_gfx_v8_0.c:1.1 src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_gfx_v8_0.c:1.2
--- src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_gfx_v8_0.c:1.1	Mon Aug 27 14:10:14 2018
+++ src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_gfx_v8_0.c	Sat Feb 23 19:37:36 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: amdgpu_gfx_v8_0.c,v 1.1 2018/08/27 14:10:14 riastradh Exp $	*/
+/*	$NetBSD: amdgpu_gfx_v8_0.c,v 1.2 2019/02/23 19:37:36 kamil Exp $	*/
 
 /*
  * Copyright 2014 Advanced Micro Devices, Inc.
@@ -23,7 +23,7 @@
  *
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: amdgpu_gfx_v8_0.c,v 1.1 2018/08/27 14:10:14 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: amdgpu_gfx_v8_0.c,v 1.2 2019/02/23 19:37:36 kamil Exp $");
 
 #include 
 #include 
@@ -1640,6 +1640,7 @@ static void gfx_v8_0_tiling_mode_table_i
 			adev->gfx.config.macrotile_mode_array[reg_offset] = gb_tile_moden;
 			WREG32(mmGB_MACROTILE_MODE0 + reg_offset, gb_tile_moden);
 		}
+		break;
 	case CHIP_FIJI:
 		for (reg_offset = 0; reg_offset < num_tile_mode_states; reg_offset++) {
 			switch (reg_offset) {



CVS commit: src/sys/external/bsd/drm2/dist/drm/amd/amdgpu

2019-02-23 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Sat Feb 23 19:36:15 UTC 2019

Modified Files:
src/sys/external/bsd/drm2/dist/drm/amd/amdgpu: amdgpu_cz_smc.c

Log Message:
Add missing break in amdgpu_cz_smc.c

Reviewed by 

Detected with GCC7 with kUBSan build for NetBSD/i386


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 \
src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_cz_smc.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_cz_smc.c
diff -u src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_cz_smc.c:1.1 src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_cz_smc.c:1.2
--- src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_cz_smc.c:1.1	Mon Aug 27 14:10:14 2018
+++ src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_cz_smc.c	Sat Feb 23 19:36:15 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: amdgpu_cz_smc.c,v 1.1 2018/08/27 14:10:14 riastradh Exp $	*/
+/*	$NetBSD: amdgpu_cz_smc.c,v 1.2 2019/02/23 19:36:15 kamil Exp $	*/
 
 /*
  * Copyright 2014 Advanced Micro Devices, Inc.
@@ -23,7 +23,7 @@
  *
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: amdgpu_cz_smc.c,v 1.1 2018/08/27 14:10:14 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: amdgpu_cz_smc.c,v 1.2 2019/02/23 19:36:15 kamil Exp $");
 
 #include 
 #include 
@@ -251,6 +251,7 @@ static int cz_smu_check_finished(struct 
 	case AMDGPU_UCODE_ID_CP_PFP:
 		if (adev->smu.fw_flags & AMDGPU_CPPFP_UCODE_LOADED)
 			return 0;
+		break;
 	case AMDGPU_UCODE_ID_CP_ME:
 		if (adev->smu.fw_flags & AMDGPU_CPME_UCODE_LOADED)
 			return 0;



CVS commit: src/sys/external/bsd/drm2/dist/drm

2019-02-18 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Feb 19 00:30:16 UTC 2019

Modified Files:
src/sys/external/bsd/drm2/dist/drm/i915: intel_ddi.c intel_display.c
intel_sdvo.c
src/sys/external/bsd/drm2/dist/drm/nouveau: nouveau_bo.c

Log Message:
revert the upsteam portion of previous; we don't want to patch upstream
fallthrough/breaks.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/external/bsd/drm2/dist/drm/i915/intel_ddi.c
cvs rdiff -u -r1.25 -r1.26 \
src/sys/external/bsd/drm2/dist/drm/i915/intel_display.c
cvs rdiff -u -r1.11 -r1.12 \
src/sys/external/bsd/drm2/dist/drm/i915/intel_sdvo.c
cvs rdiff -u -r1.14 -r1.15 \
src/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_bo.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/dist/drm/i915/intel_ddi.c
diff -u src/sys/external/bsd/drm2/dist/drm/i915/intel_ddi.c:1.9 src/sys/external/bsd/drm2/dist/drm/i915/intel_ddi.c:1.10
--- src/sys/external/bsd/drm2/dist/drm/i915/intel_ddi.c:1.9	Mon Feb 18 18:23:41 2019
+++ src/sys/external/bsd/drm2/dist/drm/i915/intel_ddi.c	Mon Feb 18 19:30:16 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: intel_ddi.c,v 1.9 2019/02/18 23:23:41 christos Exp $	*/
+/*	$NetBSD: intel_ddi.c,v 1.10 2019/02/19 00:30:16 christos Exp $	*/
 
 /*
  * Copyright © 2012 Intel Corporation
@@ -28,7 +28,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: intel_ddi.c,v 1.9 2019/02/18 23:23:41 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: intel_ddi.c,v 1.10 2019/02/19 00:30:16 christos Exp $");
 
 #include 
 
@@ -2228,7 +2228,6 @@ static uint32_t translate_signal_level(i
 	default:
 		DRM_DEBUG_KMS("Unsupported voltage swing/pre-emphasis level: 0x%x\n",
 			  signal_levels);
-		/*FALLTHROUGH*/
 	case DP_TRAIN_VOLTAGE_SWING_LEVEL_0 | DP_TRAIN_PRE_EMPH_LEVEL_0:
 		level = 0;
 		break;

Index: src/sys/external/bsd/drm2/dist/drm/i915/intel_display.c
diff -u src/sys/external/bsd/drm2/dist/drm/i915/intel_display.c:1.25 src/sys/external/bsd/drm2/dist/drm/i915/intel_display.c:1.26
--- src/sys/external/bsd/drm2/dist/drm/i915/intel_display.c:1.25	Mon Feb 18 18:23:41 2019
+++ src/sys/external/bsd/drm2/dist/drm/i915/intel_display.c	Mon Feb 18 19:30:16 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: intel_display.c,v 1.25 2019/02/18 23:23:41 christos Exp $	*/
+/*	$NetBSD: intel_display.c,v 1.26 2019/02/19 00:30:16 christos Exp $	*/
 
 /*
  * Copyright © 2006-2007 Intel Corporation
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: intel_display.c,v 1.25 2019/02/18 23:23:41 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: intel_display.c,v 1.26 2019/02/19 00:30:16 christos Exp $");
 
 #include 
 #include 
@@ -5318,7 +5318,6 @@ intel_display_port_power_domain(struct i
 	case INTEL_OUTPUT_UNKNOWN:
 		/* Only DDI platforms should ever use this output type */
 		WARN_ON_ONCE(!HAS_DDI(dev));
-		/*FALLTHROUGH*/
 	case INTEL_OUTPUT_DISPLAYPORT:
 	case INTEL_OUTPUT_HDMI:
 	case INTEL_OUTPUT_EDP:
@@ -5353,7 +5352,6 @@ intel_display_port_aux_power_domain(stru
 		 * run the DP detection too.
 		 */
 		WARN_ON_ONCE(!HAS_DDI(dev));
-		/*FALLTHROUGH*/
 	case INTEL_OUTPUT_DISPLAYPORT:
 	case INTEL_OUTPUT_EDP:
 		intel_dig_port = enc_to_dig_port(&intel_encoder->base);
@@ -6924,7 +6922,6 @@ static int pnv_get_display_clock_speed(s
 		return 20;
 	default:
 		DRM_ERROR("Unknown pnv display core clock 0x%04x\n", gcfgc);
-		/*FALLTHROUGH*/
 	case GC_DISPLAY_CLOCK_133_MHZ_PNV:
 		return 13;
 	case GC_DISPLAY_CLOCK_167_MHZ_PNV:
@@ -9960,7 +9957,6 @@ static bool haswell_get_pipe_config(stru
 		switch (tmp & TRANS_DDI_EDP_INPUT_MASK) {
 		default:
 			WARN(1, "unknown pipe linked to edp transcoder\n");
-			/*FALLTHROUGH*/
 		case TRANS_DDI_EDP_INPUT_A_ONOFF:
 		case TRANS_DDI_EDP_INPUT_A_ON:
 			trans_edp_pipe = PIPE_A;
@@ -12252,7 +12248,6 @@ static bool check_digital_port_conflicts
 		case INTEL_OUTPUT_UNKNOWN:
 			if (WARN_ON(!HAS_DDI(dev)))
 break;
-			/*FALLTHROUGH*/
 		case INTEL_OUTPUT_DISPLAYPORT:
 		case INTEL_OUTPUT_HDMI:
 		case INTEL_OUTPUT_EDP:

Index: src/sys/external/bsd/drm2/dist/drm/i915/intel_sdvo.c
diff -u src/sys/external/bsd/drm2/dist/drm/i915/intel_sdvo.c:1.11 src/sys/external/bsd/drm2/dist/drm/i915/intel_sdvo.c:1.12
--- src/sys/external/bsd/drm2/dist/drm/i915/intel_sdvo.c:1.11	Mon Feb 18 18:23:41 2019
+++ src/sys/external/bsd/drm2/dist/drm/i915/intel_sdvo.c	Mon Feb 18 19:30:16 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: intel_sdvo.c,v 1.11 2019/02/18 23:23:41 christos Exp $	*/
+/*	$NetBSD: intel_sdvo.c,v 1.12 2019/02/19 00:30:16 christos Exp $	*/
 
 /*
  * Copyright 2006 Dave Airlie 
@@ -28,7 +28,7 @@
  *	Eric Anholt 
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: intel_sdvo.c,v 1.11 2019/02/18 23:23:41 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: intel_sdvo.c,v 1.12 2019/02/19 00:30:16 christos Exp $");
 
 #include 
 #include 
@@ -1278,7 +1278,6 @@ static void intel_sdvo_pre_enable(struct
 	switc

CVS commit: src/sys/external/bsd/drm2/dist/drm

2019-02-18 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Feb 18 23:23:41 UTC 2019

Modified Files:
src/sys/external/bsd/drm2/dist/drm/i915: intel_ddi.c intel_display.c
intel_sdvo.c
src/sys/external/bsd/drm2/dist/drm/nouveau: nouveau_bo.c nouveau_usif.c

Log Message:
add failthrough and break as appropriate.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/external/bsd/drm2/dist/drm/i915/intel_ddi.c
cvs rdiff -u -r1.24 -r1.25 \
src/sys/external/bsd/drm2/dist/drm/i915/intel_display.c
cvs rdiff -u -r1.10 -r1.11 \
src/sys/external/bsd/drm2/dist/drm/i915/intel_sdvo.c
cvs rdiff -u -r1.13 -r1.14 \
src/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_bo.c
cvs rdiff -u -r1.6 -r1.7 \
src/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_usif.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/dist/drm/i915/intel_ddi.c
diff -u src/sys/external/bsd/drm2/dist/drm/i915/intel_ddi.c:1.8 src/sys/external/bsd/drm2/dist/drm/i915/intel_ddi.c:1.9
--- src/sys/external/bsd/drm2/dist/drm/i915/intel_ddi.c:1.8	Thu Sep 13 04:25:55 2018
+++ src/sys/external/bsd/drm2/dist/drm/i915/intel_ddi.c	Mon Feb 18 18:23:41 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: intel_ddi.c,v 1.8 2018/09/13 08:25:55 mrg Exp $	*/
+/*	$NetBSD: intel_ddi.c,v 1.9 2019/02/18 23:23:41 christos Exp $	*/
 
 /*
  * Copyright © 2012 Intel Corporation
@@ -28,7 +28,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: intel_ddi.c,v 1.8 2018/09/13 08:25:55 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: intel_ddi.c,v 1.9 2019/02/18 23:23:41 christos Exp $");
 
 #include 
 
@@ -2228,6 +2228,7 @@ static uint32_t translate_signal_level(i
 	default:
 		DRM_DEBUG_KMS("Unsupported voltage swing/pre-emphasis level: 0x%x\n",
 			  signal_levels);
+		/*FALLTHROUGH*/
 	case DP_TRAIN_VOLTAGE_SWING_LEVEL_0 | DP_TRAIN_PRE_EMPH_LEVEL_0:
 		level = 0;
 		break;

Index: src/sys/external/bsd/drm2/dist/drm/i915/intel_display.c
diff -u src/sys/external/bsd/drm2/dist/drm/i915/intel_display.c:1.24 src/sys/external/bsd/drm2/dist/drm/i915/intel_display.c:1.25
--- src/sys/external/bsd/drm2/dist/drm/i915/intel_display.c:1.24	Sun Sep 23 20:42:34 2018
+++ src/sys/external/bsd/drm2/dist/drm/i915/intel_display.c	Mon Feb 18 18:23:41 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: intel_display.c,v 1.24 2018/09/24 00:42:34 christos Exp $	*/
+/*	$NetBSD: intel_display.c,v 1.25 2019/02/18 23:23:41 christos Exp $	*/
 
 /*
  * Copyright © 2006-2007 Intel Corporation
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: intel_display.c,v 1.24 2018/09/24 00:42:34 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: intel_display.c,v 1.25 2019/02/18 23:23:41 christos Exp $");
 
 #include 
 #include 
@@ -5318,6 +5318,7 @@ intel_display_port_power_domain(struct i
 	case INTEL_OUTPUT_UNKNOWN:
 		/* Only DDI platforms should ever use this output type */
 		WARN_ON_ONCE(!HAS_DDI(dev));
+		/*FALLTHROUGH*/
 	case INTEL_OUTPUT_DISPLAYPORT:
 	case INTEL_OUTPUT_HDMI:
 	case INTEL_OUTPUT_EDP:
@@ -5352,6 +5353,7 @@ intel_display_port_aux_power_domain(stru
 		 * run the DP detection too.
 		 */
 		WARN_ON_ONCE(!HAS_DDI(dev));
+		/*FALLTHROUGH*/
 	case INTEL_OUTPUT_DISPLAYPORT:
 	case INTEL_OUTPUT_EDP:
 		intel_dig_port = enc_to_dig_port(&intel_encoder->base);
@@ -6922,6 +6924,7 @@ static int pnv_get_display_clock_speed(s
 		return 20;
 	default:
 		DRM_ERROR("Unknown pnv display core clock 0x%04x\n", gcfgc);
+		/*FALLTHROUGH*/
 	case GC_DISPLAY_CLOCK_133_MHZ_PNV:
 		return 13;
 	case GC_DISPLAY_CLOCK_167_MHZ_PNV:
@@ -9957,6 +9960,7 @@ static bool haswell_get_pipe_config(stru
 		switch (tmp & TRANS_DDI_EDP_INPUT_MASK) {
 		default:
 			WARN(1, "unknown pipe linked to edp transcoder\n");
+			/*FALLTHROUGH*/
 		case TRANS_DDI_EDP_INPUT_A_ONOFF:
 		case TRANS_DDI_EDP_INPUT_A_ON:
 			trans_edp_pipe = PIPE_A;
@@ -12248,6 +12252,7 @@ static bool check_digital_port_conflicts
 		case INTEL_OUTPUT_UNKNOWN:
 			if (WARN_ON(!HAS_DDI(dev)))
 break;
+			/*FALLTHROUGH*/
 		case INTEL_OUTPUT_DISPLAYPORT:
 		case INTEL_OUTPUT_HDMI:
 		case INTEL_OUTPUT_EDP:

Index: src/sys/external/bsd/drm2/dist/drm/i915/intel_sdvo.c
diff -u src/sys/external/bsd/drm2/dist/drm/i915/intel_sdvo.c:1.10 src/sys/external/bsd/drm2/dist/drm/i915/intel_sdvo.c:1.11
--- src/sys/external/bsd/drm2/dist/drm/i915/intel_sdvo.c:1.10	Mon Aug 27 02:16:50 2018
+++ src/sys/external/bsd/drm2/dist/drm/i915/intel_sdvo.c	Mon Feb 18 18:23:41 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: intel_sdvo.c,v 1.10 2018/08/27 06:16:50 riastradh Exp $	*/
+/*	$NetBSD: intel_sdvo.c,v 1.11 2019/02/18 23:23:41 christos Exp $	*/
 
 /*
  * Copyright 2006 Dave Airlie 
@@ -28,7 +28,7 @@
  *	Eric Anholt 
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: intel_sdvo.c,v 1.10 2018/08/27 06:16:50 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: intel_sdvo.c,v 1.11 2019/02/18 23:23:41 christos Exp $");
 
 #include 
 #include 
@@ -1278,6 +1278,7 @@ static

CVS commit: src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/clk

2019-02-18 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Feb 18 23:19:36 UTC 2019

Modified Files:
src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/clk:
nouveau_nvkm_subdev_clk_gt215.c

Log Message:
remove multiplication as condition complaint


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 \

src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/clk/nouveau_nvkm_subdev_clk_gt215.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/clk/nouveau_nvkm_subdev_clk_gt215.c
diff -u src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/clk/nouveau_nvkm_subdev_clk_gt215.c:1.3 src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/clk/nouveau_nvkm_subdev_clk_gt215.c:1.4
--- src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/clk/nouveau_nvkm_subdev_clk_gt215.c:1.3	Mon Aug 27 03:38:56 2018
+++ src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/clk/nouveau_nvkm_subdev_clk_gt215.c	Mon Feb 18 18:19:36 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: nouveau_nvkm_subdev_clk_gt215.c,v 1.3 2018/08/27 07:38:56 riastradh Exp $	*/
+/*	$NetBSD: nouveau_nvkm_subdev_clk_gt215.c,v 1.4 2019/02/18 23:19:36 christos Exp $	*/
 
 /*
  * Copyright 2012 Red Hat Inc.
@@ -25,7 +25,7 @@
  *  Roy Spliet
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: nouveau_nvkm_subdev_clk_gt215.c,v 1.3 2018/08/27 07:38:56 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nouveau_nvkm_subdev_clk_gt215.c,v 1.4 2019/02/18 23:19:36 christos Exp $");
 
 #define gt215_clk(p) container_of((p), struct gt215_clk, base)
 #include "gt215.h"
@@ -135,8 +135,9 @@ read_pll(struct gt215_clk *clk, int idx,
 		sclk = read_clk(clk, 0x10 + idx, false);
 	}
 
-	if (M * P)
-		return sclk * N / (M * P);
+	u32 mp = M * P;
+	if (mp != 0)
+		return sclk * N / mp;
 
 	return 0;
 }



CVS commit: src/sys/external/bsd/drm2/dist/drm/radeon

2019-02-07 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Fri Feb  8 04:11:53 UTC 2019

Modified Files:
src/sys/external/bsd/drm2/dist/drm/radeon: radeon_evergreen_cs.c
radeon_r300.c radeon_r420.c

Log Message:
add missing break for CP_COHER_BASE case.
convert fallthru comments.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 \
src/sys/external/bsd/drm2/dist/drm/radeon/radeon_evergreen_cs.c \
src/sys/external/bsd/drm2/dist/drm/radeon/radeon_r300.c \
src/sys/external/bsd/drm2/dist/drm/radeon/radeon_r420.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/dist/drm/radeon/radeon_evergreen_cs.c
diff -u src/sys/external/bsd/drm2/dist/drm/radeon/radeon_evergreen_cs.c:1.1 src/sys/external/bsd/drm2/dist/drm/radeon/radeon_evergreen_cs.c:1.2
--- src/sys/external/bsd/drm2/dist/drm/radeon/radeon_evergreen_cs.c:1.1	Mon Aug 27 14:38:20 2018
+++ src/sys/external/bsd/drm2/dist/drm/radeon/radeon_evergreen_cs.c	Fri Feb  8 04:11:53 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: radeon_evergreen_cs.c,v 1.1 2018/08/27 14:38:20 riastradh Exp $	*/
+/*	$NetBSD: radeon_evergreen_cs.c,v 1.2 2019/02/08 04:11:53 mrg Exp $	*/
 
 /*
  * Copyright 2010 Advanced Micro Devices, Inc.
@@ -28,7 +28,7 @@
  *  Jerome Glisse
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: radeon_evergreen_cs.c,v 1.1 2018/08/27 14:38:20 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: radeon_evergreen_cs.c,v 1.2 2019/02/08 04:11:53 mrg Exp $");
 
 #include 
 #include "radeon.h"
@@ -1335,6 +1335,7 @@ static int evergreen_cs_handle_reg(struc
 			return -EINVAL;
 		}
 		ib[idx] += (u32)((reloc->gpu_offset >> 8) & 0x);
+		break;
 	case CB_TARGET_MASK:
 		track->cb_target_mask = radeon_get_ib_value(p, idx);
 		track->cb_dirty = true;
Index: src/sys/external/bsd/drm2/dist/drm/radeon/radeon_r300.c
diff -u src/sys/external/bsd/drm2/dist/drm/radeon/radeon_r300.c:1.1 src/sys/external/bsd/drm2/dist/drm/radeon/radeon_r300.c:1.2
--- src/sys/external/bsd/drm2/dist/drm/radeon/radeon_r300.c:1.1	Mon Aug 27 14:38:20 2018
+++ src/sys/external/bsd/drm2/dist/drm/radeon/radeon_r300.c	Fri Feb  8 04:11:53 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: radeon_r300.c,v 1.1 2018/08/27 14:38:20 riastradh Exp $	*/
+/*	$NetBSD: radeon_r300.c,v 1.2 2019/02/08 04:11:53 mrg Exp $	*/
 
 /*
  * Copyright 2008 Advanced Micro Devices, Inc.
@@ -28,7 +28,7 @@
  *  Jerome Glisse
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: radeon_r300.c,v 1.1 2018/08/27 14:38:20 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: radeon_r300.c,v 1.2 2019/02/08 04:11:53 mrg Exp $");
 
 #include 
 #include 
@@ -846,7 +846,7 @@ static int r300_packet0_check(struct rad
 	  ((idx_value >> 21) & 0xF));
 return -EINVAL;
 			}
-			/* Pass through. */
+			/* FALLTHROUGH */
 		case 6:
 			track->cb[i].cpp = 4;
 			break;
@@ -997,7 +997,7 @@ static int r300_packet0_check(struct rad
 return -EINVAL;
 			}
 			/* The same rules apply as for DXT3/5. */
-			/* Pass through. */
+			/* FALLTHROUGH */
 		case R300_TX_FORMAT_DXT3:
 		case R300_TX_FORMAT_DXT5:
 			track->textures[i].cpp = 1;
Index: src/sys/external/bsd/drm2/dist/drm/radeon/radeon_r420.c
diff -u src/sys/external/bsd/drm2/dist/drm/radeon/radeon_r420.c:1.1 src/sys/external/bsd/drm2/dist/drm/radeon/radeon_r420.c:1.2
--- src/sys/external/bsd/drm2/dist/drm/radeon/radeon_r420.c:1.1	Mon Aug 27 14:38:20 2018
+++ src/sys/external/bsd/drm2/dist/drm/radeon/radeon_r420.c	Fri Feb  8 04:11:53 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: radeon_r420.c,v 1.1 2018/08/27 14:38:20 riastradh Exp $	*/
+/*	$NetBSD: radeon_r420.c,v 1.2 2019/02/08 04:11:53 mrg Exp $	*/
 
 /*
  * Copyright 2008 Advanced Micro Devices, Inc.
@@ -28,7 +28,7 @@
  *  Jerome Glisse
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: radeon_r420.c,v 1.1 2018/08/27 14:38:20 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: radeon_r420.c,v 1.2 2019/02/08 04:11:53 mrg Exp $");
 
 #include 
 #include 
@@ -115,6 +115,7 @@ void r420_pipes_init(struct radeon_devic
 	default:
 		/* force to 1 pipe */
 		num_pipes = 1;
+		/* FALLTHROUGH */
 	case 1:
 		tmp = (0 << 1);
 		break;



CVS commit: src/sys/external/bsd/drm2/dist/drm/ttm

2019-02-02 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sat Feb  2 21:46:27 UTC 2019

Modified Files:
src/sys/external/bsd/drm2/dist/drm/ttm: ttm_bo.c

Log Message:
combine a pair of #ifdef's and make upstream diff slightly less ugly.  NFCI.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/external/bsd/drm2/dist/drm/ttm/ttm_bo.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/dist/drm/ttm/ttm_bo.c
diff -u src/sys/external/bsd/drm2/dist/drm/ttm/ttm_bo.c:1.14 src/sys/external/bsd/drm2/dist/drm/ttm/ttm_bo.c:1.15
--- src/sys/external/bsd/drm2/dist/drm/ttm/ttm_bo.c:1.14	Mon Aug 27 15:32:39 2018
+++ src/sys/external/bsd/drm2/dist/drm/ttm/ttm_bo.c	Sat Feb  2 21:46:27 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: ttm_bo.c,v 1.14 2018/08/27 15:32:39 riastradh Exp $	*/
+/*	$NetBSD: ttm_bo.c,v 1.15 2019/02/02 21:46:27 mrg Exp $	*/
 
 /**
  *
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ttm_bo.c,v 1.14 2018/08/27 15:32:39 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ttm_bo.c,v 1.15 2019/02/02 21:46:27 mrg Exp $");
 
 #define pr_fmt(fmt) "[TTM] " fmt
 
@@ -1624,10 +1624,6 @@ bool ttm_mem_reg_is_pci(struct ttm_bo_de
 
 void ttm_bo_unmap_virtual_locked(struct ttm_buffer_object *bo)
 {
-#ifndef __NetBSD__
-	struct ttm_bo_device *bdev = bo->bdev;
-#endif
-
 #ifdef __NetBSD__
 	if (bo->mem.bus.is_iomem) {
 		paddr_t start, end, pa;
@@ -1654,6 +1650,8 @@ void ttm_bo_unmap_virtual_locked(struct 
 		mutex_exit(bo->uvmobj.vmobjlock);
 	}
 #else
+	struct ttm_bo_device *bdev = bo->bdev;
+
 	drm_vma_node_unmap(&bo->vma_node, bdev->dev_mapping);
 #endif
 	ttm_mem_io_free_vm(bo);



CVS commit: src/sys/external/bsd/drm2/dist/drm/radeon

2019-01-29 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Wed Jan 30 01:11:08 UTC 2019

Modified Files:
src/sys/external/bsd/drm2/dist/drm/radeon: radeon_display.c

Log Message:
revert rev 1.3 + 1.4 (2015):  blank console / CLUT attempts.
we disabled the driver for almost all r100/r200 chipsets so
this code has been obsolete for ages and doesn't need to
remain a diff against upstream.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 \
src/sys/external/bsd/drm2/dist/drm/radeon/radeon_display.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/dist/drm/radeon/radeon_display.c
diff -u src/sys/external/bsd/drm2/dist/drm/radeon/radeon_display.c:1.9 src/sys/external/bsd/drm2/dist/drm/radeon/radeon_display.c:1.10
--- src/sys/external/bsd/drm2/dist/drm/radeon/radeon_display.c:1.9	Mon Aug 27 15:22:54 2018
+++ src/sys/external/bsd/drm2/dist/drm/radeon/radeon_display.c	Wed Jan 30 01:11:08 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: radeon_display.c,v 1.9 2018/08/27 15:22:54 riastradh Exp $	*/
+/*	$NetBSD: radeon_display.c,v 1.10 2019/01/30 01:11:08 mrg Exp $	*/
 
 /*
  * Copyright 2007-8 Advanced Micro Devices, Inc.
@@ -26,7 +26,7 @@
  *  Alex Deucher
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: radeon_display.c,v 1.9 2018/08/27 15:22:54 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: radeon_display.c,v 1.10 2019/01/30 01:11:08 mrg Exp $");
 
 #include 
 #include 
@@ -188,36 +188,12 @@ static void legacy_crtc_load_lut(struct 
 		dac2_cntl |= RADEON_DAC2_PALETTE_ACC_CTL;
 	WREG32(RADEON_DAC_CNTL2, dac2_cntl);
 
-	/*
-	 * At least the RV100 [vendor 1002 product 515e (rev. 0x02)]
-	 * has an old style palette
-	 */
-	if (rdev->family < CHIP_RV280) {
-#ifdef notyet
-		/*
-		 * Leave CLUT alone for now. The code below gives us a
-		 * nice 444 grayscale, but we are not in true color mode
-		 * anymore and I don't have any docs how to do this right.
-		 */
-		WREG8(RADEON_PALETTE_INDEX, 0);
-		for (i = 0; i < 256; i++) {
-#define R(x) (radeon_crtc->lut_r[i] >> 2)
-#define G(x) (radeon_crtc->lut_g[i] >> 2)
-#define B(x) (radeon_crtc->lut_b[i] >> 2)
-			WREG32(RADEON_PALETTE_DATA, ((R(i) << 16)
-| (G(i) << 8) | B(i)) << 4);
-		}
-#else
-		printf("%s: unknown DAC, can't set lookup table\n", __func__);
-#endif
-	} else {
-		WREG8(RADEON_PALETTE_INDEX, 0);
-		for (i = 0; i < 256; i++) {
-			WREG32(RADEON_PALETTE_30_DATA,
- (radeon_crtc->lut_r[i] << 20) |
- (radeon_crtc->lut_g[i] << 10) |
- (radeon_crtc->lut_b[i] << 0));
-		}
+	WREG8(RADEON_PALETTE_INDEX, 0);
+	for (i = 0; i < 256; i++) {
+		WREG32(RADEON_PALETTE_30_DATA,
+			 (radeon_crtc->lut_r[i] << 20) |
+			 (radeon_crtc->lut_g[i] << 10) |
+			 (radeon_crtc->lut_b[i] << 0));
 	}
 }
 



CVS commit: src/sys/external/bsd/drm2/radeon

2019-01-26 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Sun Jan 27 05:05:37 UTC 2019

Modified Files:
src/sys/external/bsd/drm2/radeon: files.radeon

Log Message:
Fix merge botch


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/external/bsd/drm2/radeon/files.radeon

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/radeon/files.radeon
diff -u src/sys/external/bsd/drm2/radeon/files.radeon:1.23 src/sys/external/bsd/drm2/radeon/files.radeon:1.24
--- src/sys/external/bsd/drm2/radeon/files.radeon:1.23	Sun Jan 27 02:08:43 2019
+++ src/sys/external/bsd/drm2/radeon/files.radeon	Sun Jan 27 05:05:37 2019
@@ -1,6 +1,4 @@
-#	$NetBSD: files.radeon,v 1.23 2019/01/27 02:08:43 pgoyette Exp $
-
-version	20180827
+#	$NetBSD: files.radeon,v 1.24 2019/01/27 05:05:37 kre Exp $
 
 version	20180827
 



CVS commit: src/sys/external/bsd/drm2/nouveau

2019-01-26 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Sun Jan 27 05:03:57 UTC 2019

Modified Files:
src/sys/external/bsd/drm2/nouveau: files.nouveau

Log Message:
Fix merge botch


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/external/bsd/drm2/nouveau/files.nouveau

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/nouveau/files.nouveau
diff -u src/sys/external/bsd/drm2/nouveau/files.nouveau:1.24 src/sys/external/bsd/drm2/nouveau/files.nouveau:1.25
--- src/sys/external/bsd/drm2/nouveau/files.nouveau:1.24	Sun Jan 27 02:08:43 2019
+++ src/sys/external/bsd/drm2/nouveau/files.nouveau	Sun Jan 27 05:03:57 2019
@@ -1,6 +1,4 @@
-#	$NetBSD: files.nouveau,v 1.24 2019/01/27 02:08:43 pgoyette Exp $
-
-version	20180827
+#	$NetBSD: files.nouveau,v 1.25 2019/01/27 05:03:57 kre Exp $
 
 version	20180827
 



CVS commit: src/sys/external/bsd/drm2/i915drm

2019-01-26 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Sun Jan 27 05:00:48 UTC 2019

Modified Files:
src/sys/external/bsd/drm2/i915drm: files.i915drmkms

Log Message:
Fix merge botch.


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/sys/external/bsd/drm2/i915drm/files.i915drmkms

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/i915drm/files.i915drmkms
diff -u src/sys/external/bsd/drm2/i915drm/files.i915drmkms:1.35 src/sys/external/bsd/drm2/i915drm/files.i915drmkms:1.36
--- src/sys/external/bsd/drm2/i915drm/files.i915drmkms:1.35	Sun Jan 27 02:08:42 2019
+++ src/sys/external/bsd/drm2/i915drm/files.i915drmkms	Sun Jan 27 05:00:48 2019
@@ -1,6 +1,4 @@
-#	$NetBSD: files.i915drmkms,v 1.35 2019/01/27 02:08:42 pgoyette Exp $
-
-version	20180827
+#	$NetBSD: files.i915drmkms,v 1.36 2019/01/27 05:00:48 kre Exp $
 
 version	20180827
 



CVS commit: src/sys/external/bsd/drm2/drm

2019-01-23 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Wed Jan 23 19:02:49 UTC 2019

Modified Files:
src/sys/external/bsd/drm2/drm: drm_cache.c

Log Message:
skip clflush on aarch64, too


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/external/bsd/drm2/drm/drm_cache.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/drm/drm_cache.c
diff -u src/sys/external/bsd/drm2/drm/drm_cache.c:1.12 src/sys/external/bsd/drm2/drm/drm_cache.c:1.13
--- src/sys/external/bsd/drm2/drm/drm_cache.c:1.12	Mon Aug 27 15:29:19 2018
+++ src/sys/external/bsd/drm2/drm/drm_cache.c	Wed Jan 23 19:02:49 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: drm_cache.c,v 1.12 2018/08/27 15:29:19 riastradh Exp $	*/
+/*	$NetBSD: drm_cache.c,v 1.13 2019/01/23 19:02:49 jmcneill Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: drm_cache.c,v 1.12 2018/08/27 15:29:19 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: drm_cache.c,v 1.13 2019/01/23 19:02:49 jmcneill Exp $");
 
 #include 
 #include 
@@ -42,7 +42,7 @@ __KERNEL_RCSID(0, "$NetBSD: drm_cache.c,
 
 #include 
 
-#if !defined(__arm__)
+#if !defined(__arm__) && !defined(__aarch64__)
 #define DRM_CLFLUSH	1
 #endif
 



CVS commit: src/sys/external/bsd/drm2/i915drm

2019-01-19 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Sat Jan 19 16:58:29 UTC 2019

Modified Files:
src/sys/external/bsd/drm2/i915drm: files.i915drmkms

Log Message:
i915drmkms requires firmload. PR 53892


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sys/external/bsd/drm2/i915drm/files.i915drmkms

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/i915drm/files.i915drmkms
diff -u src/sys/external/bsd/drm2/i915drm/files.i915drmkms:1.33 src/sys/external/bsd/drm2/i915drm/files.i915drmkms:1.34
--- src/sys/external/bsd/drm2/i915drm/files.i915drmkms:1.33	Fri Sep 21 11:27:13 2018
+++ src/sys/external/bsd/drm2/i915drm/files.i915drmkms	Sat Jan 19 16:58:29 2019
@@ -1,9 +1,9 @@
-#	$NetBSD: files.i915drmkms,v 1.33 2018/09/21 11:27:13 kamil Exp $
+#	$NetBSD: files.i915drmkms,v 1.34 2019/01/19 16:58:29 dholland Exp $
 
 version	20180827
 
 define	intelfbbus	{ }
-device	i915drmkms: drmkms, drmkms_pci, intelfbbus, agp_i810
+device	i915drmkms: drmkms, drmkms_pci, intelfbbus, agp_i810, firmload
 attach	i915drmkms at pci
 
 device	intelfb: intelfbbus, drmfb, drmfb_pci, wsemuldisplaydev



CVS commit: src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/core

2019-01-07 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Tue Jan  8 05:57:34 UTC 2019

Modified Files:
src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/core:
nouveau_nvkm_core_option.c

Log Message:
revert this commit:

>date: 2018-08-27 07:19:47 -0700;  author: riastradh;  state: Exp;  lines: +2 
>-0;  commitid: 9o7sY7hwNGx6zLPA;
>For now, unconditionally set nouveau verbosity to debug.

nouveau works mostly again now, and the debug output is very verbose.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 \

src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/core/nouveau_nvkm_core_option.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/core/nouveau_nvkm_core_option.c
diff -u src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/core/nouveau_nvkm_core_option.c:1.3 src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/core/nouveau_nvkm_core_option.c:1.4
--- src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/core/nouveau_nvkm_core_option.c:1.3	Mon Aug 27 14:19:47 2018
+++ src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/core/nouveau_nvkm_core_option.c	Tue Jan  8 05:57:34 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: nouveau_nvkm_core_option.c,v 1.3 2018/08/27 14:19:47 riastradh Exp $	*/
+/*	$NetBSD: nouveau_nvkm_core_option.c,v 1.4 2019/01/08 05:57:34 mrg Exp $	*/
 
 /*
  * Copyright 2012 Red Hat Inc.
@@ -24,7 +24,7 @@
  * Authors: Ben Skeggs
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: nouveau_nvkm_core_option.c,v 1.3 2018/08/27 14:19:47 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nouveau_nvkm_core_option.c,v 1.4 2019/01/08 05:57:34 mrg Exp $");
 
 #include 
 #include 
@@ -101,8 +101,6 @@ nvkm_dbgopt(const char *optstr, const ch
 {
 	int mode = 1, level = CONFIG_NOUVEAU_DEBUG_DEFAULT;
 
-	return NV_DBG_DEBUG;
-
 	while (optstr) {
 		int len = strcspn(optstr, ",=");
 		switch (optstr[len]) {



  1   2   3   4   5   6   7   8   9   10   >