page_pool.h 767 B

123456789101112131415161718192021222324252627
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * DMA BUF PagePool implementation
  4. * Based on earlier ION code by Google
  5. *
  6. * Copyright (C) 2011 Google, Inc.
  7. * Copyright (C) 2020 Linaro Ltd.
  8. */
  9. #ifndef _DMABUF_PAGE_POOL_H
  10. #define _DMABUF_PAGE_POOL_H
  11. #include <linux/mm_types.h>
  12. #include <linux/types.h>
  13. struct dmabuf_page_pool;
  14. struct dmabuf_page_pool *dmabuf_page_pool_create(gfp_t gfp_mask,
  15. unsigned int order);
  16. void dmabuf_page_pool_destroy(struct dmabuf_page_pool *pool);
  17. struct page *dmabuf_page_pool_alloc(struct dmabuf_page_pool *pool);
  18. void dmabuf_page_pool_free(struct dmabuf_page_pool *pool, struct page *page);
  19. /* get pool size in bytes */
  20. unsigned long dmabuf_page_pool_get_size(struct dmabuf_page_pool *pool);
  21. #endif /* _DMABUF_PAGE_POOL_H */