I'm working on an i.MX6UltraLite processor.
I noticed a call to mdelay(5) in the pxp_buf_queue function in mxc_pxp_v4l2.c.
This function is called once per every frame that is submitted to video4linux.
This means that if I play a video @ 25fps, about 12% CPU time is spent busy waiting.
This is confirmed by running gstreamer with the perf tool.
Is this delay really needed? What is its purpose?
CPU is consumed because mdelay(5) causes the cpu to busy wait for 5 ms.
Please check out the kernel docs https://www.kernel.org/doc/Documentation/timers/timers-howto.txt :
These functions use the jiffie estimation of clock speed and will busy wait for enough loop cycles to achieve the desired delay