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/gem drm/i915: Need a sep...



details:   https://anonhg.NetBSD.org/src/rev/1d246955c2f9
branches:  trunk
changeset: 1028618:1d246955c2f9
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sun Dec 19 11:30:56 2021 +0000

description:
drm/i915: Need a separate spin lock for i915 stub_fence.

Nothing built-in to the dma fence wait queue that we can abuse here.

diffstat:

 sys/external/bsd/drm2/dist/drm/i915/gem/i915_gem_fence.c |  9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diffs (43 lines):

diff -r f0e9d661d88a -r 1d246955c2f9 sys/external/bsd/drm2/dist/drm/i915/gem/i915_gem_fence.c
--- a/sys/external/bsd/drm2/dist/drm/i915/gem/i915_gem_fence.c  Sun Dec 19 11:30:45 2021 +0000
+++ b/sys/external/bsd/drm2/dist/drm/i915/gem/i915_gem_fence.c  Sun Dec 19 11:30:56 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: i915_gem_fence.c,v 1.2 2021/12/18 23:45:30 riastradh Exp $     */
+/*     $NetBSD: i915_gem_fence.c,v 1.3 2021/12/19 11:30:56 riastradh Exp $     */
 
 /*
  * SPDX-License-Identifier: MIT
@@ -7,13 +7,14 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: i915_gem_fence.c,v 1.2 2021/12/18 23:45:30 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i915_gem_fence.c,v 1.3 2021/12/19 11:30:56 riastradh Exp $");
 
 #include "i915_drv.h"
 #include "i915_gem_object.h"
 
 struct stub_fence {
        struct dma_fence dma;
+       spinlock_t lock;
        struct i915_sw_fence chain;
 };
 
@@ -53,6 +54,7 @@
 
        BUILD_BUG_ON(offsetof(typeof(*stub), dma));
        dma_fence_free(&stub->dma);
+       spin_lock_destroy(&stub->lock);
 }
 
 static const struct dma_fence_ops stub_fence_ops = {
@@ -73,7 +75,8 @@
                return NULL;
 
        i915_sw_fence_init(&stub->chain, stub_notify);
-       dma_fence_init(&stub->dma, &stub_fence_ops, &stub->chain.wait.lock,
+       spin_lock_init(&stub->lock);
+       dma_fence_init(&stub->dma, &stub_fence_ops, &stub->lock,
                       0, 0);
 
        if (i915_sw_fence_await_reservation(&stub->chain,



Home | Main Index | Thread Index | Old Index