Module Name:    src
Committed By:   riastradh
Date:           Mon Aug 27 07:18:18 UTC 2018

Modified Files:
        src/sys/external/bsd/drm2/dist/drm/i915: i915_dma.c
        src/sys/external/bsd/drm2/include/linux: notifier.h oom.h shrinker.h

Log Message:
Add some shrinker and oom notifier stubs.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/external/bsd/drm2/dist/drm/i915/i915_dma.c
cvs rdiff -u -r1.2 -r1.3 src/sys/external/bsd/drm2/include/linux/notifier.h
cvs rdiff -u -r1.1 -r1.2 src/sys/external/bsd/drm2/include/linux/oom.h
cvs rdiff -u -r1.3 -r1.4 src/sys/external/bsd/drm2/include/linux/shrinker.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_dma.c
diff -u src/sys/external/bsd/drm2/dist/drm/i915/i915_dma.c:1.21 src/sys/external/bsd/drm2/dist/drm/i915/i915_dma.c:1.22
--- src/sys/external/bsd/drm2/dist/drm/i915/i915_dma.c:1.21	Mon Aug 27 07:04:11 2018
+++ src/sys/external/bsd/drm2/dist/drm/i915/i915_dma.c	Mon Aug 27 07:18:18 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: i915_dma.c,v 1.21 2018/08/27 07:04:11 riastradh Exp $	*/
+/*	$NetBSD: i915_dma.c,v 1.22 2018/08/27 07:18:18 riastradh Exp $	*/
 
 /* i915_dma.c -- DMA support for the I915 -*- linux-c -*-
  */
@@ -29,7 +29,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: i915_dma.c,v 1.21 2018/08/27 07:04:11 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i915_dma.c,v 1.22 2018/08/27 07:18:18 riastradh Exp $");
 
 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
 
@@ -1145,9 +1145,7 @@ out_power_well:
 	intel_power_domains_fini(dev_priv);
 	drm_vblank_cleanup(dev);
 out_gem_unload:
-#ifndef __NetBSD__
 	WARN_ON(unregister_oom_notifier(&dev_priv->mm.oom_notifier));
-#endif
 	unregister_shrinker(&dev_priv->mm.shrinker);
 	/* XXX i915_gem_unload */
 #ifdef __NetBSD__
@@ -1231,9 +1229,7 @@ int i915_driver_unload(struct drm_device
 
 	i915_teardown_sysfs(dev);
 
-#ifndef __NetBSD__
 	WARN_ON(unregister_oom_notifier(&dev_priv->mm.oom_notifier));
-#endif
 	unregister_shrinker(&dev_priv->mm.shrinker);
 
 	io_mapping_free(dev_priv->gtt.mappable);

Index: src/sys/external/bsd/drm2/include/linux/notifier.h
diff -u src/sys/external/bsd/drm2/include/linux/notifier.h:1.2 src/sys/external/bsd/drm2/include/linux/notifier.h:1.3
--- src/sys/external/bsd/drm2/include/linux/notifier.h:1.2	Tue Mar 18 18:20:43 2014
+++ src/sys/external/bsd/drm2/include/linux/notifier.h	Mon Aug 27 07:18:18 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: notifier.h,v 1.2 2014/03/18 18:20:43 riastradh Exp $	*/
+/*	$NetBSD: notifier.h,v 1.3 2018/08/27 07:18:18 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -34,7 +34,8 @@
 
 #include <sys/cdefs.h>
 
-#define	NOTIFY_OK	0
+#define	NOTIFY_DONE	0
+#define	NOTIFY_OK	1
 
 struct notifier_block {
 	int	(*notifier_call)(struct notifier_block *, unsigned long,

Index: src/sys/external/bsd/drm2/include/linux/oom.h
diff -u src/sys/external/bsd/drm2/include/linux/oom.h:1.1 src/sys/external/bsd/drm2/include/linux/oom.h:1.2
--- src/sys/external/bsd/drm2/include/linux/oom.h:1.1	Mon Aug 27 05:50:06 2018
+++ src/sys/external/bsd/drm2/include/linux/oom.h	Mon Aug 27 07:18:18 2018
@@ -0,0 +1,49 @@
+/*	$NetBSD: oom.h,v 1.2 2018/08/27 07:18:18 riastradh Exp $	*/
+
+/*-
+ * Copyright (c) 2018 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Taylor R. Campbell.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef	_LINUX_OOM_H_
+#define	_LINUX_OOM_H_
+
+#include <linux/notifier.h>
+
+static inline int
+register_oom_notifier(struct notifier_block *block)
+{
+	return 0;
+}
+
+static inline int
+unregister_oom_notifier(struct notifier_block *block)
+{
+	return 0;
+}
+
+#endif	/* _LINUX_OOM_H_ */

Index: src/sys/external/bsd/drm2/include/linux/shrinker.h
diff -u src/sys/external/bsd/drm2/include/linux/shrinker.h:1.3 src/sys/external/bsd/drm2/include/linux/shrinker.h:1.4
--- src/sys/external/bsd/drm2/include/linux/shrinker.h:1.3	Wed Jul 16 20:56:25 2014
+++ src/sys/external/bsd/drm2/include/linux/shrinker.h	Mon Aug 27 07:18:18 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: shrinker.h,v 1.3 2014/07/16 20:56:25 riastradh Exp $	*/
+/*	$NetBSD: shrinker.h,v 1.4 2018/08/27 07:18:18 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -45,6 +45,8 @@ struct shrinker {
 	int		seeks;
 };
 
+#define	SHRINK_STOP	(~0UL)
+
 #define	DEFAULT_SEEKS	2	/* XXX cargo-culted from Linux */
 
 static inline void

Reply via email to