<?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 example for iMX6</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/V4L2-MEMORY-USERPTR-example-for-iMX6/m-p/426907#M64713</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 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;&lt;SPAN style="font-family: 'Verdana','sans-serif';"&gt;As for an example :&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="http://linuxtv.org/downloads/v4l-dvb-apis/capture-example.html" rel="nofollow"&gt;http://linuxtv.org/downloads/v4l-dvb-apis/capture-example.html&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;BR /&gt;Have a great day,&lt;BR /&gt;Yuri&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 22 Jul 2015 08:02:44 GMT</pubDate>
    <dc:creator>Yuri</dc:creator>
    <dc:date>2015-07-22T08:02:44Z</dc:date>
    <item>
      <title>V4L2_MEMORY_USERPTR example for iMX6</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/V4L2-MEMORY-USERPTR-example-for-iMX6/m-p/426906#M64712</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;On my iMX6DL with Linux 3.14.28 I have a camera connected using MIPI.&amp;nbsp; The video streams needs to be processed by the CPU, but the buffers are non-cacheable (&lt;SPAN style="line-height: 1.5;"&gt;Using V4L2_MEMORY_MMAP).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5;"&gt;Is there a solution for this issue?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5;"&gt;Some ideas -&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5;"&gt;1. Can I replace the dma_alloc_coherent() uses to allocate buffer with another call to make them cacheable?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5;"&gt;2. Is there an example of how to get V4L2_MEMORY_USERPTR working properly? (I couldn't...)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5;"&gt;&amp;nbsp;&amp;nbsp; Maybe a unit-test used to verify the Driver implementation?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5;"&gt;Any help would be appreciated.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5;"&gt;Sincerely,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5;"&gt;Erez&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Jul 2015 20:11:32 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/V4L2-MEMORY-USERPTR-example-for-iMX6/m-p/426906#M64712</guid>
      <dc:creator>erezsteinberg</dc:creator>
      <dc:date>2015-07-20T20:11:32Z</dc:date>
    </item>
    <item>
      <title>Re: V4L2_MEMORY_USERPTR example for iMX6</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/V4L2-MEMORY-USERPTR-example-for-iMX6/m-p/426907#M64713</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 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;&lt;SPAN style="font-family: 'Verdana','sans-serif';"&gt;As for an example :&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="http://linuxtv.org/downloads/v4l-dvb-apis/capture-example.html" rel="nofollow"&gt;http://linuxtv.org/downloads/v4l-dvb-apis/capture-example.html&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;BR /&gt;Have a great day,&lt;BR /&gt;Yuri&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Jul 2015 08:02:44 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/V4L2-MEMORY-USERPTR-example-for-iMX6/m-p/426907#M64713</guid>
      <dc:creator>Yuri</dc:creator>
      <dc:date>2015-07-22T08:02:44Z</dc:date>
    </item>
    <item>
      <title>Re: V4L2_MEMORY_USERPTR example for iMX6</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/V4L2-MEMORY-USERPTR-example-for-iMX6/m-p/426908#M64714</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Yuri,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the reply. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The link you sent is from 2012, and it looks like this code is already implemented in 3.14.28. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyway -- it doesn't seem to work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When using USERPTR, the user allocates buffers in user-space, and passes a pointer via m.userptr member of v4l2_buffer. However, none of the mxc-capture code in drivers/media/platform/mxc/capture/&amp;nbsp; accesses this struct member. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you please check?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Erez&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Jul 2015 11:39:17 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/V4L2-MEMORY-USERPTR-example-for-iMX6/m-p/426908#M64714</guid>
      <dc:creator>erezsteinberg</dc:creator>
      <dc:date>2015-07-22T11:39:17Z</dc:date>
    </item>
    <item>
      <title>Re: V4L2_MEMORY_USERPTR example for iMX6</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/V4L2-MEMORY-USERPTR-example-for-iMX6/m-p/426909#M64715</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&gt;Can you try the patch&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&gt;diff --git a/drivers/media/video/mxc/capture/mxc_v4l2_capture.c b/drivers/media/video/mxc/capture/mxc_v4l2_capture.c&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&gt;index 9130388..dddf670 100644&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&gt;--- a/drivers/media/video/mxc/capture/mxc_v4l2_capture.c&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&gt;+++ b/drivers/media/video/mxc/capture/mxc_v4l2_capture.c&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&gt;@@ -324,8 +324,10 @@ static int mxc_v4l2_prepare_bufs(cam_data *cam, struct v4l2_buffer *buf)&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&gt;{&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&gt;&amp;nbsp; pr_debug("In MVC:mxc_v4l2_prepare_bufs\n");&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&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;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;- PAGE_ALIGN(cam-&amp;gt;v2f.fmt.pix.sizeimage)) {&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;+ cam-&amp;gt;v2f.fmt.pix.sizeimage) {&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&gt;&amp;nbsp; pr_err("ERROR: v4l2 capture: mxc_v4l2_prepare_bufs buffers "&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&gt;&amp;nbsp; "not allocated,index=%d, length=%d\n", buf-&amp;gt;index,&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&gt;&amp;nbsp; buf-&amp;gt;length);&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Jul 2015 05:43:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/V4L2-MEMORY-USERPTR-example-for-iMX6/m-p/426909#M64715</guid>
      <dc:creator>Yuri</dc:creator>
      <dc:date>2015-07-29T05:43:30Z</dc:date>
    </item>
    <item>
      <title>Re: V4L2_MEMORY_USERPTR example for iMX6</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/V4L2-MEMORY-USERPTR-example-for-iMX6/m-p/426910#M64716</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Yuri,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Removing the 'PAGE_ALIGN' macro?&lt;/P&gt;&lt;P&gt;Is that the whole patch? I don't see how that would make a difference.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With USERPTR the user-space application provide the virtual address of the video buffer in &lt;STRONG&gt;buf.m.userptr&lt;/STRONG&gt;.&amp;nbsp;&amp;nbsp; This member is ignored in the function -- so how can it work?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From what I know, for userptr the v4l2 driver should copy the virtual address, and then verify the physical pages are continuous (If not, the driver should rearrange the pages). I think this is done in videobuf2-memops.c this is done in vb2_get_contig_userptr()&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Erez&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Jul 2015 06:02:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/V4L2-MEMORY-USERPTR-example-for-iMX6/m-p/426910#M64716</guid>
      <dc:creator>erezsteinberg</dc:creator>
      <dc:date>2015-07-29T06:02:37Z</dc:date>
    </item>
    <item>
      <title>Re: V4L2_MEMORY_USERPTR example for iMX6</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/V4L2-MEMORY-USERPTR-example-for-iMX6/m-p/426911#M64717</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;From app team :&lt;/P&gt;&lt;P&gt;"&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&gt;It need user space allocate&amp;nbsp; physical continuous memory , such use&amp;nbsp; ipu alloc , or other method.&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&gt;I attached v4l2 unit test code , mxc_v4l2_output.c and mx6s_v4l2_capture.c , one use ipu alloc , the other use pxp alloc .&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&gt;Search memalloc in these code.&lt;/P&gt;&lt;P&gt;"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&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>Fri, 31 Jul 2015 08:51:01 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/V4L2-MEMORY-USERPTR-example-for-iMX6/m-p/426911#M64717</guid>
      <dc:creator>Yuri</dc:creator>
      <dc:date>2015-07-31T08:51:01Z</dc:date>
    </item>
    <item>
      <title>Re: V4L2_MEMORY_USERPTR example for iMX6</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/V4L2-MEMORY-USERPTR-example-for-iMX6/m-p/426912#M64718</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Yuri,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the examples. This is good information. However, it does not resolve the problem.&lt;/P&gt;&lt;P&gt;I looked at the kernel sources to see how the IPU and PXP drivers implement the memory allocation, they still use dma_alloc_coherent() ... so, the memory buffers are non cachable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Moreover, the purpose of USERPTR in V4L2 is to allow users to pass buffers allocated in user-space directly by malloc or statically. Using PXP or IPU ot perform the allocation is not really the way it was intended.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also -- I'm not sure my problem is clear.&amp;nbsp; I don't have to use USERPTR (MMAP is okay), but using dma_alloc_coherent() give very bad performance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;What I need is a way to allocate the video buffers &lt;SPAN style="text-decoration: underline;"&gt;and&lt;/SPAN&gt; to have good performance in user-space&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I wrote a DDR benchmark application to show the issue. The code allocates a buffer of 4MB and reads it several times in a loop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When the buffer is allocated with malloc() it takes 49.8msec to read 10MB.&lt;/P&gt;&lt;P&gt;However, when using IPU_ALLOC, it takes 338.4msec (x6.8 longer!)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;root@imx6qsabresd:~# ./ddr_benchmark&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;Test start&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;Test complete (dummy 0)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;Time taken (nanoseconds): 49827333&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;root@imx6qsabresd:~# ./ddr_benchmark_ipu&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;USRP: alloc bufs offset 0x24b00000 size 4149248&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;Test start&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;Test complete (dummy 0)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;Time taken (nanoseconds): 338425669&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;Buffer allocated using malloc()&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;-------------------------------&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;MMDC new Profiling results:&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;***********************&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;Measure time: 1000ms&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;Total cycles count: 396050646&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;Busy cycles count: 240362999&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;Read accesses count: 7001555&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;Write accesses count: 9174&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;Read bytes count: 447536316&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;Write bytes count: 293466&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;Avg. Read burst size: 63&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;Avg. Write burst size: 31&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;Read: 426.80 MB/s /&amp;nbsp; Write: 0.28 MB/s&amp;nbsp; Total: 427.08 MB/s&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;Utilization: 11%&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;Bus Load: 60%&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;Bytes Access: 63&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;Buffer allocated using IPU_ALLOC&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;---------------------------------&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;MMDC new Profiling results:&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;***********************&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;Measure time: 1001ms&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;Total cycles count: 396043446&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;Busy cycles count: 256915721&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;Read accesses count: 8802699&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;Write accesses count: 14923&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;Read bytes count: 78915456&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;Write bytes count: 252306&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;Avg. Read burst size: 8&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;Avg. Write burst size: 16&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;Read: 75.18 MB/s /&amp;nbsp; Write: 0.24 MB/s&amp;nbsp; Total: 75.42 MB/s&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;Utilization: 1%&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;Bus Load: 64%&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;Bytes Access: 8&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The benchmark code is attached.&lt;/P&gt;&lt;P&gt;To select IPU_ALLOC, uncomment line 12.&lt;/P&gt;&lt;P&gt;Build command: arm-linux-gnueabihf-gcc -O3 -mcpu=cortex-a9 -mfloat-abi=hard ddr_benchmark.c -o ddr_benchmark&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Jul 2015 21:55:50 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/V4L2-MEMORY-USERPTR-example-for-iMX6/m-p/426912#M64718</guid>
      <dc:creator>erezsteinberg</dc:creator>
      <dc:date>2015-07-31T21:55:50Z</dc:date>
    </item>
    <item>
      <title>Re: V4L2_MEMORY_USERPTR example for iMX6</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/V4L2-MEMORY-USERPTR-example-for-iMX6/m-p/426913#M64719</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;From app team :&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&gt;"The current driver used&amp;nbsp; is coherent mapping .&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&gt;For customer's use case which need&amp;nbsp; buffer cache-able for &lt;BR /&gt;cpu process&amp;nbsp; the captured data buffer , they need&amp;nbsp; implement &lt;BR /&gt;this new feature by their own."&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>Mon, 03 Aug 2015 07:17:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/V4L2-MEMORY-USERPTR-example-for-iMX6/m-p/426913#M64719</guid>
      <dc:creator>Yuri</dc:creator>
      <dc:date>2015-08-03T07:17:59Z</dc:date>
    </item>
    <item>
      <title>Re: V4L2_MEMORY_USERPTR example for iMX6</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/V4L2-MEMORY-USERPTR-example-for-iMX6/m-p/426914#M64720</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Yuri-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I found an interesting discussion about performance in user-space for buffers allocated with kmalloc (&lt;A href="http://permalink.gmane.org/gmane.linux.ports.arm.kernel/265371" title="http://permalink.gmane.org/gmane.linux.ports.arm.kernel/265371"&gt;kmalloc memory slower than malloc&lt;/A&gt; )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That lead me to check the mmap function in mxc_v4l2_capture.c, and there &lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;I found a solution&lt;/STRONG&gt;&lt;/SPAN&gt; -&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To get normal performance in user-space I did the following changes -&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in mxc_mmap()&amp;nbsp;&amp;nbsp; -- comment out:&amp;nbsp;&amp;nbsp; vma-&amp;gt;vm_page_prot = pgprot_writecombine(vma-&amp;gt;vm_page_prot);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in mxc_allocate_frame_buf()&amp;nbsp;&amp;nbsp; --&amp;nbsp; replace allocation with dma_alloc_coherent() to kmalloc()&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in mxc_free_frame_buf() -- replace dma_free_coherent() with kfree().&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I still use V4L2_MEMORY_MMAP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With this change I can see normal memory loads:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MMDC new Profiling results:&lt;/P&gt;&lt;P&gt;***********************&lt;/P&gt;&lt;P&gt;Measure time: 1000ms&lt;/P&gt;&lt;P&gt;Total cycles count: 396071850&lt;/P&gt;&lt;P&gt;Busy cycles count: 155735196&lt;/P&gt;&lt;P&gt;Read accesses count: 2254063&lt;/P&gt;&lt;P&gt;Write accesses count: 4653481&lt;/P&gt;&lt;P&gt;Read bytes count: 138436492&lt;/P&gt;&lt;P&gt;Write bytes count: 211011038&lt;/P&gt;&lt;P&gt;Avg. Read burst size: 61&lt;/P&gt;&lt;P&gt;Avg. Write burst size: 45&lt;/P&gt;&lt;P&gt;Read: 132.02 MB/s /&amp;nbsp; Write: 201.24 MB/s&amp;nbsp; Total: 333.26 MB/s&lt;/P&gt;&lt;P&gt;Utilization: 14%&lt;/P&gt;&lt;P&gt;Bus Load: 39%&lt;/P&gt;&lt;P&gt;Bytes Access: 50&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the support!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Erez&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Aug 2015 10:08:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/V4L2-MEMORY-USERPTR-example-for-iMX6/m-p/426914#M64720</guid>
      <dc:creator>erezsteinberg</dc:creator>
      <dc:date>2015-08-03T10:08:52Z</dc:date>
    </item>
    <item>
      <title>Re: V4L2_MEMORY_USERPTR example for iMX6</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/V4L2-MEMORY-USERPTR-example-for-iMX6/m-p/426915#M64721</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Erez&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm having a similar issue with memory access times from the user space. Would it be possible for you to share the source code for the three functions please?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Andy&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Sep 2015 14:31:49 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/V4L2-MEMORY-USERPTR-example-for-iMX6/m-p/426915#M64721</guid>
      <dc:creator>yeti425</dc:creator>
      <dc:date>2015-09-25T14:31:49Z</dc:date>
    </item>
    <item>
      <title>Re: V4L2_MEMORY_USERPTR example for iMX6</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/V4L2-MEMORY-USERPTR-example-for-iMX6/m-p/426916#M64722</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&amp;nbsp; Erez&lt;/P&gt;&lt;P&gt;Did you solve the issue? I modify&amp;nbsp; the the functions as you written, but it also slower. Would you share your your code ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks ,&lt;/P&gt;&lt;P&gt;Kenny&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Apr 2016 02:02:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/V4L2-MEMORY-USERPTR-example-for-iMX6/m-p/426916#M64722</guid>
      <dc:creator>kennywang</dc:creator>
      <dc:date>2016-04-20T02:02:43Z</dc:date>
    </item>
  </channel>
</rss>

