1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>drm_mm_insert_node</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="drm-memory-management.html#idp1119448692" title="DRM MM Range Allocator Function References"><link rel="prev" href="API-drm-mm-for-each-hole.html" title="drm_mm_for_each_hole"><link rel="next" href="API-drm-mm-insert-node-in-range.html" title="drm_mm_insert_node_in_range"></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">drm_mm_insert_node</span></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="API-drm-mm-for-each-hole.html">Prev</a>&#160;</td><th width="60%" align="center">DRM MM Range Allocator Function References</th><td width="20%" align="right">&#160;<a accesskey="n" href="API-drm-mm-insert-node-in-range.html">Next</a></td></tr></table><hr></div><div class="refentry"><a name="API-drm-mm-insert-node"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>drm_mm_insert_node &#8212; 
2     search for space and insert <em class="parameter"><code>node</code></em>
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">drm_mm_insert_node </b>(</code></td><td>struct drm_mm * <var class="pdparam">mm</var>, </td></tr><tr><td>&#160;</td><td>struct drm_mm_node * <var class="pdparam">node</var>, </td></tr><tr><td>&#160;</td><td>u64 <var class="pdparam">size</var>, </td></tr><tr><td>&#160;</td><td>unsigned <var class="pdparam">alignment</var>, </td></tr><tr><td>&#160;</td><td>enum drm_mm_search_flags <var class="pdparam">flags</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer">&#160;</div></div></div><div class="refsect1"><a name="idp1123202028"></a><h2>Arguments</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term"><em class="parameter"><code>mm</code></em></span></dt><dd><p>
4     drm_mm to allocate from
5    </p></dd><dt><span class="term"><em class="parameter"><code>node</code></em></span></dt><dd><p>
6     preallocate node to insert
7    </p></dd><dt><span class="term"><em class="parameter"><code>size</code></em></span></dt><dd><p>
8     size of the allocation
9    </p></dd><dt><span class="term"><em class="parameter"><code>alignment</code></em></span></dt><dd><p>
10     alignment of the allocation
11    </p></dd><dt><span class="term"><em class="parameter"><code>flags</code></em></span></dt><dd><p>
12     flags to fine-tune the allocation
13    </p></dd></dl></div></div><div class="refsect1"><a name="idp1123207596"></a><h2>Description</h2><p>
14   This is a simplified version of <code class="function">drm_mm_insert_node_generic</code> with <em class="parameter"><code>color</code></em> set
15   to 0.
16   </p><p>
17
18   The preallocated node must be cleared to 0.
19</p></div><div class="refsect1"><a name="idp1123209028"></a><h2>Returns</h2><p>
20   0 on success, -ENOSPC if there's no suitable hole.
21</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="API-drm-mm-for-each-hole.html">Prev</a>&#160;</td><td width="20%" align="center"><a accesskey="u" href="drm-memory-management.html#idp1119448692">Up</a></td><td width="40%" align="right">&#160;<a accesskey="n" href="API-drm-mm-insert-node-in-range.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"><span class="phrase">drm_mm_for_each_hole</span>&#160;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">&#160;<span class="phrase">drm_mm_insert_node_in_range</span></td></tr></table></div></body></html>
22