Author: alc
Date: Thu Sep 21 15:32:41 2017
New Revision: 323868
URL: https://svnweb.freebsd.org/changeset/base/323868

Log:
  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

Modified:
  head/sys/dev/drm2/i915/i915_gem.c
  head/sys/dev/drm2/i915/i915_gem_gtt.c

Modified: head/sys/dev/drm2/i915/i915_gem.c
==============================================================================
--- head/sys/dev/drm2/i915/i915_gem.c   Thu Sep 21 15:30:20 2017        
(r323867)
+++ head/sys/dev/drm2/i915/i915_gem.c   Thu Sep 21 15:32:41 2017        
(r323868)
@@ -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: head/sys/dev/drm2/i915/i915_gem_gtt.c
==============================================================================
--- head/sys/dev/drm2/i915/i915_gem_gtt.c       Thu Sep 21 15:30:20 2017        
(r323867)
+++ head/sys/dev/drm2/i915/i915_gem_gtt.c       Thu Sep 21 15:32:41 2017        
(r323868)
@@ -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-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to