<?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 imxvideoconvert_g2d CMA issue when cropping in i.MX Processors</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/imxvideoconvert-g2d-CMA-issue-when-cropping/m-p/1530251#M195787</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am using this Gstreamer pipeline in QT5.&amp;nbsp;EGLFS platform plugin is used (no Wayland/weston):&lt;BR /&gt;&lt;EM&gt;descr = g_strdup_printf ("v4l2src name=video_source device=/dev/v4l/by-path/platform-vvcam-video.0-video-index0 ! video/x-raw, width=3840,height=2160 ! "&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;"&lt;STRONG&gt;videocrop name=video_crop ! imxvideoconvert_g2d&lt;/STRONG&gt; ! interpipesink name=src_1 sync=false ");&lt;/EM&gt;&lt;BR /&gt;I am dynamically zooming by setting videocrop parameters (left_crop, right_crop etc.)&amp;nbsp;&lt;/P&gt;&lt;P&gt;I eventually get this type of CMA related error and video stops playing:&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;[10337.440327] alloc_contig_range: [6d900, 6da77) PFNs busy&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;When searching for "alloc_contig_range:&amp;nbsp; PFNs busy" issue, one finds it is related to &lt;STRONG&gt;CMA&lt;/STRONG&gt;. here we find some more details about CMA:&lt;/P&gt;&lt;P&gt;&lt;A href="https://developer.toradex.com/linux-bsp/how-to/linux-features/contiguous-memory-allocator-cma-linux/" target="_blank"&gt;https://developer.toradex.com/linux-bsp/how-to/linux-features/contiguous-memory-allocator-cma-linux/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Further investigation show&amp;nbsp;&lt;STRONG&gt;the actual issue seems to be located in imxvideoconvert_g2d&lt;/STRONG&gt; (G2D GPU Accelerator) element.&lt;/P&gt;&lt;P&gt;When I check this command, videocrop plug-in doesn't crop image buffer itself. It's just set crop metadata and pass this information to imxvideoconvert_g2d. And imxvideoconvert_g2d plug-in check crop metadata about input image buffer and if it's not null, it crop image buffer.&lt;/P&gt;&lt;P&gt;The reason why videocrop plug-in doesn't crop image itself, it's running as in-place mode.&lt;/P&gt;&lt;P&gt;Thus, something must still be buggy in&amp;nbsp;imxvideoconvert_g2d but I could not figure out what it is. Checking source code and fixes did not help either:&lt;BR /&gt;&lt;A href="https://source.codeaurora.org/external/imx/imx-gst1.0-plugin/tree/plugins/videoconvert/gstimxvideoconvert.c?h=lf-5.15.32-2.0.0" target="_blank"&gt;https://source.codeaurora.org/external/imx/imx-gst1.0-plugin/tree/plugins/videoconvert/gstimxvideoconvert.c?h=lf-5.15.32-2.0.0&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Thx,&lt;/P&gt;</description>
    <pubDate>Thu, 29 Sep 2022 08:04:45 GMT</pubDate>
    <dc:creator>malik_cisse</dc:creator>
    <dc:date>2022-09-29T08:04:45Z</dc:date>
    <item>
      <title>imxvideoconvert_g2d CMA issue when cropping</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/imxvideoconvert-g2d-CMA-issue-when-cropping/m-p/1530251#M195787</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am using this Gstreamer pipeline in QT5.&amp;nbsp;EGLFS platform plugin is used (no Wayland/weston):&lt;BR /&gt;&lt;EM&gt;descr = g_strdup_printf ("v4l2src name=video_source device=/dev/v4l/by-path/platform-vvcam-video.0-video-index0 ! video/x-raw, width=3840,height=2160 ! "&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;"&lt;STRONG&gt;videocrop name=video_crop ! imxvideoconvert_g2d&lt;/STRONG&gt; ! interpipesink name=src_1 sync=false ");&lt;/EM&gt;&lt;BR /&gt;I am dynamically zooming by setting videocrop parameters (left_crop, right_crop etc.)&amp;nbsp;&lt;/P&gt;&lt;P&gt;I eventually get this type of CMA related error and video stops playing:&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;[10337.440327] alloc_contig_range: [6d900, 6da77) PFNs busy&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;When searching for "alloc_contig_range:&amp;nbsp; PFNs busy" issue, one finds it is related to &lt;STRONG&gt;CMA&lt;/STRONG&gt;. here we find some more details about CMA:&lt;/P&gt;&lt;P&gt;&lt;A href="https://developer.toradex.com/linux-bsp/how-to/linux-features/contiguous-memory-allocator-cma-linux/" target="_blank"&gt;https://developer.toradex.com/linux-bsp/how-to/linux-features/contiguous-memory-allocator-cma-linux/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Further investigation show&amp;nbsp;&lt;STRONG&gt;the actual issue seems to be located in imxvideoconvert_g2d&lt;/STRONG&gt; (G2D GPU Accelerator) element.&lt;/P&gt;&lt;P&gt;When I check this command, videocrop plug-in doesn't crop image buffer itself. It's just set crop metadata and pass this information to imxvideoconvert_g2d. And imxvideoconvert_g2d plug-in check crop metadata about input image buffer and if it's not null, it crop image buffer.&lt;/P&gt;&lt;P&gt;The reason why videocrop plug-in doesn't crop image itself, it's running as in-place mode.&lt;/P&gt;&lt;P&gt;Thus, something must still be buggy in&amp;nbsp;imxvideoconvert_g2d but I could not figure out what it is. Checking source code and fixes did not help either:&lt;BR /&gt;&lt;A href="https://source.codeaurora.org/external/imx/imx-gst1.0-plugin/tree/plugins/videoconvert/gstimxvideoconvert.c?h=lf-5.15.32-2.0.0" target="_blank"&gt;https://source.codeaurora.org/external/imx/imx-gst1.0-plugin/tree/plugins/videoconvert/gstimxvideoconvert.c?h=lf-5.15.32-2.0.0&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Thx,&lt;/P&gt;</description>
      <pubDate>Thu, 29 Sep 2022 08:04:45 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/imxvideoconvert-g2d-CMA-issue-when-cropping/m-p/1530251#M195787</guid>
      <dc:creator>malik_cisse</dc:creator>
      <dc:date>2022-09-29T08:04:45Z</dc:date>
    </item>
    <item>
      <title>Re: imxvideoconvert_g2d CMA issue when cropping</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/imxvideoconvert-g2d-CMA-issue-when-cropping/m-p/1530549#M195823</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;Which processor are you working on?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Thu, 29 Sep 2022 14:57:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/imxvideoconvert-g2d-CMA-issue-when-cropping/m-p/1530549#M195823</guid>
      <dc:creator>Bio_TICFSL</dc:creator>
      <dc:date>2022-09-29T14:57:21Z</dc:date>
    </item>
    <item>
      <title>Re: imxvideoconvert_g2d CMA issue when cropping</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/imxvideoconvert-g2d-CMA-issue-when-cropping/m-p/1530615#M195833</link>
      <description>&lt;P&gt;Sorry, I am on imx8m-plus platform using Kernel 5.4.70&lt;/P&gt;</description>
      <pubDate>Thu, 29 Sep 2022 16:17:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/imxvideoconvert-g2d-CMA-issue-when-cropping/m-p/1530615#M195833</guid>
      <dc:creator>malik_cisse</dc:creator>
      <dc:date>2022-09-29T16:17:27Z</dc:date>
    </item>
  </channel>
</rss>

