<?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: i.MX8MP - Performance issue when sharing G2D buffers between V4L2 and OpenGL in i.MX Graphics</title>
    <link>https://community.nxp.com/t5/i-MX-Graphics/i-MX8MP-Performance-issue-when-sharing-G2D-buffers-between-V4L2/m-p/2155488#M928</link>
    <description>&lt;P&gt;Thank you for your answer. I am using an i.MX8MP.&lt;BR /&gt;&lt;BR /&gt;If there are no limitation, would you have some suggestion on how to do it correctly ? We thought that the resolution of 4048x3040 (12MP) might be a bit too high, and some internal transfer (DMA or not) could cause the framerate drop that we notice.&lt;/P&gt;</description>
    <pubDate>Wed, 20 Aug 2025 19:41:07 GMT</pubDate>
    <dc:creator>gaelp</dc:creator>
    <dc:date>2025-08-20T19:41:07Z</dc:date>
    <item>
      <title>i.MX8MP - Performance issue when sharing G2D buffers between V4L2 and OpenGL</title>
      <link>https://community.nxp.com/t5/i-MX-Graphics/i-MX8MP-Performance-issue-when-sharing-G2D-buffers-between-V4L2/m-p/2155379#M926</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I am facing an issue when sharing&amp;nbsp;a G2D buffer from V4L2 directly to OpenGL (GPU&amp;nbsp;GC7000UL) with a high resolution (4048 x 3040 : 12 MP).&lt;/P&gt;&lt;P&gt;Here is the pseudo-code of my application.&lt;/P&gt;&lt;P&gt;I am allocating g2d_buffers (4048x3040 in YUYV) and saving the file descriptor.&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;struct g2d_buf *_srcBuf = g2d_alloc&lt;/SPAN&gt;&lt;SPAN&gt;(4048 * 3040 * 2&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;true&lt;/SPAN&gt;&lt;SPAN&gt;); // cacheable&lt;BR /&gt;int g2d_src_buf_fds = g2d_buf_export_fd(&amp;amp;_srcBuf);&lt;BR /&gt;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;Then I use this g2d filedescriptor to get the video frame from a camera device using V4L2.&lt;/P&gt;&lt;PRE&gt;struct v4l2_buffer buf;&lt;BR /&gt;buf.memory = V4L2_MEMORY_DMABUF;&lt;BR /&gt;buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;&lt;BR /&gt;buf.m.fd = g2d_src_buf_fds;&lt;BR /&gt;&lt;BR /&gt;[...]&lt;BR /&gt;ioctl(cam-&amp;gt;fd, VIDIOC_QBUF, &amp;amp;buf);&lt;BR /&gt;[...]&lt;BR /&gt;ioctl(cam-&amp;gt;fd, VIDIOC_DQBUF, &amp;amp;buf);&lt;BR /&gt;&lt;BR /&gt;// DMA sync operations&lt;BR /&gt;struct dma_buf_sync sync = { 0 };&lt;BR /&gt;sync.flags = DMA_BUF_SYNC_START; ioctl(buf_fd, DMA_BUF_IOCTL_SYNC, &amp;amp;sync);&lt;BR /&gt;sync.flags = DMA_BUF_SYNC_END ;  ioctl(buf_fd, DMA_BUF_IOCTL_SYNC, &amp;amp;sync);&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;On the OpenGL side, we use the Vivante extension to connect to the G2D buffer.&lt;/P&gt;&lt;PRE&gt;p_glTexDirectVIVMap( GL_TEXTURE_2D,&lt;BR /&gt;4048,&lt;BR /&gt;3040,&lt;BR /&gt;GL_VIV_YUY2,&lt;BR /&gt;&amp;amp;&lt;SPAN&gt;_srcBuf&lt;/SPAN&gt;-&amp;gt;buf_vaddr, // virtual address&lt;BR /&gt;(void **)&amp;amp;&lt;SPAN&gt;_srcBuf&lt;/SPAN&gt;-&amp;gt;buf_paddr // physical address );&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The workflow works fine since we are able to display the image at the output of OpenGL and with a correct framerate (30FPS, which is the camera framerate) but only with low resolution (for example 800x600).&lt;/P&gt;&lt;P&gt;If we increase the resolution up to 12MP, then we are slowly seeing the framerate dropping (it drops to 19FPS when we use the full resolution of 4048 x 3040 : 12MP).&lt;BR /&gt;&lt;BR /&gt;Would you have any suggestion on how to share the g2d buffer with high resolution or would you have any idea what my issue can be ?&lt;BR /&gt;&lt;BR /&gt;Thanks for your help.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Aug 2025 15:32:45 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Graphics/i-MX8MP-Performance-issue-when-sharing-G2D-buffers-between-V4L2/m-p/2155379#M926</guid>
      <dc:creator>gaelp</dc:creator>
      <dc:date>2025-08-20T15:32:45Z</dc:date>
    </item>
    <item>
      <title>Re: i.MX8MP - Performance issue when sharing G2D buffers between V4L2 and OpenGL</title>
      <link>https://community.nxp.com/t5/i-MX-Graphics/i-MX8MP-Performance-issue-when-sharing-G2D-buffers-between-V4L2/m-p/2155417#M927</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;Which device are you using?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;With i.MX6 there are some issue regarding applications like your but with i.MX8 there is none.&lt;/P&gt;
