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/drm Declare and initialize drm_unplug_...



details:   https://anonhg.NetBSD.org/src/rev/20a26ebdb953
branches:  trunk
changeset: 1027857:20a26ebdb953
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sun Dec 19 00:58:30 2021 +0000

description:
Declare and initialize drm_unplug_srcu our way.

diffstat:

 sys/external/bsd/drm2/dist/drm/drm_drv.c      |  8 ++++++--
 sys/external/bsd/drm2/dist/drm/drm_internal.h |  4 +++-
 sys/external/bsd/drm2/drm/drm_module.c        |  6 ++++--
 3 files changed, 13 insertions(+), 5 deletions(-)

diffs (82 lines):

diff -r fc1610b81efb -r 20a26ebdb953 sys/external/bsd/drm2/dist/drm/drm_drv.c
--- a/sys/external/bsd/drm2/dist/drm/drm_drv.c  Sun Dec 19 00:58:22 2021 +0000
+++ b/sys/external/bsd/drm2/dist/drm/drm_drv.c  Sun Dec 19 00:58:30 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: drm_drv.c,v 1.16 2021/12/19 00:57:06 riastradh Exp $   */
+/*     $NetBSD: drm_drv.c,v 1.17 2021/12/19 00:58:30 riastradh Exp $   */
 
 /*
  * Created: Fri Jan 19 10:48:35 2001 by faith%acm.org@localhost
@@ -29,7 +29,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: drm_drv.c,v 1.16 2021/12/19 00:57:06 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: drm_drv.c,v 1.17 2021/12/19 00:58:30 riastradh Exp $");
 
 #include <linux/debugfs.h>
 #include <linux/fs.h>
@@ -67,7 +67,11 @@
 static struct dentry *drm_debugfs_root;
 #endif
 
+#ifdef __NetBSD__
+struct srcu drm_unplug_srcu;
+#else
 DEFINE_STATIC_SRCU(drm_unplug_srcu);
+#endif
 
 /*
  * DRM Minors
diff -r fc1610b81efb -r 20a26ebdb953 sys/external/bsd/drm2/dist/drm/drm_internal.h
--- a/sys/external/bsd/drm2/dist/drm/drm_internal.h     Sun Dec 19 00:58:22 2021 +0000
+++ b/sys/external/bsd/drm2/dist/drm/drm_internal.h     Sun Dec 19 00:58:30 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: drm_internal.h,v 1.7 2021/12/19 00:57:13 riastradh Exp $       */
+/*     $NetBSD: drm_internal.h,v 1.8 2021/12/19 00:58:30 riastradh Exp $       */
 
 /*
  * Copyright © 2014 Intel Corporation
@@ -90,6 +90,8 @@
 struct drm_minor *drm_minor_acquire(unsigned int minor_id);
 void drm_minor_release(struct drm_minor *minor);
 #ifdef __NetBSD__
+#include <linux/srcu.h>
+extern struct srcu drm_unplug_srcu;
 extern struct spinlock drm_minor_lock;
 extern struct idr drm_minors_idr;
 #endif
diff -r fc1610b81efb -r 20a26ebdb953 sys/external/bsd/drm2/drm/drm_module.c
--- a/sys/external/bsd/drm2/drm/drm_module.c    Sun Dec 19 00:58:22 2021 +0000
+++ b/sys/external/bsd/drm2/drm/drm_module.c    Sun Dec 19 00:58:30 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: drm_module.c,v 1.19 2021/12/19 00:55:26 riastradh Exp $        */
+/*     $NetBSD: drm_module.c,v 1.20 2021/12/19 00:58:31 riastradh Exp $        */
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: drm_module.c,v 1.19 2021/12/19 00:55:26 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: drm_module.c,v 1.20 2021/12/19 00:58:31 riastradh Exp $");
 
 #include <sys/types.h>
 #include <sys/condvar.h>
@@ -122,6 +122,7 @@
 
        spin_lock_init(&drm_minor_lock);
        idr_init(&drm_minors_idr);
+       srcu_init(&drm_unplug_srcu, "drmunplg");
        linux_mutex_init(&drm_global_mutex);
        drm_connector_ida_init();
        drm_global_init();
@@ -156,6 +157,7 @@
        drm_global_release();
        drm_connector_ida_destroy();
        linux_mutex_destroy(&drm_global_mutex);
+       srcu_fini(&drm_unplug_srcu);
        idr_destroy(&drm_minors_idr);
        spin_lock_destroy(&drm_minor_lock);
        drm_agp_hooks_fini();



Home | Main Index | Thread Index | Old Index