<?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: Problems with G2D API</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/Problems-with-G2D-API/m-p/1363655#M182301</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;thank you for that !&lt;/P&gt;&lt;P&gt;I thought the RGBs format contains the RGB888 format.&lt;/P&gt;</description>
    <pubDate>Fri, 29 Oct 2021 05:16:33 GMT</pubDate>
    <dc:creator>christhi</dc:creator>
    <dc:date>2021-10-29T05:16:33Z</dc:date>
    <item>
      <title>Problems with G2D API</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Problems-with-G2D-API/m-p/1362352#M182200</link>
      <description>&lt;P&gt;Hi everybody,&lt;/P&gt;&lt;P&gt;I use the I.MX 8M Plus with Hardknott Yocto.&lt;/P&gt;&lt;P&gt;I have a problem understanding and using the G2D API. I try to implement the following:&lt;/P&gt;&lt;P&gt;Input Image ( ARGB32 format, Size(x1,y1)&amp;nbsp; ) should be converted to Output Image ( RGB format, Size(x2, y2) )&lt;/P&gt;&lt;P&gt;I create the input and output buffers and surfaces in the constructor like that:&lt;/P&gt;&lt;PRE&gt;g2dInputBuffer  &lt;SPAN&gt;=&lt;/SPAN&gt; g2d_alloc(m_inputCameraFormat&lt;SPAN&gt;.&lt;/SPAN&gt;height &lt;SPAN&gt;*&lt;/SPAN&gt; m_inputCameraFormat&lt;SPAN&gt;.&lt;/SPAN&gt;width &lt;SPAN&gt;*&lt;/SPAN&gt; &lt;SPAN&gt;4&lt;/SPAN&gt;, &lt;SPAN&gt;1&lt;/SPAN&gt;);&lt;BR /&gt;    g2dOutputBuffer &lt;SPAN&gt;=&lt;/SPAN&gt; g2d_alloc(m_modelInputInformations&lt;SPAN&gt;.&lt;/SPAN&gt;height &lt;SPAN&gt;*&lt;/SPAN&gt; m_modelInputInformations&lt;SPAN&gt;.&lt;/SPAN&gt;width &lt;SPAN&gt;*&lt;/SPAN&gt; &lt;SPAN&gt;3&lt;/SPAN&gt;, &lt;SPAN&gt;1&lt;/SPAN&gt;);&lt;BR /&gt;    inputSurface &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;new&lt;/SPAN&gt; &lt;SPAN&gt;g2d_surface&lt;/SPAN&gt;();&lt;BR /&gt;    inputSurface-&amp;gt;format &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;G2D_XRGB8888&lt;/SPAN&gt;;   &lt;BR /&gt;    inputSurface-&amp;gt;left &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;0&lt;/SPAN&gt;;&lt;BR /&gt;    inputSurface-&amp;gt;top &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;0&lt;/SPAN&gt;;     &lt;BR /&gt;    inputSurface-&amp;gt;right &lt;SPAN&gt;=&lt;/SPAN&gt; m_inputCameraFormat.width;&lt;BR /&gt;    inputSurface-&amp;gt;bottom &lt;SPAN&gt;=&lt;/SPAN&gt; m_inputCameraFormat.height;&lt;BR /&gt;    inputSurface-&amp;gt;stride &lt;SPAN&gt;=&lt;/SPAN&gt; m_inputCameraFormat.width;&lt;BR /&gt;    inputSurface-&amp;gt;width &lt;SPAN&gt;=&lt;/SPAN&gt; m_inputCameraFormat.width;&lt;BR /&gt;    inputSurface-&amp;gt;height &lt;SPAN&gt;=&lt;/SPAN&gt; m_inputCameraFormat.height;&lt;BR /&gt;    inputSurface-&amp;gt;rot &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;G2D_ROTATION_0&lt;/SPAN&gt;;&lt;BR /&gt;&lt;BR /&gt;    outputSurface &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;new&lt;/SPAN&gt; &lt;SPAN&gt;g2d_surface&lt;/SPAN&gt;();&lt;BR /&gt;    outputSurface-&amp;gt;format &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;G2D_RGB888&lt;/SPAN&gt;;&lt;BR /&gt;    outputSurface-&amp;gt;left &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;0&lt;/SPAN&gt;;&lt;BR /&gt;    outputSurface-&amp;gt;top &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;0&lt;/SPAN&gt;;&lt;BR /&gt;    outputSurface-&amp;gt;right &lt;SPAN&gt;=&lt;/SPAN&gt; m_modelInputInformations.width;&lt;BR /&gt;    outputSurface-&amp;gt;bottom &lt;SPAN&gt;=&lt;/SPAN&gt; m_modelInputInformations.height;&lt;BR /&gt;    outputSurface-&amp;gt;stride &lt;SPAN&gt;=&lt;/SPAN&gt; m_modelInputInformations.width; &lt;BR /&gt;    outputSurface-&amp;gt;width &lt;SPAN&gt;=&lt;/SPAN&gt; m_modelInputInformations.width;&lt;BR /&gt;    outputSurface-&amp;gt;height &lt;SPAN&gt;=&lt;/SPAN&gt; m_modelInputInformations.height;&lt;BR /&gt;    outputSurface-&amp;gt;rot &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;G2D_ROTATION_0&lt;/SPAN&gt;;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After that I want the converting for every incoming input frame like that:&lt;/P&gt;&lt;PRE&gt;    &lt;SPAN&gt;void&lt;/SPAN&gt; *&lt;SPAN&gt;handle&lt;/SPAN&gt; = &lt;SPAN&gt;nullptr&lt;/SPAN&gt;;&lt;BR /&gt;    g2d_open(&lt;SPAN&gt;&amp;amp;&lt;/SPAN&gt;&lt;SPAN&gt;handle&lt;/SPAN&gt;);&lt;BR /&gt;    g2dInputBuffer-&amp;gt;buf_vaddr &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;const_cast&lt;/SPAN&gt;&amp;lt;&lt;SPAN&gt;void&lt;/SPAN&gt;*&amp;gt;(&lt;SPAN&gt;inputBuffer&lt;/SPAN&gt;);&lt;BR /&gt;    inputSurface-&amp;gt;planes[&lt;SPAN&gt;0&lt;/SPAN&gt;] &lt;SPAN&gt;=&lt;/SPAN&gt; g2dInputBuffer-&amp;gt;buf_paddr;&lt;BR /&gt;    outputSurface-&amp;gt;planes[&lt;SPAN&gt;0&lt;/SPAN&gt;] &lt;SPAN&gt;=&lt;/SPAN&gt; g2dOutputBuffer-&amp;gt;buf_paddr;&lt;BR /&gt;    g2d_blit(&lt;SPAN&gt;handle&lt;/SPAN&gt;, &lt;SPAN&gt;inputSurface&lt;/SPAN&gt;, &lt;SPAN&gt;outputSurface&lt;/SPAN&gt;);&lt;BR /&gt;    g2d_close(&lt;SPAN&gt;handle&lt;/SPAN&gt;);&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I get the following error message: g2d_blit_2d, line1397: Invalid dst format 10!&lt;/P&gt;&lt;P&gt;Has anybody some help or advice?&lt;/P&gt;&lt;P&gt;Thank you !&lt;/P&gt;</description>
      <pubDate>Wed, 27 Oct 2021 09:58:20 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Problems-with-G2D-API/m-p/1362352#M182200</guid>
      <dc:creator>christhi</dc:creator>
      <dc:date>2021-10-27T09:58:20Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with G2D API</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Problems-with-G2D-API/m-p/1363294#M182262</link>
      <description>&lt;P&gt;Hello christhi,&lt;/P&gt;
