• Vasily Khoruzhick's avatar
    lima: implement BO cache · d2147787
    Vasily Khoruzhick authored
    Allocating BOs is expensive, so we should avoid doing that by caching
    freed BOs.
    BO cache is modelled after one in v3d driver and works as follows:
    - in lima_bo_create() check if we have matching BO in cache and return
      it if there's one, allocate new BO otherwise.
    - in lima_bo_unreference() (renamed from lima_bo_free()): put BO in
      cache instead of freeing it and remove all stale BOs from cache
    Reviewed-by: Qiang Yu's avatarQiang Yu <yuq825@gmail.com>
    Signed-off-by: Vasily Khoruzhick's avatarVasily Khoruzhick <anarsoul@gmail.com>