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 i915: Lock outside #ifde...



details:   https://anonhg.NetBSD.org/src/rev/6c85f9fc99b8
branches:  trunk
changeset: 1028755:6c85f9fc99b8
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sun Dec 19 11:57:11 2021 +0000

description:
i915: Lock outside #ifdef NetBSD, not just unlock.

diffstat:

 sys/external/bsd/drm2/dist/drm/i915/i915_vma.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (36 lines):

diff -r 460bf508d02c -r 6c85f9fc99b8 sys/external/bsd/drm2/dist/drm/i915/i915_vma.c
--- a/sys/external/bsd/drm2/dist/drm/i915/i915_vma.c    Sun Dec 19 11:57:03 2021 +0000
+++ b/sys/external/bsd/drm2/dist/drm/i915/i915_vma.c    Sun Dec 19 11:57:11 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: i915_vma.c,v 1.7 2021/12/19 11:55:58 riastradh Exp $   */
+/*     $NetBSD: i915_vma.c,v 1.8 2021/12/19 11:57:11 riastradh Exp $   */
 
 /*
  * Copyright © 2016 Intel Corporation
@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: i915_vma.c,v 1.7 2021/12/19 11:55:58 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i915_vma.c,v 1.8 2021/12/19 11:57:11 riastradh Exp $");
 
 #include <linux/sched/mm.h>
 #include <drm/drm_gem.h>
@@ -229,6 +229,8 @@
                __set_bit(I915_VMA_GGTT_BIT, __i915_vma_flags(vma));
        }
 
+       spin_lock(&obj->vma.lock);
+
 #ifdef __NetBSD__
        __USE(rb);
        __USE(p);
@@ -236,8 +238,6 @@
        collision = rb_tree_insert_node(&obj->vma.tree.rbr_tree, vma);
        KASSERT(collision == vma);
 #else
-       spin_lock(&obj->vma.lock);
-
        rb = NULL;
        p = &obj->vma.tree.rb_node;
        while (*p) {



Home | Main Index | Thread Index | Old Index