Skip to content

[RFC V3] drm_hwcomposer: Add optional gem caching mechanism

Andrii Chepurnyi requested to merge andrii82/drm-hwcomposer:rfq_caching into master


  • Cache only GRALLOC_USAGE_HW_FB buffers
  • Minor fix


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.

  1. Considering hypervisor-based guest domain, using drm [2] driver.

Comments and suggestions are very appreciated.

Signed-off-by: Andrii Chepurnyi

Edited by Roman Stratiienko

Merge request reports