As the title may not be fully clear, here's a complete description of the problem.
I've written a small library for the linux framebuffer using
mmap and some (higher) drawing routines, effectlively copying specific bytes to specific offsets in the mapped memory.
To measure the output latency I need to determine the moment that follows my
memcpy command (copied
n bytes into the framebuffer) to eventually generate output on the Raspberry's HDMI port.
According to the image below, the next step that follows the framebuffer memory copy is the
Hardware Video Scaler (HVS), again followed by the
I now want to determine the time it takes after the framebuffer
memcpy as close as possible. In other words, how long it takes for the graphics processsing unit and all other steps to produce the HDMI output from by framebuffer input (moments marked as t1 and t2 in the image below).
Is this even possible? Would you (re)write some kernel code to achieve that or is it possible from userland (or even within some C code)?
- Raspberry PI 4 latest
- OS: Raspbian Buster Lite Programming
- language: C