UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Explorer
Explorer
7,990 Views
Registered: ‎10-29-2007

way to write out frames to VDMA from processor

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?)

0 Kudos
7 Replies
Explorer
Explorer
7,966 Views
Registered: ‎10-29-2007

Re: way to write out frames to VDMA from processor

I've managed to set up my VDMA in a master/free run mode such that I see video come out.

I still have the problem of how do you handshake/synchronize the writing from the processor and the reading from logic such that they don't operate on the same frame of data?
0 Kudos
Voyager
Voyager
7,958 Views
Registered: ‎05-31-2012

Re: way to write out frames to VDMA from processor

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

0 Kudos
Explorer
Explorer
7,945 Views
Registered: ‎10-29-2007

Re: way to write out frames to VDMA from processor

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?

0 Kudos
Voyager
Voyager
7,942 Views
Registered: ‎05-31-2012

Re: way to write out frames to VDMA from processor

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

0 Kudos
Visitor taukerman_lh
Visitor
7,761 Views
Registered: ‎10-28-2013

Re: way to write out frames to VDMA from processor

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.

 

 

0 Kudos
Voyager
Voyager
7,722 Views
Registered: ‎05-31-2012

Re: way to write out frames to VDMA from processor

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

0 Kudos
Observer balraj
Observer
1,903 Views
Registered: ‎05-14-2017

Re: way to write out frames to VDMA from processor

Hi taukerman_lh,

 

I hope you doing well. Our work also looks similar to yours and even problem too.

 

We are writing the image data to DDR3 using a VDMA(PL side) and then reading that data  from PS side & again we send that data over the Ethernet using lwip code.
 
Is it possible to write and read the data from the DDR3  in real time or else we have to stop the VDMA for a while and then grab that frame.Inour project we are writing to 0x13000000 location and reading from same location. Again we write the read data to 0x15000000 location to confirm, but the problem we are facing is unable to read.
 
If possible we both can share the information of our work (method/code) and make ourselves Productive.So could you please tell me whether i am going in a correct way or not.
 
Thank You
 
Best regards,
Balaraj K S
 
 
0 Kudos