1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>fence_init</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="index.html" title="Linux Device Drivers"><link rel="up" href="ch02s03.html" title="Device Drivers DMA Management"><link rel="prev" href="API-fence-default-wait.html" title="fence_default_wait"><link rel="next" href="re398.html" title=".//drivers/dma-buf/seqno-fence.c"></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">fence_init</span></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="API-fence-default-wait.html">Prev</a>&#160;</td><th width="60%" align="center">Device Drivers DMA Management</th><td width="20%" align="right">&#160;<a accesskey="n" href="re398.html">Next</a></td></tr></table><hr></div><div class="refentry"><a name="API-fence-init"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>fence_init &#8212; 
2     Initialize a custom fence.
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">void <b class="fsfunc">fence_init </b>(</code></td><td>struct fence * <var class="pdparam">fence</var>, </td></tr><tr><td>&#160;</td><td>const struct fence_ops * <var class="pdparam">ops</var>, </td></tr><tr><td>&#160;</td><td>spinlock_t * <var class="pdparam">lock</var>, </td></tr><tr><td>&#160;</td><td>unsigned <var class="pdparam">context</var>, </td></tr><tr><td>&#160;</td><td>unsigned <var class="pdparam">seqno</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer">&#160;</div></div></div><div class="refsect1"><a name="idp1110369916"></a><h2>Arguments</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term"><em class="parameter"><code>fence</code></em></span></dt><dd><p>
4     [in]	the fence to initialize
5    </p></dd><dt><span class="term"><em class="parameter"><code>ops</code></em></span></dt><dd><p>
6     [in]	the fence_ops for operations on this fence
7    </p></dd><dt><span class="term"><em class="parameter"><code>lock</code></em></span></dt><dd><p>
8     [in]	the irqsafe spinlock to use for locking this fence
9    </p></dd><dt><span class="term"><em class="parameter"><code>context</code></em></span></dt><dd><p>
10     [in]	the execution context this fence is run on
11    </p></dd><dt><span class="term"><em class="parameter"><code>seqno</code></em></span></dt><dd><p>
12     [in]	a linear increasing sequence number for this context
13    </p></dd></dl></div></div><div class="refsect1"><a name="idp1110375740"></a><h2>Description</h2><p>
14   Initializes an allocated fence, the caller doesn't have to keep its
15   refcount after committing with this fence, but it will need to hold a
16   refcount again if fence_ops.enable_signaling gets called. This can
17   be used for other implementing other types of fence.
18   </p><p>
19
20   context and seqno are used for easy comparison between fences, allowing
21   to check which fence is later by simply using fence_later.
22</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="API-fence-default-wait.html">Prev</a>&#160;</td><td width="20%" align="center"><a accesskey="u" href="ch02s03.html">Up</a></td><td width="40%" align="right">&#160;<a accesskey="n" href="re398.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"><span class="phrase">fence_default_wait</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;
23   .//drivers/dma-buf/seqno-fence.c
24  </td></tr></table></div></body></html>
25