• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
10 #ifndef _DMABUF_PAGE_POOL_H
11 #define _DMABUF_PAGE_POOL_H
12 
13 #include <linux/mm_types.h>
14 #include <linux/types.h>
15 
16 struct dmabuf_page_pool;
17 
18 struct dmabuf_page_pool *dmabuf_page_pool_create(gfp_t gfp_mask,
19 						 unsigned int order);
20 void dmabuf_page_pool_destroy(struct dmabuf_page_pool *pool);
21 struct page *dmabuf_page_pool_alloc(struct dmabuf_page_pool *pool);
22 void dmabuf_page_pool_free(struct dmabuf_page_pool *pool, struct page *page);
23 
24 /* get pool size in bytes */
25 unsigned long dmabuf_page_pool_get_size(struct dmabuf_page_pool *pool);
26 
27 #endif /* _DMABUF_PAGE_POOL_H */
28