06-16-2014 11:40 AM
I'm processing image data in the ARM on Zynq. I'd like to take the resulting frames and write them to a VDMA controller so they can go out to a PL video output device.
If I just have a MM2S side of a VDMA controller how do I control read from the VDMA?
Does this seem correct:
1.) enter interrupt handler triggered from MM2S read
2.) get the current frame VDMA is working on (XAxiVdma_CurrFrameStore)?
2.) use memcpy to move image data into an appropriate place into DDR? (how do I know where to write it?)
06-17-2014 12:41 PM
06-18-2014 11:07 PM
Configure the VDMA as double buffer, slave free run
you should command the frame pointer in of the VDMA,
when your processor finishes to write, you switch the buffer..
you can use a GPIO to switch the buffer
06-19-2014 03:15 PM
Don't I need to triple buffer? When I switch the buffer the MM2S side of VDMA may be in the middle of reading out a frame and I may overwrite part of that data?
06-20-2014 02:59 AM
After the buffer is switched, before write again, you should monitor if the frame pointer in use by the VDMA has changed, then you can write again
If you use a triple buffer you are not sure of no overwrite data.. is up to you to manage the frame buffering to avoid this
07-18-2014 09:21 AM
I've done this exact thing in a project I am currently working on. It works quite well.
The VDMA is enabled on the read side (MM2S), and configured as a gen lock slave, a GPIO is connected to the mm2s_frame_ptr_in.
Use the PARK_PTR_REG to determine which buffer is in use, write to the other, then switch by writing to the GPIO.
The thing to remember is that the VDMA slave is one frame behind the frame_ptr_in. Therefore, write 0 to the GPIO to use buffer 1 and vice versa.
07-20-2014 11:31 PM
Good! Glad that it works for you too.
When you look at the PARK_PTR_REG to determine which buffer is in use, you should also read the value from the GPIO,
to write safely the GPIO value must be different from what you read at the PARK_PTR_REG, if is not the case, you must wait.
This in case your write rate is faster than read rate, to be sure to not overwrite the buffer
05-27-2017 03:44 AM
I hope you doing well. Our work also looks similar to yours and even problem too.