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 Fix definition and initialization of m...



details:   https://anonhg.NetBSD.org/src/rev/5245045c0dde
branches:  trunk
changeset: 365977:5245045c0dde
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Mon Aug 27 07:27:51 2018 +0000

description:
Fix definition and initialization of mchdev_lock.

diffstat:

 sys/external/bsd/drm2/dist/drm/i915/intel_pm.c |  8 ++++++--
 sys/external/bsd/drm2/i915drm/i915_module.c    |  8 +++++---
 2 files changed, 11 insertions(+), 5 deletions(-)

diffs (67 lines):

diff -r 9148915a4af6 -r 5245045c0dde sys/external/bsd/drm2/dist/drm/i915/intel_pm.c
--- a/sys/external/bsd/drm2/dist/drm/i915/intel_pm.c    Mon Aug 27 07:27:38 2018 +0000
+++ b/sys/external/bsd/drm2/dist/drm/i915/intel_pm.c    Mon Aug 27 07:27:51 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: intel_pm.c,v 1.12 2018/08/27 07:26:59 riastradh Exp $  */
+/*     $NetBSD: intel_pm.c,v 1.13 2018/08/27 07:27:51 riastradh Exp $  */
 
 /*
  * Copyright © 2012 Intel Corporation
@@ -28,7 +28,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: intel_pm.c,v 1.12 2018/08/27 07:26:59 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: intel_pm.c,v 1.13 2018/08/27 07:27:51 riastradh Exp $");
 
 #include <linux/bitops.h>
 #include <linux/cpufreq.h>
@@ -4174,7 +4174,11 @@
 /**
  * Lock protecting IPS related data structures
  */
+#ifdef __NetBSD__
+spinlock_t mchdev_lock;
+#else
 DEFINE_SPINLOCK(mchdev_lock);
+#endif
 
 /* Global for IPS driver to get at the current i915 device. Protected by
  * mchdev_lock. */
diff -r 9148915a4af6 -r 5245045c0dde sys/external/bsd/drm2/i915drm/i915_module.c
--- a/sys/external/bsd/drm2/i915drm/i915_module.c       Mon Aug 27 07:27:38 2018 +0000
+++ b/sys/external/bsd/drm2/i915drm/i915_module.c       Mon Aug 27 07:27:51 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: i915_module.c,v 1.5 2014/11/12 03:14:00 christos Exp $ */
+/*     $NetBSD: i915_module.c,v 1.6 2018/08/27 07:27:51 riastradh Exp $        */
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: i915_module.c,v 1.5 2014/11/12 03:14:00 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i915_module.c,v 1.6 2018/08/27 07:27:51 riastradh Exp $");
 
 #include <sys/types.h>
 #include <sys/module.h>
@@ -78,6 +78,7 @@
                return error;
        }
        drm_sysctl_init(&i915_def);
+       spin_lock_init(&mchdev_lock);
 
        return 0;
 }
@@ -99,8 +100,9 @@
 i915drmkms_fini(void)
 {
 
+       spin_lock_destroy(&mchdev_lock);
+       drm_sysctl_fini(&i915_def);
        drm_pci_exit(i915_drm_driver, NULL);
-       drm_sysctl_fini(&i915_def);
 }
 
 static int



Home | Main Index | Thread Index | Old Index