Research opportunities to avoid texture copies
GTK uses wl_shm, which means that phoc ends up uploading every damaged part of the frame to GL domain with glTex(Sub)Image2D
. Just keeping up with fullscreen updates of wl_shm surfaces makes phoc take more than 30% of devkit's CPU core time.
Given that we don't have dedicated VRAM, theoretically it might be possible to avoid copies and just share the shared memory buffer with the GL driver. Whether it's actually possible in practice remains to be seen.
More or less related reading:
- https://software.intel.com/en-us/articles/zero-copy-texture-uploads-in-chrome-os
- https://01.org/chromium/2016/native-one-copy-texture-uploads-for-chrome-OS
- https://arrayfire.com/zero-copy-on-integrated-gpus/
- https://events17.linuxfoundation.org/sites/events/files/slides/ELC17-virtmem-exp_0.pdf (https://www.youtube.com/watch?v=LFU39w7lY08) - code: https://github.com/jaychiang001/tda2_kernel/commit/c940bbbdfa32d492eddbc255459bc505dff7bef5
- anything related to dma_bufs