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/gt i915: Destroy page di...



details:   https://anonhg.NetBSD.org/src/rev/b98f00b6d1f2
branches:  trunk
changeset: 1028816:b98f00b6d1f2
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sun Dec 19 12:07:47 2021 +0000

description:
i915: Destroy page directory spin locks.

diffstat:

 sys/external/bsd/drm2/dist/drm/i915/gt/gen6_ppgtt.c  |   6 ++++--
 sys/external/bsd/drm2/dist/drm/i915/gt/gen8_ppgtt.c  |  14 +++++++++++---
 sys/external/bsd/drm2/dist/drm/i915/gt/intel_ppgtt.c |   5 +++--
 3 files changed, 18 insertions(+), 7 deletions(-)

diffs (103 lines):

diff -r dc3e73810da1 -r b98f00b6d1f2 sys/external/bsd/drm2/dist/drm/i915/gt/gen6_ppgtt.c
--- a/sys/external/bsd/drm2/dist/drm/i915/gt/gen6_ppgtt.c       Sun Dec 19 12:07:38 2021 +0000
+++ b/sys/external/bsd/drm2/dist/drm/i915/gt/gen6_ppgtt.c       Sun Dec 19 12:07:47 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: gen6_ppgtt.c,v 1.5 2021/12/19 11:16:08 riastradh Exp $ */
+/*     $NetBSD: gen6_ppgtt.c,v 1.6 2021/12/19 12:07:47 riastradh Exp $ */
 
 // SPDX-License-Identifier: MIT
 /*
@@ -6,7 +6,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: gen6_ppgtt.c,v 1.5 2021/12/19 11:16:08 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gen6_ppgtt.c,v 1.6 2021/12/19 12:07:47 riastradh Exp $");
 
 #include <linux/log2.h>
 
@@ -319,6 +319,7 @@
 
        mutex_destroy(&ppgtt->flush);
        mutex_destroy(&ppgtt->pin_mutex);
+       spin_lock_destroy(&ppgtt->base.pd->lock);
        kfree(ppgtt->base.pd);
 }
 
@@ -535,6 +536,7 @@
 err_scratch:
        free_scratch(&ppgtt->base.vm);
 err_pd:
+       spin_lock_destroy(&ppgtt->base.pd->lock);
        kfree(ppgtt->base.pd);
 err_free:
        mutex_destroy(&ppgtt->pin_mutex);
diff -r dc3e73810da1 -r b98f00b6d1f2 sys/external/bsd/drm2/dist/drm/i915/gt/gen8_ppgtt.c
--- a/sys/external/bsd/drm2/dist/drm/i915/gt/gen8_ppgtt.c       Sun Dec 19 12:07:38 2021 +0000
+++ b/sys/external/bsd/drm2/dist/drm/i915/gt/gen8_ppgtt.c       Sun Dec 19 12:07:47 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: gen8_ppgtt.c,v 1.6 2021/12/19 11:15:41 riastradh Exp $ */
+/*     $NetBSD: gen8_ppgtt.c,v 1.7 2021/12/19 12:07:47 riastradh Exp $ */
 
 // SPDX-License-Identifier: MIT
 /*
@@ -6,7 +6,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: gen8_ppgtt.c,v 1.6 2021/12/19 11:15:41 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gen8_ppgtt.c,v 1.7 2021/12/19 12:07:47 riastradh Exp $");
 
 #include <linux/log2.h>
 
@@ -161,6 +161,7 @@
                } while (pde++, --count);
        }
 
+       spin_lock_destroy(&pd->lock);
        free_px(vm, pd);
 }
 
@@ -340,8 +341,15 @@
        } while (idx++, --len);
        spin_unlock(&pd->lock);
 out:
-       if (alloc)
+       if (alloc) {
+               if (lvl) {
+                       struct i915_page_directory *allocpd =
+                           container_of(alloc, struct i915_page_directory,
+                               pt);
+                       spin_lock_destroy(&allocpd->lock);
+               }
                free_px(vm, alloc);
+       }
        return ret;
 }
 
diff -r dc3e73810da1 -r b98f00b6d1f2 sys/external/bsd/drm2/dist/drm/i915/gt/intel_ppgtt.c
--- a/sys/external/bsd/drm2/dist/drm/i915/gt/intel_ppgtt.c      Sun Dec 19 12:07:38 2021 +0000
+++ b/sys/external/bsd/drm2/dist/drm/i915/gt/intel_ppgtt.c      Sun Dec 19 12:07:47 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: intel_ppgtt.c,v 1.3 2021/12/19 11:49:11 riastradh Exp $        */
+/*     $NetBSD: intel_ppgtt.c,v 1.4 2021/12/19 12:07:47 riastradh Exp $        */
 
 // SPDX-License-Identifier: MIT
 /*
@@ -6,7 +6,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: intel_ppgtt.c,v 1.3 2021/12/19 11:49:11 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: intel_ppgtt.c,v 1.4 2021/12/19 12:07:47 riastradh Exp $");
 
 #include <linux/slab.h>
 
@@ -53,6 +53,7 @@
                return ERR_PTR(-ENOMEM);
 
        if (unlikely(setup_page_dma(vm, px_base(pd)))) {
+               spin_lock_destroy(&pd->lock);
                kfree(pd);
                return ERR_PTR(-ENOMEM);
        }



Home | Main Index | Thread Index | Old Index