summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoralc <alc@FreeBSD.org>2017-09-30 18:52:59 +0000
committeralc <alc@FreeBSD.org>2017-09-30 18:52:59 +0000
commite0cf05a5fc90aa252c0f969d50ee63d703260671 (patch)
tree2aa1afc6842b30b705e699050f22939e31817f62
parentb4048d787f3ea816d628265c46b245d20ec6e09c (diff)
downloadFreeBSD-src-e0cf05a5fc90aa252c0f969d50ee63d703260671.zip
FreeBSD-src-e0cf05a5fc90aa252c0f969d50ee63d703260671.tar.gz
MFC r323868
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.
-rw-r--r--sys/dev/drm2/i915/i915_gem.c3
-rw-r--r--sys/dev/drm2/i915/i915_gem_gtt.c4
2 files changed, 3 insertions, 4 deletions
diff --git a/sys/dev/drm2/i915/i915_gem.c b/sys/dev/drm2/i915/i915_gem.c
index 7502b61..40d432c 100644
--- a/sys/dev/drm2/i915/i915_gem.c
+++ b/sys/dev/drm2/i915/i915_gem.c
@@ -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);
}
diff --git a/sys/dev/drm2/i915/i915_gem_gtt.c b/sys/dev/drm2/i915/i915_gem_gtt.c
index 5cd50ad..35b5900 100644
--- a/sys/dev/drm2/i915/i915_gem_gtt.c
+++ b/sys/dev/drm2/i915/i915_gem_gtt.c
@@ -198,7 +198,7 @@ err_pt_alloc:
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);
OpenPOWER on IntegriCloud