<?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中的主题 Custom SDMA script to convert bayer image</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/Custom-SDMA-script-to-convert-bayer-image/m-p/453277#M70523</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Freescale folks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First some background&lt;/P&gt;&lt;P&gt;I an IMX6Solo running the 3.14.28 wandboard kernel image which has been modified to aquire bayer image data.&amp;nbsp; I currently have a system that can aquire bayer video and convert it to RGBx format using the bayer2rgb gstreamer plugin, however the CPU is almost at 100% usage for a 640x480 video stream, and I need a 1280x720 video.&amp;nbsp;&amp;nbsp; It looks like the other people who've had to convert bayer2rgb were using dual/quad core CPUs so they had enough horsepower to get it done, but I don't have that luxury.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think it may be possible to use the SDMA engine to do this conversion for me by loading in the data, performing some shifts and masks to realize a nearest neighbor type of algorithm and then writing out the date to an output buffer.&amp;nbsp; These types of opcodes are all available in the SDMA engine, so I'm excited to try this out.&amp;nbsp; I'd need to have the SDMA available from a gstreamer plugin in order for this to work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've been reading a blog ( &lt;A href="http://billauer.co.il/blog/2011/10/imx-sdma-howto-assembler-linux/" title="http://billauer.co.il/blog/2011/10/imx-sdma-howto-assembler-linux/"&gt;Freescale i.MX SDMA tutorial (part IV)&lt;/A&gt; )&amp;nbsp; that has some excellent information on the freescale SDMA system, but it was written 4 years ago and there are quite a few changes to the kernel code since then. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I guess the first question is, for anyone familiar with the SDMA system, is this even possible, and how can I get a hold of the freescale assembler to write my custom script?&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Next question:&amp;nbsp; In the blog I linked to, the guy wrote a function to load his script and run it, but he put it at the end of the sdma_probe function.&amp;nbsp; I need whatever function I'm going to use accessible from a gstreamer plugin, and I need to give it variables for the src/dest address.&amp;nbsp; If I write this function, and declare it in the include/linux/platform_data/dma-imx-sdma.h file would it be accessible to a gstreamer plugin?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm open to any other suggests for converting the data if anyone has them!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 30 Nov 2015 20:30:43 GMT</pubDate>
    <dc:creator>chrisroed</dc:creator>
    <dc:date>2015-11-30T20:30:43Z</dc:date>
    <item>
      <title>Custom SDMA script to convert bayer image</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Custom-SDMA-script-to-convert-bayer-image/m-p/453277#M70523</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Freescale folks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First some background&lt;/P&gt;&lt;P&gt;I an IMX6Solo running the 3.14.28 wandboard kernel image which has been modified to aquire bayer image data.&amp;nbsp; I currently have a system that can aquire bayer video and convert it to RGBx format using the bayer2rgb gstreamer plugin, however the CPU is almost at 100% usage for a 640x480 video stream, and I need a 1280x720 video.&amp;nbsp;&amp;nbsp; It looks like the other people who've had to convert bayer2rgb were using dual/quad core CPUs so they had enough horsepower to get it done, but I don't have that luxury.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think it may be possible to use the SDMA engine to do this conversion for me by loading in the data, performing some shifts and masks to realize a nearest neighbor type of algorithm and then writing out the date to an output buffer.&amp;nbsp; These types of opcodes are all available in the SDMA engine, so I'm excited to try this out.&amp;nbsp; I'd need to have the SDMA available from a gstreamer plugin in order for this to work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've been reading a blog ( &lt;A href="http://billauer.co.il/blog/2011/10/imx-sdma-howto-assembler-linux/" title="http://billauer.co.il/blog/2011/10/imx-sdma-howto-assembler-linux/"&gt;Freescale i.MX SDMA tutorial (part IV)&lt;/A&gt; )&amp;nbsp; that has some excellent information on the freescale SDMA system, but it was written 4 years ago and there are quite a few changes to the kernel code since then. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I guess the first question is, for anyone familiar with the SDMA system, is this even possible, and how can I get a hold of the freescale assembler to write my custom script?&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Next question:&amp;nbsp; In the blog I linked to, the guy wrote a function to load his script and run it, but he put it at the end of the sdma_probe function.&amp;nbsp; I need whatever function I'm going to use accessible from a gstreamer plugin, and I need to give it variables for the src/dest address.&amp;nbsp; If I write this function, and declare it in the include/linux/platform_data/dma-imx-sdma.h file would it be accessible to a gstreamer plugin?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm open to any other suggests for converting the data if anyone has them!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Nov 2015 20:30:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Custom-SDMA-script-to-convert-bayer-image/m-p/453277#M70523</guid>
      <dc:creator>chrisroed</dc:creator>
      <dc:date>2015-11-30T20:30:43Z</dc:date>
    </item>
    <item>
      <title>Re: Custom SDMA script to convert bayer image</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Custom-SDMA-script-to-convert-bayer-image/m-p/453278#M70524</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Chris&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for SDMA software one can look at&lt;/P&gt;&lt;P&gt;&lt;A href="http://cache.freescale.com/files/soft_dev_tools/doc/data_sheet/950-00140.pdf" title="http://cache.freescale.com/files/soft_dev_tools/doc/data_sheet/950-00140.pdf"&gt;http://cache.freescale.com/files/soft_dev_tools/doc/data_sheet/950-00140.pdf&lt;/A&gt; &lt;/P&gt;&lt;P&gt;In general sdma script can be loaded from any application, so one can put it&lt;/P&gt;&lt;P&gt;to gstreamer plugin sources too.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;igor&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Dec 2015 02:26:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Custom-SDMA-script-to-convert-bayer-image/m-p/453278#M70524</guid>
      <dc:creator>igorpadykov</dc:creator>
      <dc:date>2015-12-01T02:26:53Z</dc:date>
    </item>
    <item>
      <title>Re: Custom SDMA script to convert bayer image</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Custom-SDMA-script-to-convert-bayer-image/m-p/453279#M70525</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Igor, thanks for the response.&amp;nbsp; So put some code from that blog into my kernel, with a few changes to account for the 3.14 kernel.&amp;nbsp; I'm running into a timeout when I try to load the scripts.&amp;nbsp; I noticed that the author of that blog wrote his own sdma_write_datamem function instead of using the sdma_load_script function.&amp;nbsp; I've tried both of these functions and they both result in a CH0 timeout.&amp;nbsp; I increased the timeout from 500uS to 10mS and it still timed out.&amp;nbsp; I added some debug messages to the sdma_load_script function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm trying to run the attached code snippet at the end of the sdma_probe function.&amp;nbsp; It uses CH0 to load a script and load a context, then uses CH1 to do a simple DMA transfer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The relevant dmesg out put is&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;**** This is the standard driver probe.&amp;nbsp; sdma_load_script is called and functions normally****&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;[&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.206708] imx-sdma 20ec000.sdma: no iram assigned, using external mem&lt;/P&gt;&lt;P&gt;[&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.206818] imx-sdma 20ec000.sdma: no event needs to be remapped&lt;/P&gt;&lt;P&gt;[&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.206862] imx-sdma 20ec000.sdma: sdma_load_script:&lt;/P&gt;&lt;P&gt;[&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.206873] imx-sdma 20ec000.sdma:&amp;nbsp;&amp;nbsp; src address: 0x805a43d4&lt;/P&gt;&lt;P&gt;[&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.206882] imx-sdma 20ec000.sdma:&amp;nbsp;&amp;nbsp; size: 1864&lt;/P&gt;&lt;P&gt;[&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.206889] imx-sdma 20ec000.sdma:&amp;nbsp;&amp;nbsp; dest address: 0x1800&lt;/P&gt;&lt;P&gt;[&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.207015] imx-sdma 20ec000.sdma: loaded firmware 3.1&lt;/P&gt;&lt;P&gt;[&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.210077] imx-sdma 20ec000.sdma: initialized&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;********* trying to load the custom script into 0xe00 and context for sdmac 1 into 0x820 **********************&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;[&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.210142] imx-sdma 20ec000.sdma: sdma_load_script:&lt;/P&gt;&lt;P&gt;[&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.210152] imx-sdma 20ec000.sdma:&amp;nbsp;&amp;nbsp; src address: 0x80576ae4&lt;/P&gt;&lt;P&gt;[&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.210160] imx-sdma 20ec000.sdma:&amp;nbsp;&amp;nbsp; size: 24&lt;/P&gt;&lt;P&gt;[&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.210168] imx-sdma 20ec000.sdma:&amp;nbsp;&amp;nbsp; dest address: 0xe00&lt;/P&gt;&lt;P&gt;[&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.221998] imx-sdma 20ec000.sdma: sdma_run_channel0 Timeout waiting for CH0 ready&lt;/P&gt;&lt;P&gt;[&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.222118] imx-sdma 20ec000.sdma: sdma_load_script:&lt;/P&gt;&lt;P&gt;[&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.222129] imx-sdma 20ec000.sdma:&amp;nbsp;&amp;nbsp; src address: 0x8c079200&lt;/P&gt;&lt;P&gt;[&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.222138] imx-sdma 20ec000.sdma:&amp;nbsp;&amp;nbsp; size: 128&lt;/P&gt;&lt;P&gt;[&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.222145] imx-sdma 20ec000.sdma:&amp;nbsp;&amp;nbsp; dest address: 0x820&lt;/P&gt;&lt;P&gt;[&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.233958] imx-sdma 20ec000.sdma: sdma_run_channel0 Timeout waiting for CH0 ready&lt;/P&gt;&lt;P&gt;[&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.234024] imx-sdma 20ec000.sdma: Failed to load context&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas on why I can't load the scripts into memory?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Dec 2015 21:50:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Custom-SDMA-script-to-convert-bayer-image/m-p/453279#M70525</guid>
      <dc:creator>chrisroed</dc:creator>
      <dc:date>2015-12-01T21:50:24Z</dc:date>
    </item>
    <item>
      <title>Re: Custom SDMA script to convert bayer image</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Custom-SDMA-script-to-convert-bayer-image/m-p/453280#M70526</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Igor,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It looks like after the first usage of sdma_run_channel0 to load the firmware file, the HE[0] bit is never set.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Both functions are calling the sdma_run_channel0, so why is only the first try enabling the HE[0] bit?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.206740] imx-sdma 20ec000.sdma: no iram assigned, using external mem&lt;/P&gt;&lt;P&gt;[&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.206851] imx-sdma 20ec000.sdma: no event needs to be remapped&lt;/P&gt;&lt;P&gt;[&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.206931] imx-sdma 20ec000.sdma: HE: 0x1&lt;/P&gt;&lt;P&gt;[&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.206941] imx-sdma 20ec000.sdma: EO: 0x1&lt;/P&gt;&lt;P&gt;[&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.206950] imx-sdma 20ec000.sdma: DO: 0xffffffff&lt;/P&gt;&lt;P&gt;[&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.206957] imx-sdma 20ec000.sdma: HO: 0x0&lt;/P&gt;&lt;P&gt;[&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.207009] imx-sdma 20ec000.sdma: loaded firmware 3.1&lt;/P&gt;&lt;P&gt;[&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.210025] imx-sdma 20ec000.sdma: initialized&lt;/P&gt;&lt;P&gt;[&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.210087] imx-sdma 20ec000.sdma: sdma_write_datamem:&lt;/P&gt;&lt;P&gt;[&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.210128] imx-sdma 20ec000.sdma: HE: 0x0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;[&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.210138] imx-sdma 20ec000.sdma: EO: 0x1&lt;/P&gt;&lt;P&gt;[&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.210146] imx-sdma 20ec000.sdma: DO: 0xffffffff&lt;/P&gt;&lt;P&gt;[&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.210155] imx-sdma 20ec000.sdma: HO: 0x0&lt;/P&gt;&lt;P&gt;[&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.221963] imx-sdma 20ec000.sdma: sdma_run_channel0 Timeout waiting for CH0 ready&lt;/P&gt;&lt;P&gt;[&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.222019] imx-sdma 20ec000.sdma: sdma_write_datamem:&lt;/P&gt;&lt;P&gt;[&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.222057] imx-sdma 20ec000.sdma: HE: 0x0&lt;/P&gt;&lt;P&gt;[&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.222066] imx-sdma 20ec000.sdma: EO: 0x1&lt;/P&gt;&lt;P&gt;[&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.222075] imx-sdma 20ec000.sdma: DO: 0xffffffff&lt;/P&gt;&lt;P&gt;[&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.222082] imx-sdma 20ec000.sdma: HO: 0x0&lt;/P&gt;&lt;P&gt;[&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.233805] imx-sdma 20ec000.sdma: sdma_run_channel0 Timeout waiting for CH0 ready&lt;/P&gt;&lt;P&gt;[&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.233818] imx-sdma 20ec000.sdma: Failed to load context&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Dec 2015 01:36:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Custom-SDMA-script-to-convert-bayer-image/m-p/453280#M70526</guid>
      <dc:creator>chrisroed</dc:creator>
      <dc:date>2015-12-02T01:36:34Z</dc:date>
    </item>
    <item>
      <title>Re: Custom SDMA script to convert bayer image</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Custom-SDMA-script-to-convert-bayer-image/m-p/453281#M70527</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A class="jx-jive-macro-user" href="https://community.nxp.com/people/igorpadykov"&gt;igorpadykov&lt;/A&gt;​&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It turns out I needed to enable the clocks before letting the channels run... :-). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So now that I'm able to load and run a script, from kernel space, I need to be able to load scripts and modify contexts from user space.&amp;nbsp; You said earlier that applications should be able to load scripts, so do you have any examples of this or know how to set this up? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Dec 2015 19:33:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Custom-SDMA-script-to-convert-bayer-image/m-p/453281#M70527</guid>
      <dc:creator>chrisroed</dc:creator>
      <dc:date>2015-12-03T19:33:40Z</dc:date>
    </item>
  </channel>
</rss>

