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/nouveau/nvkm/core nouveau: Ma...



details:   https://anonhg.NetBSD.org/src/rev/114e30cff470
branches:  trunk
changeset: 1028468:114e30cff470
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sun Dec 19 11:07:11 2021 +0000

description:
nouveau: Maintain object->on_tree.

diffstat:

 sys/external/bsd/drm2/dist/drm/nouveau/nvkm/core/nouveau_nvkm_core_object.c |  15 +++++++--
 1 files changed, 11 insertions(+), 4 deletions(-)

diffs (44 lines):

diff -r 3aaeb616067f -r 114e30cff470 sys/external/bsd/drm2/dist/drm/nouveau/nvkm/core/nouveau_nvkm_core_object.c
--- a/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/core/nouveau_nvkm_core_object.c       Sun Dec 19 11:07:04 2021 +0000
+++ b/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/core/nouveau_nvkm_core_object.c       Sun Dec 19 11:07:11 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: nouveau_nvkm_core_object.c,v 1.10 2021/12/19 11:06:19 riastradh Exp $  */
+/*     $NetBSD: nouveau_nvkm_core_object.c,v 1.11 2021/12/19 11:07:11 riastradh Exp $  */
 
 /*
  * Copyright 2012 Red Hat Inc.
@@ -24,7 +24,7 @@
  * Authors: Ben Skeggs
  */
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nouveau_nvkm_core_object.c,v 1.10 2021/12/19 11:06:19 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nouveau_nvkm_core_object.c,v 1.11 2021/12/19 11:07:11 riastradh Exp $");
 
 #include <core/object.h>
 #include <core/client.h>
@@ -69,8 +69,10 @@
 nvkm_object_remove(struct nvkm_object *object)
 {
 #ifdef __NetBSD__
-       if (object->on_tree)
+       if (object->on_tree) {
                rb_tree_remove_node(&object->client->objtree, object);
+               object->on_tree = false;
+       }
 #else
        if (!RB_EMPTY_NODE(&object->node))
                rb_erase(&object->node, &object->client->objroot);
@@ -83,7 +85,12 @@
 #ifdef __NetBSD__
        struct nvkm_object *collision =
            rb_tree_insert_node(&object->client->objtree, object);
-       return collision == object;
+
+       if (collision != object)
+               return false;   /* EEXIST */
+
+       object->on_tree = true;
+       return true;
 #else
        struct rb_node **ptr = &object->client->objroot.rb_node;
        struct rb_node *parent = NULL;



Home | Main Index | Thread Index | Old Index