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 Initialize mchdev_lock e...



details:   https://anonhg.NetBSD.org/src/rev/9968b8e7f938
branches:  trunk
changeset: 336303:9968b8e7f938
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Wed Feb 25 13:06:13 2015 +0000

description:
Initialize mchdev_lock earlier.  Fixes i915drmkms boot on Ironlake.

Derived from a patch sent to me by degroote@ longer ago than I care
to admit.

diffstat:

 sys/external/bsd/drm2/dist/drm/i915/i915_dma.c |   6 ++++++
 sys/external/bsd/drm2/dist/drm/i915/intel_pm.c |  17 -----------------
 2 files changed, 6 insertions(+), 17 deletions(-)

diffs (67 lines):

diff -r 354e3f989d18 -r 9968b8e7f938 sys/external/bsd/drm2/dist/drm/i915/i915_dma.c
--- a/sys/external/bsd/drm2/dist/drm/i915/i915_dma.c    Wed Feb 25 12:45:34 2015 +0000
+++ b/sys/external/bsd/drm2/dist/drm/i915/i915_dma.c    Wed Feb 25 13:06:13 2015 +0000
@@ -1650,6 +1650,10 @@
        mutex_init(&dev_priv->modeset_restore_lock);
 #endif
 
+#ifdef __NetBSD__
+       spin_lock_init(&mchdev_lock);
+#endif
+
        intel_pm_setup(dev);
 
        intel_display_crc_init(dev);
@@ -1865,6 +1869,7 @@
        if (dev_priv->slab)
                kmem_cache_destroy(dev_priv->slab);
 #ifdef __NetBSD__
+       spin_lock_destroy(&mchdev_lock);
        linux_mutex_destroy(&dev_priv->modeset_restore_lock);
        linux_mutex_destroy(&dev_priv->dpio_lock);
        spin_lock_destroy(&dev_priv->mm.object_stat_lock);
@@ -1985,6 +1990,7 @@
        DRM_DESTROY_WAITQUEUE(&dev_priv->pending_flip_queue);
        spin_lock_destroy(&dev_priv->pending_flip_lock);
        DRM_DESTROY_WAITQUEUE(&dev_priv->gpu_error.reset_queue);
+       spin_lock_destroy(&mchdev_lock);
        linux_mutex_destroy(&dev_priv->modeset_restore_lock);
        linux_mutex_destroy(&dev_priv->dpio_lock);
        spin_lock_destroy(&dev_priv->mm.object_stat_lock);
diff -r 354e3f989d18 -r 9968b8e7f938 sys/external/bsd/drm2/dist/drm/i915/intel_pm.c
--- a/sys/external/bsd/drm2/dist/drm/i915/intel_pm.c    Wed Feb 25 12:45:34 2015 +0000
+++ b/sys/external/bsd/drm2/dist/drm/i915/intel_pm.c    Wed Feb 25 13:06:13 2015 +0000
@@ -4426,14 +4426,6 @@
 
 void intel_gpu_ips_init(struct drm_i915_private *dev_priv)
 {
-#ifdef __NetBSD__              /* XXX */
-       /*
-        * This seems as good a place as any to initialize mchdev_lock.
-        * Taking the lock in the rest of this routine is silly, but...
-        */
-       spin_lock_init(&mchdev_lock);
-#endif
-
        /* We only register the i915 ips part with intel-ips once everything is
         * set up, to avoid intel-ips sneaking in and reading bogus values. */
        spin_lock_irq(&mchdev_lock);
@@ -4445,18 +4437,9 @@
 
 void intel_gpu_ips_teardown(void)
 {
-#ifdef __NetBSD__
-       if (i915_mch_dev == NULL)
-               return;
-#endif
-
        spin_lock_irq(&mchdev_lock);
        i915_mch_dev = NULL;
        spin_unlock_irq(&mchdev_lock);
-
-#ifdef __NetBSD__
-       spin_lock_destroy(&mchdev_lock);
-#endif
 }
 
 static void intel_init_emon(struct drm_device *dev)



Home | Main Index | Thread Index | Old Index