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/dist/drm/i915 Horrible kludgey mutex_i...



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

description:
Horrible kludgey mutex_is_locked_by that should work here.

diffstat:

 sys/external/bsd/drm2/dist/drm/i915/i915_gem_shrinker.c |  15 +++++++++++++--
 1 files changed, 13 insertions(+), 2 deletions(-)

diffs (43 lines):

diff -r 8a6a11a1c60d -r df731f394a0a sys/external/bsd/drm2/dist/drm/i915/i915_gem_shrinker.c
--- a/sys/external/bsd/drm2/dist/drm/i915/i915_gem_shrinker.c   Mon Aug 27 07:18:18 2018 +0000
+++ b/sys/external/bsd/drm2/dist/drm/i915/i915_gem_shrinker.c   Mon Aug 27 07:18:28 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: i915_gem_shrinker.c,v 1.2 2018/08/27 04:58:23 riastradh Exp $  */
+/*     $NetBSD: i915_gem_shrinker.c,v 1.3 2018/08/27 07:18:28 riastradh Exp $  */
 
 /*
  * Copyright © 2008-2015 Intel Corporation
@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: i915_gem_shrinker.c,v 1.2 2018/08/27 04:58:23 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i915_gem_shrinker.c,v 1.3 2018/08/27 07:18:28 riastradh Exp $");
 
 #include <linux/oom.h>
 #include <linux/shmem_fs.h>
@@ -39,6 +39,16 @@
 #include "i915_drv.h"
 #include "i915_trace.h"
 
+#ifdef __NetBSD__
+/* XXX argh argh argh argh argh argh argh argh */
+static bool mutex_is_locked_by(struct mutex *mutex, struct proc *proc)
+{
+
+       KASSERT(proc == curproc);
+       /* Actually answers `do we own mutex?'.  */
+       return mutex_is_locked(mutex);
+}
+#else
 static bool mutex_is_locked_by(struct mutex *mutex, struct task_struct *task)
 {
        if (!mutex_is_locked(mutex))
@@ -51,6 +61,7 @@
        return false;
 #endif
 }
+#endif
 
 /**
  * i915_gem_shrink - Shrink buffer object caches



Home | Main Index | Thread Index | Old Index