<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jan 15, 2014 at 11:45 PM, m silverstri <span dir="ltr"><<a href="mailto:michael.j.silverstri@gmail.com" target="_blank">michael.j.silverstri@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
If my application allocate memory for input and output buffers, and<br>
pass the pointer to a kernel driver (via v4l2 queue buffer operation),<br>
can the kernel driver access it? Do I need to setup DMA before teh<br>
kernel driver can read/write to it?<br></blockquote><div><br></div><div>You can transfer data to & from kernelspace/userspace by using copy_to/from_user() API.</div><div><br></div><div>However, for DMA I think you might also want to lock the user pages in memory so that they are not invalidated when the owning process is scheduled out. This is a very high-level gist, but there a lot of resources out there which show how this can be done.</div>
<div><br></div><div>HTH,</div><div>-mandeep</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Thank you.<br>
<br>
_______________________________________________<br>
Kernelnewbies mailing list<br>
<a href="mailto:Kernelnewbies@kernelnewbies.org">Kernelnewbies@kernelnewbies.org</a><br>
<a href="http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies" target="_blank">http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies</a><br>
</blockquote></div><br></div></div>