From owner-svn-src-head@freebsd.org Thu Sep 21 15:32:43 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2161AE0B73A; Thu, 21 Sep 2017 15:32:43 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E3F0A82CBB; Thu, 21 Sep 2017 15:32:42 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8LFWgpC006135; Thu, 21 Sep 2017 15:32:42 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8LFWfwo006133; Thu, 21 Sep 2017 15:32:41 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201709211532.v8LFWfwo006133@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Thu, 21 Sep 2017 15:32:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323868 - head/sys/dev/drm2/i915 X-SVN-Group: head X-SVN-Commit-Author: alc X-SVN-Commit-Paths: head/sys/dev/drm2/i915 X-SVN-Commit-Revision: 323868 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Sep 2017 15:32:43 -0000 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);