&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Wed, 20 Aug 2025 16:47:17 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Graphics/i-MX8MP-Performance-issue-when-sharing-G2D-buffers-between-V4L2/m-p/2155417#M927</guid>
      <dc:creator>Bio_TICFSL</dc:creator>
      <dc:date>2025-08-20T16:47:17Z</dc:date>
    </item>
    <item>
      <title>Re: i.MX8MP - Performance issue when sharing G2D buffers between V4L2 and OpenGL</title>
      <link>https://community.nxp.com/t5/i-MX-Graphics/i-MX8MP-Performance-issue-when-sharing-G2D-buffers-between-V4L2/m-p/2155488#M928</link>
      <description>&lt;P&gt;Thank you for your answer. I am using an i.MX8MP.&lt;BR /&gt;&lt;BR /&gt;If there are no limitation, would you have some suggestion on how to do it correctly ? We thought that the resolution of 4048x3040 (12MP) might be a bit too high, and some internal transfer (DMA or not) could cause the framerate drop that we notice.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Aug 2025 19:41:07 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Graphics/i-MX8MP-Performance-issue-when-sharing-G2D-buffers-between-V4L2/m-p/2155488#M928</guid>
      <dc:creator>gaelp</dc:creator>
      <dc:date>2025-08-20T19:41:07Z</dc:date>
    </item>
    <item>
      <title>Re: i.MX8MP - Performance issue when sharing G2D buffers between V4L2 and OpenGL</title>
      <link>https://community.nxp.com/t5/i-MX-Graphics/i-MX8MP-Performance-issue-when-sharing-G2D-buffers-between-V4L2/m-p/2156126#M930</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;For 2D&amp;nbsp;32K x 32K coordinate system, but the buffers depend of RAM, so there should not be an issue there. so send us your application code to reproduce it here and check it.&lt;/P&gt;
&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Thu, 21 Aug 2025 14:12:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Graphics/i-MX8MP-Performance-issue-when-sharing-G2D-buffers-between-V4L2/m-p/2156126#M930</guid>
      <dc:creator>Bio_TICFSL</dc:creator>
      <dc:date>2025-08-21T14:12:55Z</dc:date>
    </item>
    <item>
      <title>Re: i.MX8MP - Performance issue when sharing G2D buffers between V4L2 and OpenGL</title>
      <link>https://community.nxp.com/t5/i-MX-Graphics/i-MX8MP-Performance-issue-when-sharing-G2D-buffers-between-V4L2/m-p/2158980#M931</link>
      <description>&lt;P&gt;Sorry for the late answer.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Our performance issue seems to be related to the process of getting the image off the GPU to the CPU with the glReadPixels function that we are using.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;We might improve this process by using the eglSwapBuffers which should solve our performance issue.&lt;BR /&gt;&lt;BR /&gt;Any information about that or special way of doing that on iMX8MP ?&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Aug 2025 08:31:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Graphics/i-MX8MP-Performance-issue-when-sharing-G2D-buffers-between-V4L2/m-p/2158980#M931</guid>
      <dc:creator>gaelp</dc:creator>
      <dc:date>2025-08-27T08:31:53Z</dc:date>
    </item>
    <item>
      <title>Re: i.MX8MP - Performance issue when sharing G2D buffers between V4L2 and OpenGL</title>
      <link>https://community.nxp.com/t5/i-MX-Graphics/i-MX8MP-Performance-issue-when-sharing-G2D-buffers-between-V4L2/m-p/2175820#M950</link>
      <description>&lt;P&gt;If it might help someone, the solution we found was to copy the image from GPU 3D to the CPU by using the G2D device.&lt;/P&gt;&lt;P&gt;Our pipeline is now :&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;V4L2 -&amp;gt; GPU 3D : data transfered using DMA buffers&lt;/LI&gt;&lt;LI&gt;GPU 3D renders in a G2D buffer&lt;/LI&gt;&lt;LI&gt;G2D -&amp;gt; CPU : We use a g2d_copy to get the data in the CPU&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Using this pipeline, we can capture a video of 12MP and process it at 30FPS.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Sep 2025 12:42:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Graphics/i-MX8MP-Performance-issue-when-sharing-G2D-buffers-between-V4L2/m-p/2175820#M950</guid>
      <dc:creator>gaelp</dc:creator>
      <dc:date>2025-09-25T12:42:18Z</dc:date>
    </item>
  </channel>
</rss>

