Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/external/bsd/drm2 Add some shrinker and oom notifier stubs.



details:   https://anonhg.NetBSD.org/src/rev/8a6a11a1c60d
branches:  trunk
changeset: 365928:8a6a11a1c60d
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Mon Aug 27 07:18:18 2018 +0000

description:
Add some shrinker and oom notifier stubs.

diffstat:

 sys/external/bsd/drm2/dist/drm/i915/i915_dma.c |   8 +---
 sys/external/bsd/drm2/include/linux/notifier.h |   5 +-
 sys/external/bsd/drm2/include/linux/oom.h      |  49 ++++++++++++++++++++++++++
 sys/external/bsd/drm2/include/linux/shrinker.h |   4 +-
 4 files changed, 57 insertions(+), 9 deletions(-)

diffs (128 lines):

diff -r a06c450af401 -r 8a6a11a1c60d sys/external/bsd/drm2/dist/drm/i915/i915_dma.c
--- a/sys/external/bsd/drm2/dist/drm/i915/i915_dma.c    Mon Aug 27 07:18:08 2018 +0000
+++ b/sys/external/bsd/drm2/dist/drm/i915/i915_dma.c    Mon Aug 27 07:18:18 2018 +0000
@@ -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 @@
        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 @@
 
        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);
diff -r a06c450af401 -r 8a6a11a1c60d sys/external/bsd/drm2/include/linux/notifier.h
--- a/sys/external/bsd/drm2/include/linux/notifier.h    Mon Aug 27 07:18:08 2018 +0000
+++ b/sys/external/bsd/drm2/include/linux/notifier.h    Mon Aug 27 07:18:18 2018 +0000
@@ -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,
diff -r a06c450af401 -r 8a6a11a1c60d sys/external/bsd/drm2/include/linux/oom.h
--- a/sys/external/bsd/drm2/include/linux/oom.h Mon Aug 27 07:18:08 2018 +0000
+++ b/sys/external/bsd/drm2/include/linux/oom.h Mon Aug 27 07:18:18 2018 +0000
@@ -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_ */
diff -r a06c450af401 -r 8a6a11a1c60d sys/external/bsd/drm2/include/linux/shrinker.h
--- a/sys/external/bsd/drm2/include/linux/shrinker.h    Mon Aug 27 07:18:08 2018 +0000
+++ b/sys/external/bsd/drm2/include/linux/shrinker.h    Mon Aug 27 07:18:18 2018 +0000
@@ -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 @@
        int             seeks;
 };
 
+#define        SHRINK_STOP     (~0UL)
+
 #define        DEFAULT_SEEKS   2       /* XXX cargo-culted from Linux */
 
 static inline void



Home | Main Index | Thread Index | Old Index