I'm trying to read from /dev/fb0
on a Linux machine.
I just open("/dev/fb0", O_RDWR)
, then mmap
, then memcpy
from the mapped pointer.
Everything seems fine, except the top right corner of the image I get is from the previous frame.
It seems like a cache coherency problem to me. Specifically I'm running it on an ARM chip where GPU and CPU shares memory.
Is it true? Is it common practice to invalidate cache after mmap
ing to frame buffer?
If I need to invalidate memory, which API call shall I use?
I'm trying Memory.h from TI's SDK, but is there a more standard/Linux/Posix alternative?