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/ttm drm/ttm: Fix up ttm_bo_gl...



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

description:
drm/ttm: Fix up ttm_bo_global_release a bit.

diffstat:

 sys/external/bsd/drm2/dist/drm/ttm/ttm_bo.c |  19 +++++++++++--------
 1 files changed, 11 insertions(+), 8 deletions(-)

diffs (45 lines):

diff -r 51985f29273e -r 3aaeb616067f sys/external/bsd/drm2/dist/drm/ttm/ttm_bo.c
--- a/sys/external/bsd/drm2/dist/drm/ttm/ttm_bo.c       Sun Dec 19 11:06:54 2021 +0000
+++ b/sys/external/bsd/drm2/dist/drm/ttm/ttm_bo.c       Sun Dec 19 11:07:04 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ttm_bo.c,v 1.24 2021/12/19 09:57:33 riastradh Exp $    */
+/*     $NetBSD: ttm_bo.c,v 1.25 2021/12/19 11:07:04 riastradh Exp $    */
 
 /* SPDX-License-Identifier: GPL-2.0 OR MIT */
 /**************************************************************************
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ttm_bo.c,v 1.24 2021/12/19 09:57:33 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ttm_bo.c,v 1.25 2021/12/19 11:07:04 riastradh Exp $");
 
 #define pr_fmt(fmt) "[TTM] " fmt
 
@@ -1645,17 +1645,20 @@
        if (--ttm_bo_glob_use_count > 0)
                goto out;
 
-#ifdef __NetBSD__
-       BUG_ON(glob->dummy_read_page != NULL);
-       spin_lock_destroy(&glob->lru_lock);
-       mutex_destroy(&ttm_global_mutex);
-       kfree(glob);
-#else
+#ifndef __NetBSD__
        kobject_del(&glob->kobj);
        kobject_put(&glob->kobj);
 #endif
        ttm_mem_global_release(&ttm_mem_glob);
        memset(glob, 0, sizeof(*glob));
+#ifdef __NetBSD__
+       BUG_ON(glob->dummy_read_page != NULL);
+       spin_lock_destroy(&glob->lru_lock);
+       mutex_unlock(&ttm_global_mutex);
+       mutex_destroy(&ttm_global_mutex);
+       kfree(glob);
+       return;
+#endif
 out:
        mutex_unlock(&ttm_global_mutex);
 }



Home | Main Index | Thread Index | Old Index