&lt;P&gt;RGB888 is not supported for CSC. Supported SRC/DST CSC format can be found in&amp;nbsp;i.MX_Graphics_User's_Guide.pdf:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Bio_TICFSL_0-1635423072730.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/160600i5C236DBBE9DAB22D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Bio_TICFSL_0-1635423072730.png" alt="Bio_TICFSL_0-1635423072730.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;RGBs format: { (string)RGB16, (string)RGBx, (string)RGBA, (string)BGRA, (string)BGRx, (string)BGR16, (string)ARGB, (string)ABGR, (string)xRGB, (string)xBGR }&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Thu, 28 Oct 2021 12:11:31 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Problems-with-G2D-API/m-p/1363294#M182262</guid>
      <dc:creator>Bio_TICFSL</dc:creator>
      <dc:date>2021-10-28T12:11:31Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with G2D API</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Problems-with-G2D-API/m-p/1363655#M182301</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;thank you for that !&lt;/P&gt;&lt;P&gt;I thought the RGBs format contains the RGB888 format.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Oct 2021 05:16:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Problems-with-G2D-API/m-p/1363655#M182301</guid>
      <dc:creator>christhi</dc:creator>
      <dc:date>2021-10-29T05:16:33Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with G2D API</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Problems-with-G2D-API/m-p/1363806#M182316</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;is it possible to "delete" the alpha channel from the RGBA8888 image using only the G2D API? I need a RGB888 image and at this moment I use the sharing buffers mechanism. For scaling I use the g2d API and after that I convert the image to RGB888 using OpenCV. Because I can't use OpenCV for GPU acceleration I would prefer only using the G2D API.&lt;/P&gt;&lt;P&gt;Thank you for your help !&lt;/P&gt;</description>
      <pubDate>Fri, 29 Oct 2021 09:23:09 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Problems-with-G2D-API/m-p/1363806#M182316</guid>
      <dc:creator>christhi</dc:creator>
      <dc:date>2021-10-29T09:23:09Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with G2D API</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Problems-with-G2D-API/m-p/1392721#M185121</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;From this table, I understand that all the formats from src column can be converted to RGB.&lt;/P&gt;&lt;P&gt;Regarding to RGB888, IMX Graphics user guide mentions:&lt;/P&gt;&lt;P&gt;• RGB pixel buffer only uses planes [0], buffer address is with 16 bytes alignment on i.MX 6 (except i.MX 6Quad Plus), 1 pixel alignment on i.MX 6Quad Plus, i.MX 7ULP and i.MX 8 family devices.&lt;BR /&gt;• NV12: Y in planes [0], UV in planes [1], with 64bytes alignment,&lt;BR /&gt;• I420: Y in planes [0], U in planes [1], U in planes [2], with 64 bytes alignment&lt;BR /&gt;• The cropped region in source surface is specified with left, top, right and bottom parameters.&lt;BR /&gt;• RGB stride alignment is 16 bytes on i.MX 6 (except i.MX 6Quad Plus), 1 pixel alignment on i.MX 6Quad Plus, i.MX 7ULP and i.MX 8 family devices, both for source and destination surface.&lt;BR /&gt;....&lt;/P&gt;&lt;P&gt;If I understood correctly, i.MX 6 (except i.MX 6Quad Plus) only support 16/32 bits RGB. However other IMX that uses G2D doesn't have this limitation, only requires pixel alignment that can be 8/16/24/32 bits. In this case, RGB888 should work.&lt;/P&gt;&lt;P&gt;Am I wrong?&lt;/P&gt;&lt;P&gt;Thanks for you support&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Dec 2021 16:33:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Problems-with-G2D-API/m-p/1392721#M185121</guid>
      <dc:creator>quercuspau</dc:creator>
      <dc:date>2021-12-28T16:33:10Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with G2D API</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Problems-with-G2D-API/m-p/1599441#M201527</link>
      <description>&lt;P&gt;Hi Christhi,&lt;BR /&gt;Could you solve this issue.&lt;BR /&gt;I am using imx8mp CPU and YUYV to RGB G2D conversion can only output RGBs8888 (32bit).&lt;BR /&gt;Like you I need RGB888 (24bit). I don't want to use OpenCV or other processing. I would like to do this entirely in the GPU.&lt;BR /&gt;Thank you,&lt;/P&gt;</description>
      <pubDate>Wed, 15 Feb 2023 08:41:17 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Problems-with-G2D-API/m-p/1599441#M201527</guid>
      <dc:creator>malik_cisse</dc:creator>
      <dc:date>2023-02-15T08:41:17Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with G2D API</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Problems-with-G2D-API/m-p/2010595#M231745</link>
      <description>Hi, There was a problem with the g2d module, My board is IMX8QM,&amp;nbsp;Linux version 5.4.129-5.4.0-devel+git.cb88cc157bfb (oe-user@oe-host) (gcc version 9.3.0 (GCC)) #1 SMP PREEMPT Wed Sep 29 18:17:21 UTC 2021.&lt;BR /&gt;&lt;BR /&gt;My code as follow, All api return is success, but&amp;nbsp;output_buffer-&amp;gt;buf_vaddr&amp;nbsp;value is 0.&lt;BR /&gt;&lt;BR /&gt;Could you help me to solve this problem? Thank you~&lt;BR /&gt;&lt;BR /&gt;g2d_buf* input_buffer = nullptr;&lt;BR /&gt;g2d_buf* output_buffer = nullptr;&lt;BR /&gt;void* g2d_handle = nullptr;&lt;BR /&gt;g2d_surface* src_surface = new g2d_surface;&lt;BR /&gt;g2d_surface* dst_surface = new g2d_surface;&lt;BR /&gt;g2d_open(&amp;amp;g2d_handle);&lt;BR /&gt;input_buffer = g2d_alloc(1280*800*4, 1);&lt;BR /&gt;output_buffer = g2d_alloc(1280*800*4, 1);&lt;BR /&gt;FILE* fp = fopen("/home/root/user_test/P118_1280x800-32_0001_FB152.rgb", "rb");&lt;BR /&gt;if(fp != nullptr){&lt;BR /&gt;fread(input_buffer-&amp;gt;buf_vaddr, 1, input_buffer-&amp;gt;buf_size, fp);&lt;BR /&gt;fclose(fp);&lt;BR /&gt;}else{}&lt;BR /&gt;&lt;BR /&gt;memset(src_surface, 0, sizeof(g2d_surface));&lt;BR /&gt;memset(dst_surface, 0, sizeof(g2d_surface));&lt;BR /&gt;&lt;BR /&gt;src_surface-&amp;gt;planes[0] = input_buffer-&amp;gt;buf_paddr;&lt;BR /&gt;src_surface-&amp;gt;left = 0;&lt;BR /&gt;src_surface-&amp;gt;top = 0;&lt;BR /&gt;src_surface-&amp;gt;right = 1280;&lt;BR /&gt;src_surface-&amp;gt;bottom = 800;&lt;BR /&gt;src_surface-&amp;gt;stride = 1280;&lt;BR /&gt;src_surface-&amp;gt;width = 1280;&lt;BR /&gt;src_surface-&amp;gt;height = 800;&lt;BR /&gt;src_surface-&amp;gt;rot = G2D_ROTATION_0;&lt;BR /&gt;src_surface-&amp;gt;format = G2D_RGBX8888;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;dst_surface-&amp;gt;planes[0] = input_buffer-&amp;gt;buf_paddr;&lt;BR /&gt;dst_surface-&amp;gt;left = 0;&lt;BR /&gt;dst_surface-&amp;gt;top = 0;&lt;BR /&gt;dst_surface-&amp;gt;right = 1280;&lt;BR /&gt;dst_surface-&amp;gt;bottom = 800;&lt;BR /&gt;dst_surface-&amp;gt;stride = 1280;&lt;BR /&gt;dst_surface-&amp;gt;width = 1280;&lt;BR /&gt;dst_surface-&amp;gt;height = 800;&lt;BR /&gt;dst_surface-&amp;gt;rot = G2D_ROTATION_0;&lt;BR /&gt;dst_surface-&amp;gt;format = G2D_RGBX8888;&lt;BR /&gt;&lt;BR /&gt;std::cout &amp;lt;&amp;lt; input_buffer &amp;lt;&amp;lt; " " &amp;lt;&amp;lt; input_buffer-&amp;gt;buf_size &amp;lt;&amp;lt; " " &amp;lt;&amp;lt; input_buffer-&amp;gt;buf_vaddr &amp;lt;&amp;lt; std::endl;&lt;BR /&gt;&lt;BR /&gt;std::cout &amp;lt;&amp;lt; g2d_blit(g2d_handle, src_surface, dst_surface) &amp;lt;&amp;lt; std::endl;&lt;BR /&gt;std::cout &amp;lt;&amp;lt; g2d_finish(g2d_handle) &amp;lt;&amp;lt; std::endl;&lt;BR /&gt;&lt;BR /&gt;fp = fopen("/home/root/user_test/P118_1280x800-32_0001_FB152-test111.rgb", "wb");&lt;BR /&gt;if(fp != nullptr){&lt;BR /&gt;std::cout &amp;lt;&amp;lt; fwrite(output_buffer-&amp;gt;buf_vaddr, 1, 1280*800*4, fp) &amp;lt;&amp;lt; std::endl ;&lt;BR /&gt;fclose(fp);&lt;BR /&gt;}else{}&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 10 Dec 2024 02:08:32 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Problems-with-G2D-API/m-p/2010595#M231745</guid>
      <dc:creator>ZHIYUANSONG</dc:creator>
      <dc:date>2024-12-10T02:08:32Z</dc:date>
    </item>
  </channel>
</rss>

