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 i915: Flail harder to wo...



details:   https://anonhg.NetBSD.org/src/rev/bfd271740870
branches:  trunk
changeset: 1028760:bfd271740870
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sun Dec 19 11:57:54 2021 +0000

description:
i915: Flail harder to work around the bad thing that went wrong.

diffstat:

 sys/external/bsd/drm2/dist/drm/i915/i915_active.c |  22 ++++++++++++++--------
 1 files changed, 14 insertions(+), 8 deletions(-)

diffs (59 lines):

diff -r b6dba0345f9a -r bfd271740870 sys/external/bsd/drm2/dist/drm/i915/i915_active.c
--- a/sys/external/bsd/drm2/dist/drm/i915/i915_active.c Sun Dec 19 11:57:42 2021 +0000
+++ b/sys/external/bsd/drm2/dist/drm/i915/i915_active.c Sun Dec 19 11:57:54 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: i915_active.c,v 1.4 2021/12/19 11:52:07 riastradh Exp $        */
+/*     $NetBSD: i915_active.c,v 1.5 2021/12/19 11:57:54 riastradh Exp $        */
 
 /*
  * SPDX-License-Identifier: MIT
@@ -7,7 +7,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: i915_active.c,v 1.4 2021/12/19 11:52:07 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i915_active.c,v 1.5 2021/12/19 11:57:54 riastradh Exp $");
 
 #include <linux/debugobjects.h>
 
@@ -854,12 +854,14 @@
                smp_store_mb(*ll_to_fence_slot(node), &rq->fence);
 #ifdef __NetBSD__
                spin_unlock(&rq->lock);
-               struct i915_active_fence *fence =
+               struct i915_active_fence *active =
                    container_of(node, struct i915_active_fence, llist);
                /* XXX something bad went wrong in making this code */
-               KASSERT(fence->cb.func == node_retire);
-               (void)dma_fence_add_callback(fence->fence, &fence->cb,
-                   node_retire);
+               KASSERT(active->cb.func == node_retire ||
+                   active->cb.func == excl_retire ||
+                   active->cb.func == i915_active_noop);
+               (void)dma_fence_add_callback(active->fence, &active->cb,
+                   active->cb.func);
                spin_lock(&rq->lock);
 #else
                list_add_tail((struct list_head *)node, &rq->fence.cb_list);
@@ -917,7 +919,9 @@
        if (prev) {
                GEM_BUG_ON(prev == fence);
 #ifdef __NetBSD__
-               KASSERT(active->cb.func == node_retire);
+               KASSERT(active->cb.func == node_retire ||
+                   active->cb.func == excl_retire ||
+                   active->cb.func == i915_active_noop);
                (void)dma_fence_remove_callback(prev, &active->cb);
 #else
                spin_lock_nested(prev->lock, SINGLE_DEPTH_NESTING);
@@ -932,7 +936,9 @@
        spin_unlock_irqrestore(fence->lock, flags);
 
 #ifdef __NetBSD__
-       KASSERT(active->cb.func == node_retire);
+       KASSERT(active->cb.func == node_retire ||
+           active->cb.func == excl_retire ||
+           active->cb.func == i915_active_noop);
        dma_fence_add_callback(fence, &active->cb, node_retire);
 #endif
 



Home | Main Index | Thread Index | Old Index