<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>i.MX ProcessorsのトピックRe: V4L2_MEMORY_USERPTR Support</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/V4L2-MEMORY-USERPTR-Support/m-p/340674#M46699</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jimmy -&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm using Linux 3.0.101&lt;/P&gt;&lt;P&gt;But, I didn't see any differences in the code in 3.10&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 17 Dec 2014 06:42:37 GMT</pubDate>
    <dc:creator>erezsteinberg</dc:creator>
    <dc:date>2014-12-17T06:42:37Z</dc:date>
    <item>
      <title>V4L2_MEMORY_USERPTR Support</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/V4L2-MEMORY-USERPTR-Support/m-p/340672#M46697</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am capturing video from a MIPI-CSI2 sensor directly to memory. I need to perform some processing on the input image, however there is a huge performance impact when accessing the V4L2 buffer. It is allocated using V4L2_MEMORY_MMAP, which allocates the buffers by calling dma_alloc_coherent(). This allocated non-cacheable memory which is slow...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Therefore, I am trying to use user-allocated buffers (V4L2_MEMORY_USERPTR), but am having problems.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First, it seems I have to call VIDIOC_QUERYBUF ioctl before VIDIOC_QBUF, otherwise I get an error when starting streaming.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, looking in mxc_v4l2_capture.c, VIDIOC_QUERYBUF calls mxc_v4l2_prepare_bufs() -&amp;nbsp; but, it seems that paddress is copied from the v4l2_buffer provided by the user.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My question -- &lt;STRONG&gt;Are user-space buffers (V4L2_MEMORY_USERPTR) supported in iMX6 Linux?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;If not -- is there a way to map a buffer allocated by dma_alloc_coherent without getting such a big performance hit?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sincerely,&lt;/P&gt;&lt;P&gt;Erez&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-- for reference :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;static int mxc_v4l2_prepare_bufs(cam_data *cam, struct v4l2_buffer *buf)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;{&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; pr_debug("In MVC:mxc_v4l2_prepare_bufs\n");&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; if (buf-&amp;gt;index &amp;lt; 0 || buf-&amp;gt;index &amp;gt;= FRAME_NUM || buf-&amp;gt;length &amp;lt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; cam-&amp;gt;v2f.fmt.pix.sizeimage) {&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pr_err("ERROR: v4l2 capture: mxc_v4l2_prepare_bufs buffers "&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "not allocated,index=%d, length=%d\n", buf-&amp;gt;index, &lt;/SPAN&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 10pt; line-height: 1.5em;"&gt;buf-&amp;gt;length);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return -EINVAL;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; }&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; cam-&amp;gt;frame[buf-&amp;gt;index].buffer.index = buf-&amp;gt;index;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; cam-&amp;gt;frame[buf-&amp;gt;index].buffer.flags = V4L2_BUF_FLAG_MAPPED;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; cam-&amp;gt;frame[buf-&amp;gt;index].buffer.length = buf-&amp;gt;length;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000; font-family: 'courier new', courier;"&gt;&amp;nbsp; cam-&amp;gt;frame[buf-&amp;gt;index].buffer.m.offset = cam-&amp;gt;frame[buf-&amp;gt;index].paddress &lt;/SPAN&gt;&lt;SPAN style="color: #ff0000; font-family: 'courier new', courier; font-size: 10pt; line-height: 1.5em;"&gt;= buf-&amp;gt;m.offset;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; cam-&amp;gt;frame[buf-&amp;gt;index].buffer.type = buf-&amp;gt;type;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; cam-&amp;gt;frame[buf-&amp;gt;index].buffer.memory = V4L2_MEMORY_USERPTR;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; cam-&amp;gt;frame[buf-&amp;gt;index].index = buf-&amp;gt;index;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; return 0;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Dec 2014 18:59:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/V4L2-MEMORY-USERPTR-Support/m-p/340672#M46697</guid>
      <dc:creator>erezsteinberg</dc:creator>
      <dc:date>2014-12-10T18:59:27Z</dc:date>
    </item>
    <item>
      <title>Re: V4L2_MEMORY_USERPTR Support</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/V4L2-MEMORY-USERPTR-Support/m-p/340673#M46698</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Would you tell me which BSP are you using?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Dec 2014 03:26:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/V4L2-MEMORY-USERPTR-Support/m-p/340673#M46698</guid>
      <dc:creator>jimmychan</dc:creator>
      <dc:date>2014-12-17T03:26:23Z</dc:date>
    </item>
    <item>
      <title>Re: V4L2_MEMORY_USERPTR Support</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/V4L2-MEMORY-USERPTR-Support/m-p/340674#M46699</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jimmy -&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm using Linux 3.0.101&lt;/P&gt;&lt;P&gt;But, I didn't see any differences in the code in 3.10&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Dec 2014 06:42:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/V4L2-MEMORY-USERPTR-Support/m-p/340674#M46699</guid>
      <dc:creator>erezsteinberg</dc:creator>
      <dc:date>2014-12-17T06:42:37Z</dc:date>
    </item>
    <item>
      <title>Re: V4L2_MEMORY_USERPTR Support</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/V4L2-MEMORY-USERPTR-Support/m-p/340675#M46700</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Verdana','sans-serif';"&gt;&amp;nbsp; Please try&amp;nbsp; to fix ENGR00234387 to support V4L2_MEMORY_USERPTR.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Verdana','sans-serif';"&gt;&lt;BR /&gt;&lt;A class="jive-link-external-small" href="https://bitbucket.org/devonit/linux-2.6-imx/branch/imx_3.0.35_1.1.0" rel="nofollow"&gt;https://bitbucket.org/devonit/linux-2.6-imx/branch/imx_3.0.35_1.1.0&lt;/A&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Verdana','sans-serif';"&gt;&lt;A class="jive-link-external-small" href="https://bitbucket.org/devonit/linux-2.6-imx/commits/4eed6a080a4d4a453d976a4fb2dc6f5d90fbb827?at=master" rel="nofollow"&gt;https://bitbucket.org/devonit/linux-2.6-imx/commits/4eed6a080a4d4a453d976a4fb2dc6f5d90fbb827?at=master&lt;/A&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Yuri.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Jul 2015 07:52:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/V4L2-MEMORY-USERPTR-Support/m-p/340675#M46700</guid>
      <dc:creator>Yuri</dc:creator>
      <dc:date>2015-07-22T07:52:22Z</dc:date>
    </item>
    <item>
      <title>Re: V4L2_MEMORY_USERPTR Support</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/V4L2-MEMORY-USERPTR-Support/m-p/340676#M46701</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Discussion continued on&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.nxp.com/message/537147"&gt;V4L2_MEMORY_USERPTR example for iMX6&lt;/A&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Jul 2015 11:40:31 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/V4L2-MEMORY-USERPTR-Support/m-p/340676#M46701</guid>
      <dc:creator>erezsteinberg</dc:creator>
      <dc:date>2015-07-22T11:40:31Z</dc:date>
    </item>
  </channel>
</rss>

