I am preparing for a demo in which I want to visualize the results at the frame rate at which they are produced. I have adjusted the HDMI Test project as Emilie suggested in viewtopic.php?f=8&t=87.
Unfortunately due to the restart of the VDMA Module the whole screen turn black and delays the output between consecutive frames.
In order to change this I had a look at the Sobel Demo and saw that with "XAxiVdma_StartParking" I can tell the VDMA to read a new frame from a different address. This is what I have implemented so far:
Code: Select all
XAxiVdma Vdma;
XAxiVdma_DmaSetup ReadCfg;
int vdma_start() {
int Status;
// MM2S Startup
Status = XAxiVdma_DmaStart(&Vdma, XAXIVDMA_READ);
if (Status != XST_SUCCESS)
{
xil_printf("Start read transfer failed %d\n\r", Status);
return XST_FAILURE;
}
return XST_SUCCESS;
}
int vdma_stop() {
XAxiVdma_DmaStop(&Vdma, XAXIVDMA_READ);
return XST_SUCCESS;
}
XAxiVdma_Config *Config;
int Status;
int i;
Config = XAxiVdma_LookupConfig(DeviceID);
if (NULL == Config) {
xil_printf("XAxiVdma_LookupConfig failure\r\n");
return XST_FAILURE;
}
Config->MaxFrameStoreNum = 3;
Config->FlushonFsync = 1;
Status = XAxiVdma_CfgInitialize(&Vdma, Config, Config->BaseAddress);
if (Status != XST_SUCCESS) {
xil_printf("XAxiVdma_CfgInitialize failure\r\n");
return XST_FAILURE;
}
ReadCfg.EnableCircularBuf = 1;
ReadCfg.EnableFrameCounter = 0;
ReadCfg.FixedFrameStoreAddr = 0;
ReadCfg.EnableSync = 1;
ReadCfg.PointNum = 1;
ReadCfg.FrameDelay = 0;
ReadCfg.VertSizeInput = IMG_HEIGHT;
ReadCfg.HoriSizeInput = IMG_WIDTH << 2;
ReadCfg.Stride = ReadCfg.HoriSizeInput;
ReadCfg.FrameStoreStartAddr[0] = IMG_ADDR_1;
ReadCfg.FrameStoreStartAddr[1] = IMG_ADDR_2;
Status = XAxiVdma_DmaConfig(&Vdma, XAXIVDMA_READ, &ReadCfg);
if (Status != XST_SUCCESS) {
xdbg_printf(XDBG_DEBUG_ERROR,
"Read channel config failed %d\r\n", Status);
return XST_FAILURE;
}
Status = XAxiVdma_DmaSetBufferAddr(&Vdma, XAXIVDMA_READ, ReadCfg.FrameStoreStartAddr);
Status = vdma_start();
if (Status != XST_SUCCESS) {
xil_printf("error starting VDMA..!");
return Status;
}
while(1)
{
int retVal = 0;
if ((retVal = XAxiVdma_StartParking(&Vdma, 0,XAXIVDMA_READ))) {
xil_printf("ERROR; parking reading frame failed: %d\r\n", retVal);
}
xil_printf("Start Parking Status: %d\r\n", retVal);
while (0 != XAxiVdma_CurrFrameStore(&Vdma, XAXIVDMA_READ)){};
// DO PROCESSING AND WRITE RESULT INTO IMG_ADDR_2
if ((retVal = XAxiVdma_StartParking(&Vdma, 1,XAXIVDMA_READ))) {
xil_printf("ERROR; parking reading frame failed: %d\r\n", retVal);
}
xil_printf("Start Parking Status: %d\r\n", retVal);
while (1 != XAxiVdma_CurrFrameStore(&Vdma, XAXIVDMA_READ)){};
// DO PROCESSING AND WRITE RESULT INTO IMG_ADDR_1
}
Furthermore I have increased the FrameBuffer of the VDMA IP to 3 in the Block Diagram and exported the new HW Design.
Even though the code runs through the loop and does the processing and parking successfully, the screen still shows the first image. It doesn't refresh. What am I doing wrong? Is the Test Pattern Generator between the VDMA and the HDMI Out causing the problem?
Thanks for your help.
\Boitumelo