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: Remove waiter afte...



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

description:
i915: Remove waiter after done, not only after wakeup.

Might be done without any wakeup, in which case the waiter would
remain on the list (even as it becomes stack garbage!).

diffstat:

 sys/external/bsd/drm2/dist/drm/i915/display/intel_display.c |  10 ++++++----
 sys/external/bsd/drm2/dist/drm/i915/i915_sw_fence.c         |   7 +++----
 2 files changed, 9 insertions(+), 8 deletions(-)

diffs (73 lines):

diff -r b61b6e1defd2 -r a6f0cc2be25a sys/external/bsd/drm2/dist/drm/i915/display/intel_display.c
--- a/sys/external/bsd/drm2/dist/drm/i915/display/intel_display.c       Sun Dec 19 11:56:23 2021 +0000
+++ b/sys/external/bsd/drm2/dist/drm/i915/display/intel_display.c       Sun Dec 19 11:56:38 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: intel_display.c,v 1.7 2021/12/19 11:56:23 riastradh Exp $      */
+/*     $NetBSD: intel_display.c,v 1.8 2021/12/19 11:56:38 riastradh Exp $      */
 
 /*
  * Copyright © 2006-2007 Intel Corporation
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: intel_display.c,v 1.7 2021/12/19 11:56:23 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: intel_display.c,v 1.8 2021/12/19 11:56:38 riastradh Exp $");
 
 #include "intel_display.h"     /* for pipe_drmhack */
 
@@ -15285,8 +15285,6 @@
            &dev_priv->atomic_commit_lock);
        spin_unlock(&dev_priv->atomic_commit_lock);
 
-       list_del_init(&waiter->entry);
-
        return 0;
 }
 
@@ -15310,6 +15308,10 @@
            (i915_sw_fence_done(&intel_state->commit_ready) ||
                test_bit(I915_RESET_MODESET, &dev_priv->gt.reset.flags)));
        spin_unlock(&dev_priv->atomic_commit_lock);
+
+       spin_lock(&intel_state->commit_ready.wait.lock);
+       list_del(&waiter.entry);
+       spin_unlock(&intel_state->commit_ready.wait.lock);
 }
 
 static void intel_atomic_cleanup_work(struct work_struct *work)
diff -r b61b6e1defd2 -r a6f0cc2be25a sys/external/bsd/drm2/dist/drm/i915/i915_sw_fence.c
--- a/sys/external/bsd/drm2/dist/drm/i915/i915_sw_fence.c       Sun Dec 19 11:56:23 2021 +0000
+++ b/sys/external/bsd/drm2/dist/drm/i915/i915_sw_fence.c       Sun Dec 19 11:56:38 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: i915_sw_fence.c,v 1.4 2021/12/19 11:54:57 riastradh Exp $      */
+/*     $NetBSD: i915_sw_fence.c,v 1.5 2021/12/19 11:56:38 riastradh Exp $      */
 
 /*
  * SPDX-License-Identifier: MIT
@@ -7,7 +7,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: i915_sw_fence.c,v 1.4 2021/12/19 11:54:57 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i915_sw_fence.c,v 1.5 2021/12/19 11:56:38 riastradh Exp $");
 
 #include <linux/slab.h>
 #include <linux/dma-fence.h>
@@ -172,8 +172,6 @@
        /* Caller presumably already completed the fence.  */
        DRM_SPIN_WAKEUP_ALL(&sfw->wq, &sfw->fence->wait.lock);
 
-       list_del_init(&waiter->entry);
-
        return 0;
 }
 
@@ -195,6 +193,7 @@
        list_add_tail(&waiter.entry, &fence->wait.head);
        DRM_SPIN_WAIT_NOINTR_UNTIL(ret, &sfw.wq, &fence->wait.lock,
            i915_sw_fence_done(fence));
+       list_del(&waiter.entry);
        spin_unlock(&fence->wait.lock);
 
        DRM_DESTROY_WAITQUEUE(&sfw.wq);



Home | Main Index | Thread Index | Old Index