Functions vm_page_prev() and vm_page_next() are no longer invoked. Remove them.
Details
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
What are the alternatives to these removed functions? This change essentially broke drm-kmod from building, at least from this line: https://github.com/freebsd/drm-kmod/blob/66e1d0ffbf791759619aa3cfca5ee87da3a5c5c2/drivers/gpu/drm/i915/gem/i915_gem_mman.c#L171
I've attached a patch to the drm-kmod sources that I expect to address the problem. A similar patch may well address the other cases.
This change is part of an effort to eliminate from the implementation the doubly-linked list that vm_page_next() depends on.
{F114969018}
Can't access {F114969018} patch. From the F11* patches listed in review, F114969018 doesn't show up and I see too that one is restricted.
Don't know how to remove restriction. Here's the patch:
diff --git a/drivers/gpu/drm/i915/gem/i915_gem_mman.c b/drivers/gpu/drm/i915/gem/i915_gem_mman.c index 2a9946c7d0..9c0275af71 100644 --- a/drivers/gpu/drm/i915/gem/i915_gem_mman.c +++ b/drivers/gpu/drm/i915/gem/i915_gem_mman.c @@ -34,6 +34,7 @@ #include <vm/vm_object.h> #include <vm/vm_pager.h> #include <vm/vm_param.h> +#include <vm/vm_radix.h> #endif #ifdef __linux__ /* Mute unused function warning. */ @@ -73,6 +74,8 @@ int i915_gem_mmap_ioctl(struct drm_device *dev, void *data, struct drm_file *file) { + struct pctrie_iter pages; + vm_page_t page; struct drm_i915_private *i915 = to_i915(dev); struct drm_i915_gem_mmap *args = data; struct drm_i915_gem_object *obj; @@ -166,9 +169,10 @@ i915_gem_mmap_ioctl(struct drm_device *dev, void *data, /* currently disabled as it causes artifacts on FreeBSD */ if ((rv == KERN_SUCCESS) && (args->flags & I915_MMAP_WC)) { + vm_page_iter_init(&pages, vmobj); VM_OBJECT_WLOCK(vmobj); if (vm_object_set_memattr(vmobj, VM_MEMATTR_WRITE_COMBINING) != KERN_SUCCESS) { - for (vm_page_t page = vm_page_find_least(vmobj, 0); page != NULL; page = vm_page_next(page)) { + VM_RADIX_FORALL(page, &pages) { pmap_page_set_memattr(page, VM_MEMATTR_WRITE_COMBINING); } }
Using your patch at graphics/drm-61-kmod port and it builded fine and run is ok too.
Also, there is a pull at https://github.com/freebsd/drm-kmod/pull/348
Thanks!