Modernize calls to vm_page_unwire(). As of r288122, vm_page_unwire()
accepts PQ_NONE as the specified queue and returns a Boolean indicating whether the page's wire count transitioned to zero. Use these features in dev/drm2. Reviewed by: kib, markj MFC after: 1 week
This commit is contained in:
parent
5370de88cc
commit
4aef95b3f0
@ -1890,8 +1890,7 @@ i915_gem_object_put_pages_range_locked(struct drm_i915_gem_object *obj,
|
||||
KASSERT(page->pindex == i, ("pindex %jx %jx",
|
||||
(uintmax_t)page->pindex, (uintmax_t)i));
|
||||
vm_page_lock(page);
|
||||
vm_page_unwire(page, PQ_INACTIVE);
|
||||
if (page->wire_count == 0)
|
||||
if (vm_page_unwire(page, PQ_INACTIVE))
|
||||
atomic_add_long(&i915_gem_wired_pages_cnt, -1);
|
||||
vm_page_unlock(page);
|
||||
}
|
||||
|
@ -198,7 +198,7 @@ int i915_gem_init_aliasing_ppgtt(struct drm_device *dev)
|
||||
free(ppgtt->pt_dma_addr, DRM_I915_GEM);
|
||||
for (i = 0; i < ppgtt->num_pd_entries; i++) {
|
||||
if (ppgtt->pt_pages[i]) {
|
||||
vm_page_unwire(ppgtt->pt_pages[i], PQ_INACTIVE);
|
||||
vm_page_unwire(ppgtt->pt_pages[i], PQ_NONE);
|
||||
vm_page_free(ppgtt->pt_pages[i]);
|
||||
}
|
||||
}
|
||||
@ -228,7 +228,7 @@ void i915_gem_cleanup_aliasing_ppgtt(struct drm_device *dev)
|
||||
|
||||
free(ppgtt->pt_dma_addr, DRM_I915_GEM);
|
||||
for (i = 0; i < ppgtt->num_pd_entries; i++) {
|
||||
vm_page_unwire(ppgtt->pt_pages[i], PQ_INACTIVE);
|
||||
vm_page_unwire(ppgtt->pt_pages[i], PQ_NONE);
|
||||
vm_page_free(ppgtt->pt_pages[i]);
|
||||
}
|
||||
free(ppgtt->pt_pages, DRM_I915_GEM);
|
||||
|
Loading…
Reference in New Issue
Block a user