PxP and VSYNC; Image tearing

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

PxP and VSYNC; Image tearing

Jump to solution
3,082 Views
brandonschaefer
Contributor II

processor: i.MX7

kernel: 4.1.15

Hello,

I'm having issues preventing tearing to occur when displaying to an LCD panel. We are using pxp hardware via v4l2 output node to perform rotation of images and display them. I attempted to use FBIO_WAITFORVSYNC and MXCFB_WAIT_FOR_VSYNC, which didn't improve the tearing issue.

Does pxp hardware/driver handle syncing to LCDIF to prevent this issue? I know this issue can be solved by double buffering fb device and swapping pages, but I was hoping a similar solution could be possible using only v4l2 API and PxP.

EDIT: Seems like I need to configure pxp to output to a framebuffer device, though I'm still learning about PxP driver interface. Is this possible with v4l2 API or will I need to use /dev/pxp_device?

Let me know if my last assumption is incorrect, as I'd rather not make this more complicated than it needs to be. 

Thanks for the help,

Brandon

Labels (3)
Tags (3)
0 Kudos
1 Solution
1,715 Views
brandonschaefer
Contributor II

Thanks for your input James.

I had taken a look at these examples before asking this question. We had no issues getting the pxp_v4l2_test working, and the pxp_lib_test example seemed to be outdated and the display device was an EPD.

The correct solution to my issue I think would have been to use the PxP DMA driver, not the V4L2 driver. By doing so we could have avoided vsync issues by having PxP output to a double buffered fb with no modification to driver code. What I actually ended up doing was modify the V4L2 driver to achieve the same affect, which seems to work.

The reason I did not pursue the first solution further was because of issues using PxP DMA API where image was displayed distorted (many black lines where portions of the image was missing) and we'd already implemented using V4L2.

Brandon

View solution in original post

0 Kudos
6 Replies
1,715 Views
jamesbone
NXP TechSupport
NXP TechSupport

Hello Brandon,

Have you seen the examples available at unit tests (imx-test package),

pxp_lib_test, pxp_v4l2_test in imx-test-5.4.tar.gz

www.nxp.com/lgfiles/NMG/MAD/YOCTO/imx-test-5.4.tar.gz

I think you can find an example of what are you trying to accomplish with the Rotation.


Have a great day,
Jaime

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
1,716 Views
brandonschaefer
Contributor II

Thanks for your input James.

I had taken a look at these examples before asking this question. We had no issues getting the pxp_v4l2_test working, and the pxp_lib_test example seemed to be outdated and the display device was an EPD.

The correct solution to my issue I think would have been to use the PxP DMA driver, not the V4L2 driver. By doing so we could have avoided vsync issues by having PxP output to a double buffered fb with no modification to driver code. What I actually ended up doing was modify the V4L2 driver to achieve the same affect, which seems to work.

The reason I did not pursue the first solution further was because of issues using PxP DMA API where image was displayed distorted (many black lines where portions of the image was missing) and we'd already implemented using V4L2.

Brandon

0 Kudos
1,715 Views
Ananth
Contributor III

Hi Brandon Schaefer,

 We are facing similar issue, will you please share the patch done in v4l2 display driver to avoid screen tearing effect.

Thanks and regards,

Ananth

0 Kudos
1,715 Views
brandonschaefer
Contributor II

We resolved the PxP DMA directly to framebuffer implementation issues we were having (preferred method for us). The black lines were caused by enabling caching of the dma buffer I believe. I no longer have the patch done to the v4l2 display driver to resolve screen tearing.

0 Kudos
1,715 Views
Ananth
Contributor III

Hi Brandon Schaefer,

 Do you have the vanilla plain sample code for /dev/pxp_device to /dev/fb0 based rendering code ?

Thanks and regards,

Ananth

0 Kudos
1,715 Views
brandonschaefer
Contributor II

The examples mentioned earlier by jamesbone provide sufficient material to get things working.

www.nxp.com/lgfiles/NMG/MAD/YOCTO/imx-test-5.4.tar.gz

Specifically, test/pxp_lib_test/pxp_test.c

0 Kudos