1<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>struct v4l2_m2m_ops</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="mediadev.html#id-1.8.2" title="Video2Linux devices"><link rel="prev" href="API-struct-v4l2-mbus-config.html" title="struct v4l2_mbus_config"><link rel="next" href="API-v4l2-m2m-num-src-bufs-ready.html" title="v4l2_m2m_num_src_bufs_ready"></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">struct v4l2_m2m_ops</span></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="API-struct-v4l2-mbus-config.html">Prev</a> </td><th width="60%" align="center">Video2Linux devices</th><td width="20%" align="right"> <a accesskey="n" href="API-v4l2-m2m-num-src-bufs-ready.html">Next</a></td></tr></table><hr></div><div class="refentry"><a name="API-struct-v4l2-m2m-ops"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>struct v4l2_m2m_ops — 2 mem-to-mem device driver callbacks 3 </p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><pre class="programlisting"> 4struct v4l2_m2m_ops { 5 void (* device_run) (void *priv); 6 int (* job_ready) (void *priv); 7 void (* job_abort) (void *priv); 8 void (* lock) (void *priv); 9 void (* unlock) (void *priv); 10}; </pre></div><div class="refsect1"><a name="id-1.8.2.66.5"></a><h2>Members</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term">device_run</span></dt><dd><p> 11required. Begin the actual job (transaction) inside this 12callback. 13The job does NOT have to end before this callback returns 14(and it will be the usual case). When the job finishes, 15<code class="function">v4l2_m2m_job_finish</code> has to be called. 16 </p></dd><dt><span class="term">job_ready</span></dt><dd><p> 17optional. Should return 0 if the driver does not have a job 18fully prepared to run yet (i.e. it will not be able to finish a 19transaction without sleeping). If not provided, it will be 20assumed that one source and one destination buffer are all 21that is required for the driver to perform one full transaction. 22This method may not sleep. 23 </p></dd><dt><span class="term">job_abort</span></dt><dd><p> 24required. Informs the driver that it has to abort the currently 25running transaction as soon as possible (i.e. as soon as it can 26stop the device safely; e.g. in the next interrupt handler), 27even if the transaction would not have been finished by then. 28After the driver performs the necessary steps, it has to call 29<code class="function">v4l2_m2m_job_finish</code> (as if the transaction ended normally). 30This function does not have to (and will usually not) wait 31until the device enters a state when it can be stopped. 32 </p></dd><dt><span class="term">lock</span></dt><dd><p> 33optional. Define a driver's own lock callback, instead of using 34m2m_ctx->q_lock. 35 </p></dd><dt><span class="term">unlock</span></dt><dd><p> 36optional. Define a driver's own unlock callback, instead of 37using m2m_ctx->q_lock. 38 </p></dd></dl></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="API-struct-v4l2-mbus-config.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="mediadev.html#id-1.8.2">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="API-v4l2-m2m-num-src-bufs-ready.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"><span class="phrase">struct v4l2_mbus_config</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">v4l2_m2m_num_src_bufs_ready</span></td></tr></table></div></body></html> 39