I currently have the following setup:
An EGL dummy rendering context on a TAO-3530 board. Within this context I'm creating an FBO with a NATIVE_PIXMAP_STRUCT attached as a 32bit 2D texture.
I'm rendering my graphical context into this FBO, calling eglWait() and transfer the data based on the userspace pointer I got from CMEM to an FPGA via GPMC without involving the DMA controller (just using __raw_read and __raw_write).
I enabled caching when calling CMEM_alloc first, because the performance of the GPMC upload was really bad. But unfortunately I got only partial image data when uploading the data to the FPGA. I then tried disabling the caching, but the problem still exists.
Is there any known bug within the SGX driver, that prevents eglWait(), glFinish or glFlush from synchronizing the graphical output?
The problem seems to be fixed if I enable caching and calling both
CMEM_cacheInv( (void*)((NATIVE_PIXMAP_STRUCT*) eglPixmap)->lAddress, ((NATIVE_PIXMAP_STRUCT*) m_eglPixmap)->sizeInBytes );
CMEM_cacheWbInv( (void*)((NATIVE_PIXMAP_STRUCT*) eglPixmap)->lAddress, ((NATIVE_PIXMAP_STRUCT*) m_eglPixmap)->sizeInBytes );
before the upload. But since calling one method alone does not fix the problem, and because the problem exists even if I disable caching for the allocated CMEM block, I guess that this is caused due to some timing issues and not because it really fixes the problem. And because of calling those function needs about 40-60ms I would prefer to find the real solution that might cost less performance.
Does anyone has an idea how I can ensure that the data is written completely to memory, before I upload it to the FPGA?