AnsweredAssumed Answered

IPU YUYV->NV12 calls back too early causing image tearing

Question asked by Dave McMordie on May 31, 2019
Latest reply on Jun 28, 2019 by Joan Xie

We have a system with 4 simultaneous video streams ( 2 YUYV + 2 GREY) flowing via MIPI from our FPGA to the i.mx6q (linux 3.14.38+).  On the two YUYV channels (which are captured to NV12) we occasionally observe torn imaging in the lower half of the image, as though a cache line is bad, or a DMA operation is in progress.  When we insert a delay after capture, the problem disappears.  It looks to me like ipu_csi_enc is simply getting a callback before the entire IDMAC conversion (YUYV -> NV21) is complete, but I don't have deep enough knowledge of the IPU to know what to look at.  I did try forcing cache invalidates after capture and that did nothing.


Can anyone suggest a theory as to what could be going wrong and how to correct it (a sleep after frame capture is not acceptable).  What I am looking for is how to verify whether the IPU's interrupt logic is set up to fire at the correct time.


Here is a sample showing the kind of vsync/hsync jumping that I am calling tearing: