When the camera, RGA, and display work in parallel, returning the buffer to the acquisition queue early may overwrite the data that is still being displayed in the next frame.
Draw a life cycle for each buffer
Record collection delivery, import accelerator, submission, completion, downstream release, and re-enqueue. Asynchronous submission return only proves that the task has entered the processing flow. Check the completion notification, synchronization fence and ownership agreement of the current API. CPU reading and writing must also comply with the corresponding synchronization requirements.
Find the reuse opportunity with the serial number
Add a recognizable pattern to the test frame, and the log is recorded according to the buffer index and service frame number. If the next enqueue of the same buffer occurs before the downstream completion of the previous frame, priority is given to correcting the release condition. Increasing the number of buffers may reduce the frequency of occurrences, but does not eliminate race conditions.
Deciding where to copy
If a slow consumer only saves screenshots occasionally, it may be more cost-effective to copy its data alone than to occupy the main collection pool for a long time. Use peak memory, main channel dropped frames, and tail latency to evaluate changes, so that zero copy can serve stable output.
Board documentation and references

- ArmSoM Sige7 · hardware and interface manual · Sige7 · product page
- Linux kernel DMA-BUF synchronization and sharing
- Rockchip librga interface and constraints
