Tool/software: Linux
I am attempting to use the Vivante GC320 2D Accelerator in the AM5728 to process a captured frame from the VIP port. I need to do this with zero copies for performance.
There are several posts on the TI E2E forums about sharing DMABUFs with the GC320. Most of them provide the galRunTest2_drm.c file as an example of allocating a DMABUF with omap_bo_new for a Target Surface for the GC320 to render into. I need the opposite example showing how to directly provide a DMABUF from the VIP port to the GC320.
I have written a small test app to do some processing on a VIP port frame. I am able to do some processing on a Source Surface I create myself and successfully render into a DRM DMABUF as the output or "Target Surface". However, I am unable to provide a DMABUF as an input surface to the 2D GPU from the VIP Port directly. If I mmap the VIP port DMABUF and pass it to the 2D Surface Creation routine directly, the Linux Kernel panics and the 2D Accelerator attempts to “recover” itself indefinitely. I have pasted some of the kernel traceback below. It complains about "stuck" DMA.
So my workaround right now is to copy it. I create a DMABUF based Surface ( in the same way as I created the output DMABUF which works ), and mmap it. Then I memcpy the VIP port’s mmap’d buffer into the surface buffer. This seems to work but has the cost of the extra 6 ms to memcpy from one DMABUF to the other before rendering in the 2D GPU using it as an input surface.
I have attached my small test application to this posting in hopes that someone can tell me what I am doing wrong. This application captures a frame from the VIP port, attempts to submit it to the GC320, and saves the file to disk. The resulting file can be viewed on Ubuntu with the following command:
convert -depth 8 -size 640x480+0 RGBA:gc320.rgb a.png ; eog a.png
How can I pass a DMABUF directly to the GC320 Source Surface? Thank you.
DMA Causes Kernel Panic:
[ 2572.062341] omap_l3_noc 44000000.ocp: L3 application error: target 5 mod:1 (unclearable) [ 2572.070549] omap_l3_noc 44000000.ocp: L3 debug error: target 5 mod:1 (unclearable) [ 2576.126358] [galcore]: GPU[0] hang, automatic recovery. [ 2580.229141] GPU[0](ChipModel=0x320 ChipRevision=0x5301): [ 2580.235542] ************************** [ 2580.239805] *** GPU STATE DUMP *** [ 2580.243578] ************************** [ 2580.247712] axi = 0x00000071 [ 2580.251225] idle = 0x7FFFFFFE [ 2580.254731] FE not idle [ 2580.257648] DMA appears to be stuck at this address: [ 2580.262816] 0x7E724000 [ 2580.265539] dmaLow = 0x48000000 [ 2580.269089] dmaHigh = 0x00000701 [ 2580.272599] dmaState = 0x00000000 [ 2580.276107] command state = 0 (PAR_IDLE_ST) [ 2580.281583] command DMA state = 0 (CMD_IDLE_ST) [ 2580.286739] command fetch state = 0 (FET_IDLE_ST) [ 2580.291820] DMA request state = 0 (REQ_IDLE_ST) [ 2580.296977] cal state = 0 (CAL_IDLE_ST) [ 2580.302064] VE request state = 0 (VER_IDLE_ST)