| @@ -1,23 +1,23 @@ | | | @@ -1,23 +1,23 @@ |
1 | /* $NetBSD: i915_active.c,v 1.9 2021/12/19 12:12:39 riastradh Exp $ */ | | 1 | /* $NetBSD: i915_active.c,v 1.10 2021/12/24 00:14:03 riastradh Exp $ */ |
2 | | | 2 | |
3 | /* | | 3 | /* |
4 | * SPDX-License-Identifier: MIT | | 4 | * SPDX-License-Identifier: MIT |
5 | * | | 5 | * |
6 | * Copyright © 2019 Intel Corporation | | 6 | * Copyright © 2019 Intel Corporation |
7 | */ | | 7 | */ |
8 | | | 8 | |
9 | #include <sys/cdefs.h> | | 9 | #include <sys/cdefs.h> |
10 | __KERNEL_RCSID(0, "$NetBSD: i915_active.c,v 1.9 2021/12/19 12:12:39 riastradh Exp $"); | | 10 | __KERNEL_RCSID(0, "$NetBSD: i915_active.c,v 1.10 2021/12/24 00:14:03 riastradh Exp $"); |
11 | | | 11 | |
12 | #include <linux/debugobjects.h> | | 12 | #include <linux/debugobjects.h> |
13 | | | 13 | |
14 | #include "gt/intel_context.h" | | 14 | #include "gt/intel_context.h" |
15 | #include "gt/intel_engine_pm.h" | | 15 | #include "gt/intel_engine_pm.h" |
16 | #include "gt/intel_ring.h" | | 16 | #include "gt/intel_ring.h" |
17 | | | 17 | |
18 | #include "i915_drv.h" | | 18 | #include "i915_drv.h" |
19 | #include "i915_active.h" | | 19 | #include "i915_active.h" |
20 | #include "i915_globals.h" | | 20 | #include "i915_globals.h" |
21 | | | 21 | |
22 | #include <linux/nbsd-namespace.h> | | 22 | #include <linux/nbsd-namespace.h> |
23 | | | 23 | |
| @@ -290,26 +290,27 @@ active_instance(struct i915_active *ref, | | | @@ -290,26 +290,27 @@ active_instance(struct i915_active *ref, |
290 | if (!prealloc) | | 290 | if (!prealloc) |
291 | return NULL; | | 291 | return NULL; |
292 | memset(prealloc, 0, sizeof(*prealloc)); | | 292 | memset(prealloc, 0, sizeof(*prealloc)); |
293 | | | 293 | |
294 | spin_lock_irq(&ref->tree_lock); | | 294 | spin_lock_irq(&ref->tree_lock); |
295 | GEM_BUG_ON(i915_active_is_idle(ref)); | | 295 | GEM_BUG_ON(i915_active_is_idle(ref)); |
296 | | | 296 | |
297 | #ifdef __NetBSD__ | | 297 | #ifdef __NetBSD__ |
298 | __USE(parent); | | 298 | __USE(parent); |
299 | __USE(p); | | 299 | __USE(p); |
300 | node = rb_tree_find_node(&ref->tree.rbr_tree, &idx); | | 300 | node = rb_tree_find_node(&ref->tree.rbr_tree, &idx); |
301 | if (node) { | | 301 | if (node) { |
302 | KASSERT(node->timeline == idx); | | 302 | KASSERT(node->timeline == idx); |
| | | 303 | kmem_cache_free(global.slab_cache, prealloc); |
303 | goto out; | | 304 | goto out; |
304 | } | | 305 | } |
305 | #else | | 306 | #else |
306 | parent = NULL; | | 307 | parent = NULL; |
307 | p = &ref->tree.rb_node; | | 308 | p = &ref->tree.rb_node; |
308 | while (*p) { | | 309 | while (*p) { |
309 | parent = *p; | | 310 | parent = *p; |
310 | | | 311 | |
311 | node = rb_entry(parent, struct active_node, node); | | 312 | node = rb_entry(parent, struct active_node, node); |
312 | if (node->timeline == idx) { | | 313 | if (node->timeline == idx) { |
313 | kmem_cache_free(global.slab_cache, prealloc); | | 314 | kmem_cache_free(global.slab_cache, prealloc); |
314 | goto out; | | 315 | goto out; |
315 | } | | 316 | } |