Author: alc Date: Sat Sep 30 18:52:59 2017 New Revision: 324129 URL: https://svnweb.freebsd.org/changeset/base/324129
Log: 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. Modified: stable/11/sys/dev/drm2/i915/i915_gem.c stable/11/sys/dev/drm2/i915/i915_gem_gtt.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/drm2/i915/i915_gem.c ============================================================================== --- stable/11/sys/dev/drm2/i915/i915_gem.c Sat Sep 30 18:32:00 2017 (r324128) +++ stable/11/sys/dev/drm2/i915/i915_gem.c Sat Sep 30 18:52:59 2017 (r324129) @@ -1890,8 +1890,7 @@ i915_gem_object_put_pages_range_locked(struct drm_i915 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); } Modified: stable/11/sys/dev/drm2/i915/i915_gem_gtt.c ============================================================================== --- stable/11/sys/dev/drm2/i915/i915_gem_gtt.c Sat Sep 30 18:32:00 2017 (r324128) +++ stable/11/sys/dev/drm2/i915/i915_gem_gtt.c Sat Sep 30 18:52:59 2017 (r324129) @@ -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 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); _______________________________________________ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"