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/gt i915: Terminate inner...



details:   https://anonhg.NetBSD.org/src/rev/ffe9abbb2a95
branches:  trunk
changeset: 1028960:ffe9abbb2a95
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sun Dec 19 12:35:13 2021 +0000

description:
i915: Terminate inner loop if we hit end of view.

diffstat:

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

diffs (30 lines):

diff -r 88eab64adcf7 -r ffe9abbb2a95 sys/external/bsd/drm2/dist/drm/i915/gt/intel_ggtt.c
--- a/sys/external/bsd/drm2/dist/drm/i915/gt/intel_ggtt.c       Sun Dec 19 12:35:04 2021 +0000
+++ b/sys/external/bsd/drm2/dist/drm/i915/gt/intel_ggtt.c       Sun Dec 19 12:35:13 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: intel_ggtt.c,v 1.14 2021/12/19 12:35:04 riastradh Exp $        */
+/*     $NetBSD: intel_ggtt.c,v 1.15 2021/12/19 12:35:13 riastradh Exp $        */
 
 // SPDX-License-Identifier: MIT
 /*
@@ -6,7 +6,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: intel_ggtt.c,v 1.14 2021/12/19 12:35:04 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: intel_ggtt.c,v 1.15 2021/12/19 12:35:13 riastradh Exp $");
 
 #include <linux/stop_machine.h>
 
@@ -1669,7 +1669,10 @@
                                offset -= iseg->ds_len;
                                continue;
                        }
-                       for (k = 0; k < iseg->ds_len >> PAGE_SHIFT; k++) {
+                       for (k = 0;
+                            (i < view->partial.size &&
+                                k < iseg->ds_len >> PAGE_SHIFT);
+                            k++) {
                                KASSERT(i < view->partial.size);
                                bus_dma_segment_t *oseg =
                                    &st->sgl->sg_dmamap->dm_segs[i++];



Home | Main Index | Thread Index | Old Index