<?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>topic Re: How to fix the color format for CSI Test generation mode in i.MX Processors</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/How-to-fix-the-color-format-for-CSI-Test-generation-mode/m-p/415148#M62353</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Issac,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; For RGB565 data, you should capture it by GENERIC mode .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; please refter to this link !&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;&lt;A _jive_internal="true" data-containerid="35553" data-containertype="2020" data-objectid="97981" data-objecttype="102" href="https://community.nxp.com/docs/DOC-97981"&gt;https://community.freescale.com/docs/DOC-97981&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;weidong&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 09 Jun 2015 03:33:50 GMT</pubDate>
    <dc:creator>weidong_sun</dc:creator>
    <dc:date>2015-06-09T03:33:50Z</dc:date>
    <item>
      <title>How to fix the color format for CSI Test generation mode</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/How-to-fix-the-color-format-for-CSI-Test-generation-mode/m-p/415147#M62352</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to capture the CSI test generated checkboard image on i.MX6 using GStreamer on Kernel 3.10.17. The doc I am using is Freescale BSP Porting Guide, Chapter 7.1.3 (Configuring the CSI Unit in Test Mode).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To enable the Capture mode, I've added the following settings in &lt;STRONG&gt;ipu_csi_init_interface&lt;/STRONG&gt; function of &lt;STRONG&gt;drivers/mxc/ipu3/ipu_capture.c&lt;/STRONG&gt;:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;cfg_param.data_width = 0x1;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;cfg_param.ext_vsync = 0x1;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;cfg_param.data_fmt = 0x0;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;cfg_param.pack_tight = 0x0;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;cfg_param.clk_mode = 0x1;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;cfg_param.pixclk_pol = 0x1;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;cfg_param.data_pol = 0x0;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;cfg_param.Hsync_pol = 0x0;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;cfg_param.Vsync_pol = 0x0;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and called &lt;STRONG&gt;_ipu_csi_set_test_generator&lt;/STRONG&gt; to setup clock and RGB values of squares in output the pattern:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;_ipu_csi_set_test_generator(ipu, true, 255, 0, 0, uint32_t pixelClock = clk_get_rate(ipu-&amp;gt;ipu_clk)/8, csi);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note I have set /8 for the divider. If I omit the /8 division (which eventually causes the &lt;STRONG&gt;CSI0_DIV_RATIO&lt;/STRONG&gt; to be set to zero, as the FSL Porting Guide have asked), it will caught in a loop and the dmesg shows (with DEBUG flag enabled) many "&lt;STRONG&gt;In MVC:camera_callback&lt;/STRONG&gt;" message. With /8 division present, I can capture the test image by the following command, but their color seems to be incorrect:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;gst-launch mfw_v4lsrc num-buffers=1 !&amp;nbsp; jpegenc ! filesink location=sample.jpeg&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is an output image when I set 255,0,0 as RGB values for the test pattern:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="255,0,0.jpeg"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/28299iD4E66DF03ACE5117/image-size/large?v=v2&amp;amp;px=999" role="button" title="255,0,0.jpeg" alt="255,0,0.jpeg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And here is the one for 255,255,255:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="255,255,255.jpeg"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/28741i3F798533D4220318/image-size/large?v=v2&amp;amp;px=999" role="button" title="255,255,255.jpeg" alt="255,255,255.jpeg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've adapted the OV5640 sensor driver (commented out I2C-related parts) and the sensor is recognized as v4l2 slave. The sensor pixelformat is set to &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;ov5640_data.pix.pixelformat = V4L2_PIX_FMT_YUYV;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;in the ov5640_probe file. I've tried other video formats like V4L2_PIX_FMT_YYUV, V4L2_PIX_FMT_YVYU, etc, but they either caused "Internal data flow error" in Gstreamer or didn't make any difference.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It has been stated in BSP Porting guide:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN style="font-family: TimesLTStd-Roman; font-size: 14pt; color: #000000; font-style: normal;"&gt;Change &lt;SPAN style="font-family: TimesLTStd-Roman; font-size: 14pt; color: #000000; font-style: normal;"&gt;the sensor pixel format from YUV to RGB565 in the ipu_bg_overlay_sdc.c file so that &lt;SPAN style="font-family: TimesLTStd-Roman; font-size: 14pt; color: #000000; font-style: normal;"&gt;the image converter will not perform color space conversion and the input received from &lt;SPAN style="font-family: TimesLTStd-Roman; font-size: 14pt; color: #000000; font-style: normal;"&gt;the CSI test mode generator will be sent directly to the memory.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried changing the following settings to &lt;STRONG&gt;IPU_PIX_FMT_RGB565&lt;/STRONG&gt; in ipu_bg_overlay_sdc.c but that doesn't have any effect:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;task.input.format = IPU_PIX_FMT_UYVY;&amp;nbsp; (csi_buf_work_func function)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;pixel_fmt = IPU_PIX_FMT_UYVY; (csi_enc_callback function)&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Jun 2015 08:56:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/How-to-fix-the-color-format-for-CSI-Test-generation-mode/m-p/415147#M62352</guid>
      <dc:creator>isaacnickaein</dc:creator>
      <dc:date>2015-06-01T08:56:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to fix the color format for CSI Test generation mode</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/How-to-fix-the-color-format-for-CSI-Test-generation-mode/m-p/415148#M62353</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Issac,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; For RGB565 data, you should capture it by GENERIC mode .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; please refter to this link !&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;&lt;A _jive_internal="true" data-containerid="35553" data-containertype="2020" data-objectid="97981" data-objecttype="102" href="https://community.nxp.com/docs/DOC-97981"&gt;https://community.freescale.com/docs/DOC-97981&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;weidong&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Jun 2015 03:33:50 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/How-to-fix-the-color-format-for-CSI-Test-generation-mode/m-p/415148#M62353</guid>
      <dc:creator>weidong_sun</dc:creator>
      <dc:date>2015-06-09T03:33:50Z</dc:date>
    </item>
  </channel>
</rss>

