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/i915drm i915: Initialize userptr wq fo...



details:   https://anonhg.NetBSD.org/src/rev/403327921a65
branches:  trunk
changeset: 1028837:403327921a65
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sun Dec 19 12:10:34 2021 +0000

description:
i915: Initialize userptr wq for now.  Should wire this up for real!

diffstat:

 sys/external/bsd/drm2/i915drm/i915_gem_userptr.c |  27 ++++++++++++++++++++---
 1 files changed, 23 insertions(+), 4 deletions(-)

diffs (52 lines):

diff -r 7d30db1e99e6 -r 403327921a65 sys/external/bsd/drm2/i915drm/i915_gem_userptr.c
--- a/sys/external/bsd/drm2/i915drm/i915_gem_userptr.c  Sun Dec 19 12:10:27 2021 +0000
+++ b/sys/external/bsd/drm2/i915drm/i915_gem_userptr.c  Sun Dec 19 12:10:34 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: i915_gem_userptr.c,v 1.4 2021/12/19 11:33:49 riastradh Exp $   */
+/*     $NetBSD: i915_gem_userptr.c,v 1.5 2021/12/19 12:10:34 riastradh Exp $   */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -30,20 +30,39 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: i915_gem_userptr.c,v 1.4 2021/12/19 11:33:49 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i915_gem_userptr.c,v 1.5 2021/12/19 12:10:34 riastradh Exp $");
 
 #include "i915_drv.h"
 #include "../dist/drm/i915/gem/i915_gem_ioctls.h"
 
+#include <linux/nbsd-namespace.h>
+
+/*
+ * XXX this file is dumb and maybe shouldn't exist; it exists because
+ * riastradh is a lazybones
+ */
+
 int
-i915_gem_init_userptr(struct drm_i915_private *i915)
+i915_gem_init_userptr(struct drm_i915_private *dev_priv)
 {
+       mutex_init(&dev_priv->mm_lock);
+       hash_init(dev_priv->mm_structs);
+
+       dev_priv->mm.userptr_wq =
+               alloc_workqueue("i915-userptr-acquire",
+                               WQ_HIGHPRI | WQ_UNBOUND,
+                               0);
+       if (!dev_priv->mm.userptr_wq)
+               return -ENOMEM;
+
        return 0;
 }
 
 void
-i915_gem_cleanup_userptr(struct drm_i915_private *i915)
+i915_gem_cleanup_userptr(struct drm_i915_private *dev_priv)
 {
+       destroy_workqueue(dev_priv->mm.userptr_wq);
+       mutex_destroy(&dev_priv->mm_lock);
 }
 
 int



Home | Main Index | Thread Index | Old Index