Merge tag 'drm-next-2018-10-24' of git://anongit.freedesktop.org/drm/drm
[platform/kernel/linux-starfive.git] / drivers / gpu / drm / i915 / i915_gem.c
index aa3969d..0c8aa57 100644 (file)
@@ -6052,7 +6052,8 @@ i915_gem_object_get_sg(struct drm_i915_gem_object *obj,
        count = __sg_page_count(sg);
 
        while (idx + count <= n) {
-               unsigned long exception, i;
+               void *entry;
+               unsigned long i;
                int ret;
 
                /* If we cannot allocate and insert this entry, or the
@@ -6067,12 +6068,9 @@ i915_gem_object_get_sg(struct drm_i915_gem_object *obj,
                if (ret && ret != -EEXIST)
                        goto scan;
 
-               exception =
-                       RADIX_TREE_EXCEPTIONAL_ENTRY |
-                       idx << RADIX_TREE_EXCEPTIONAL_SHIFT;
+               entry = xa_mk_value(idx);
                for (i = 1; i < count; i++) {
-                       ret = radix_tree_insert(&iter->radix, idx + i,
-                                               (void *)exception);
+                       ret = radix_tree_insert(&iter->radix, idx + i, entry);
                        if (ret && ret != -EEXIST)
                                goto scan;
                }
@@ -6110,15 +6108,14 @@ lookup:
        GEM_BUG_ON(!sg);
 
        /* If this index is in the middle of multi-page sg entry,
-        * the radixtree will contain an exceptional entry that points
+        * the radix tree will contain a value entry that points
         * to the start of that range. We will return the pointer to
         * the base page and the offset of this page within the
         * sg entry's range.
         */
        *offset = 0;
-       if (unlikely(radix_tree_exception(sg))) {
-               unsigned long base =
-                       (unsigned long)sg >> RADIX_TREE_EXCEPTIONAL_SHIFT;
+       if (unlikely(xa_is_value(sg))) {
+               unsigned long base = xa_to_value(sg);
 
                sg = radix_tree_lookup(&iter->radix, base);
                GEM_BUG_ON(!sg);