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 drm/mm: Find nearest geq/leq,...



details:   https://anonhg.NetBSD.org/src/rev/69d534f03585
branches:  trunk
changeset: 361570:69d534f03585
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Mon Feb 14 13:22:30 2022 +0000

description:
drm/mm: Find nearest geq/leq, not matching, holes in first_hole.

diffstat:

 sys/external/bsd/drm2/dist/drm/drm_mm.c |  12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diffs (37 lines):

diff -r 95e13c961119 -r 69d534f03585 sys/external/bsd/drm2/dist/drm/drm_mm.c
--- a/sys/external/bsd/drm2/dist/drm/drm_mm.c   Mon Feb 14 13:22:21 2022 +0000
+++ b/sys/external/bsd/drm2/dist/drm/drm_mm.c   Mon Feb 14 13:22:30 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: drm_mm.c,v 1.17 2022/02/14 13:22:21 riastradh Exp $    */
+/*     $NetBSD: drm_mm.c,v 1.18 2022/02/14 13:22:30 riastradh Exp $    */
 
 /**************************************************************************
  *
@@ -45,7 +45,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: drm_mm.c,v 1.17 2022/02/14 13:22:21 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: drm_mm.c,v 1.18 2022/02/14 13:22:30 riastradh Exp $");
 
 #include <linux/export.h>
 #include <linux/interval_tree_generic.h>
@@ -478,10 +478,18 @@
                return best_hole(mm, size);
 
        case DRM_MM_INSERT_LOW:
+#ifdef __NetBSD__
+               return rb_tree_find_node_geq(&mm->holes_addr.rbr_tree, &start);
+#else
                return find_hole(mm, start);
+#endif
 
        case DRM_MM_INSERT_HIGH:
+#ifdef __NetBSD__
+               return rb_tree_find_node_leq(&mm->holes_addr.rbr_tree, &end);
+#else
                return find_hole(mm, end);
+#endif
 
        case DRM_MM_INSERT_EVICT:
                return list_first_entry_or_null(&mm->hole_stack,



Home | Main Index | Thread Index | Old Index