1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>i915_gem_evict_something</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="index.html" title="Linux DRM Developer's Guide"><link rel="up" href="ch04s03.html#idp1128473508" title="Buffer Object Eviction"><link rel="prev" href="API-i915-vma-bind.html" title="i915_vma_bind"><link rel="next" href="API-i915-gem-evict-vm.html" title="i915_gem_evict_vm"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center"><span class="phrase">i915_gem_evict_something</span></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="API-i915-vma-bind.html">Prev</a> </td><th width="60%" align="center">Buffer Object Eviction</th><td width="20%" align="right"> <a accesskey="n" href="API-i915-gem-evict-vm.html">Next</a></td></tr></table><hr></div><div class="refentry"><a name="API-i915-gem-evict-something"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>i915_gem_evict_something — 2 Evict vmas to make room for binding a new one 3 </p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="funcsynopsis"><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">int <b class="fsfunc">i915_gem_evict_something </b>(</code></td><td>struct drm_device * <var class="pdparam">dev</var>, </td></tr><tr><td> </td><td>struct i915_address_space * <var class="pdparam">vm</var>, </td></tr><tr><td> </td><td>int <var class="pdparam">min_size</var>, </td></tr><tr><td> </td><td>unsigned <var class="pdparam">alignment</var>, </td></tr><tr><td> </td><td>unsigned <var class="pdparam">cache_level</var>, </td></tr><tr><td> </td><td>unsigned long <var class="pdparam">start</var>, </td></tr><tr><td> </td><td>unsigned long <var class="pdparam">end</var>, </td></tr><tr><td> </td><td>unsigned <var class="pdparam">flags</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer"> </div></div></div><div class="refsect1"><a name="idp1128482772"></a><h2>Arguments</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term"><em class="parameter"><code>dev</code></em></span></dt><dd><p> 4 drm_device 5 </p></dd><dt><span class="term"><em class="parameter"><code>vm</code></em></span></dt><dd><p> 6 address space to evict from 7 </p></dd><dt><span class="term"><em class="parameter"><code>min_size</code></em></span></dt><dd><p> 8 size of the desired free space 9 </p></dd><dt><span class="term"><em class="parameter"><code>alignment</code></em></span></dt><dd><p> 10 alignment constraint of the desired free space 11 </p></dd><dt><span class="term"><em class="parameter"><code>cache_level</code></em></span></dt><dd><p> 12 cache_level for the desired space 13 </p></dd><dt><span class="term"><em class="parameter"><code>start</code></em></span></dt><dd><p> 14 start (inclusive) of the range from which to evict objects 15 </p></dd><dt><span class="term"><em class="parameter"><code>end</code></em></span></dt><dd><p> 16 end (exclusive) of the range from which to evict objects 17 </p></dd><dt><span class="term"><em class="parameter"><code>flags</code></em></span></dt><dd><p> 18 additional flags to control the eviction algorithm 19 </p></dd></dl></div></div><div class="refsect1"><a name="idp1128491612"></a><h2>Description</h2><p> 20 This function will try to evict vmas until a free space satisfying the 21 requirements is found. Callers must check first whether any such hole exists 22 already before calling this function. 23 </p><p> 24 25 This function is used by the object/vma binding code. 26 </p><p> 27 28 Since this function is only used to free up virtual address space it only 29 ignores pinned vmas, and not object where the backing storage itself is 30 pinned. Hence obj->pages_pin_count does not protect against eviction. 31</p></div><div class="refsect1"><a name="idp1128493100"></a><h2>To clarify</h2><p> 32 This is for freeing up virtual address space, not for freeing 33 memory in e.g. the shrinker. 34</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="API-i915-vma-bind.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ch04s03.html#idp1128473508">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="API-i915-gem-evict-vm.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"><span class="phrase">i915_vma_bind</span> </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> <span class="phrase">i915_gem_evict_vm</span></td></tr></table></div></body></html> 35