[RFC V3] drm_hwcomposer: Add optional gem caching mechanism
V3:
- Cache only GRALLOC_USAGE_HW_FB buffers
- Minor fix
V2:
diff from V1:
- Use prime_fd as a key
- Create separate importer per display
- Some comments were addressed
V1: On some platform[1] frequent calls of the drmPrimeFDToHandle/drmModeAddFB2 may cause tremendous performance degradation. In case, if DRM driver[2] has only a primary plane(i.e. all composition done by OpenGL) there is no practical sense to import/release the same render targets per each frame. This patch utilizes specific Imagination field ui64Stamp of the IMG_native_handle_t to clearly identify buffer on which native handle points. Display hotplug event handling is needed to deallocate all handles/gem connected with a display.
- Considering hypervisor-based guest domain, using drm [2] driver.
- https://elixir.bootlin.com/linux/v5.0/source/drivers/gpu/drm/xen
Comments and suggestions are very appreciated.
Signed-off-by: Andrii Chepurnyi andrii_chepurnyi@epam.com