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/scheduler drm/scheduler: spin...



details:   https://anonhg.NetBSD.org/src/rev/e75e66cbd9c7
branches:  trunk
changeset: 1028942:e75e66cbd9c7
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sun Dec 19 12:32:45 2021 +0000

description:
drm/scheduler: spin_lock_init/destroy audit

diffstat:

 sys/external/bsd/drm2/dist/drm/scheduler/sched_fence.c |   6 ++++--
 sys/external/bsd/drm2/dist/drm/scheduler/sched_main.c  |  13 +++++++++++--
 2 files changed, 15 insertions(+), 4 deletions(-)

diffs (60 lines):

diff -r a6ba74a138a7 -r e75e66cbd9c7 sys/external/bsd/drm2/dist/drm/scheduler/sched_fence.c
--- a/sys/external/bsd/drm2/dist/drm/scheduler/sched_fence.c    Sun Dec 19 12:32:15 2021 +0000
+++ b/sys/external/bsd/drm2/dist/drm/scheduler/sched_fence.c    Sun Dec 19 12:32:45 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sched_fence.c,v 1.4 2021/12/19 12:24:12 riastradh Exp $        */
+/*     $NetBSD: sched_fence.c,v 1.5 2021/12/19 12:32:45 riastradh Exp $        */
 
 /*
  * Copyright 2015 Advanced Micro Devices, Inc.
@@ -24,7 +24,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sched_fence.c,v 1.4 2021/12/19 12:24:12 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sched_fence.c,v 1.5 2021/12/19 12:32:45 riastradh Exp $");
 
 #include <linux/kthread.h>
 #include <linux/module.h>
@@ -105,6 +105,8 @@
        struct dma_fence *f = container_of(rcu, struct dma_fence, rcu);
        struct drm_sched_fence *fence = to_drm_sched_fence(f);
 
+       spin_lock_destroy(&fence->lock);
+
        kmem_cache_free(sched_fence_slab, fence);
 }
 
diff -r a6ba74a138a7 -r e75e66cbd9c7 sys/external/bsd/drm2/dist/drm/scheduler/sched_main.c
--- a/sys/external/bsd/drm2/dist/drm/scheduler/sched_main.c     Sun Dec 19 12:32:15 2021 +0000
+++ b/sys/external/bsd/drm2/dist/drm/scheduler/sched_main.c     Sun Dec 19 12:32:45 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sched_main.c,v 1.4 2021/12/19 12:29:55 riastradh Exp $ */
+/*     $NetBSD: sched_main.c,v 1.5 2021/12/19 12:32:45 riastradh Exp $ */
 
 /*
  * Copyright 2015 Advanced Micro Devices, Inc.
@@ -47,7 +47,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sched_main.c,v 1.4 2021/12/19 12:29:55 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sched_main.c,v 1.5 2021/12/19 12:32:45 riastradh Exp $");
 
 #include <linux/kthread.h>
 #include <linux/wait.h>
@@ -883,5 +883,14 @@
        }
 
        sched->ready = false;
+
+       spin_lock_destroy(&sched->job_list_lock);
+       DRM_DESTROY_WAITQUEUE(&sched->job_scheduled);
+       DRM_DESTROY_WAITQUEUE(&sched->wake_up_worker);
+
+       for (int i = DRM_SCHED_PRIORITY_MIN; i < DRM_SCHED_PRIORITY_MAX; i++) {
+               struct drm_sched_rq *rq = &sched->sched_rq[i];
+               spin_lock_destroy(&rq->lock);
+       }
 }
 EXPORT_SYMBOL(drm_sched_fini);



Home | Main Index | Thread Index | Old Index