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 i915: Fix error bran...



details:   https://anonhg.NetBSD.org/src/rev/291b1c8694e7
branches:  trunk
changeset: 370048:291b1c8694e7
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Tue Sep 13 10:14:43 2022 +0000

description:
i915: Fix error branches of execbuffer vma pinning.

PR kern/56591

diffstat:

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

diffs (41 lines):

diff -r cc6cff4de60f -r 291b1c8694e7 sys/external/bsd/drm2/dist/drm/i915/gem/i915_gem_execbuffer.c
--- a/sys/external/bsd/drm2/dist/drm/i915/gem/i915_gem_execbuffer.c     Tue Sep 13 10:14:32 2022 +0000
+++ b/sys/external/bsd/drm2/dist/drm/i915/gem/i915_gem_execbuffer.c     Tue Sep 13 10:14:43 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: i915_gem_execbuffer.c,v 1.4 2021/12/19 11:33:30 riastradh Exp $        */
+/*     $NetBSD: i915_gem_execbuffer.c,v 1.5 2022/09/13 10:14:43 riastradh Exp $        */
 
 /*
  * SPDX-License-Identifier: MIT
@@ -7,7 +7,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: i915_gem_execbuffer.c,v 1.4 2021/12/19 11:33:30 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i915_gem_execbuffer.c,v 1.5 2022/09/13 10:14:43 riastradh Exp $");
 
 #include <linux/intel-iommu.h>
 #include <linux/dma-resv.h>
@@ -546,8 +546,12 @@
                list_add_tail(&vma->exec_link, &eb->unbound);
                if (drm_mm_node_allocated(&vma->node))
                        err = i915_vma_unbind(vma);
-               if (unlikely(err))
+               if (unlikely(err)) {
                        vma->exec_flags = NULL;
+                       if (i == batch_idx)
+                               eb->batch = NULL;
+                       eb->vma[i] = NULL;
+               }
        }
        return err;
 }
@@ -1906,6 +1910,8 @@
 
                __eb_unreserve_vma(vma, flags);
                vma->exec_flags = NULL;
+               if (err)
+                       eb->vma[i] = NULL;
 
                if (unlikely(flags & __EXEC_OBJECT_HAS_REF))
                        i915_vma_put(vma);



Home | Main Index | Thread Index | Old Index